Skip to content

Commit

Permalink
curve: Refactor and move curve containers to subfolder.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Jan 19, 2025
1 parent ad747a6 commit d571822
Show file tree
Hide file tree
Showing 21 changed files with 46 additions and 44 deletions.
8 changes: 1 addition & 7 deletions libopenage/curve/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
add_sources(libopenage
array.cpp
base_curve.cpp
continuous.cpp
discrete.cpp
discrete_mod.cpp
element_wrapper.cpp
interpolated.cpp
iterator.cpp
keyframe.cpp
keyframe_container.cpp
map.cpp
map_filter_iterator.cpp
queue.cpp
queue_filter_iterator.cpp
segmented.cpp
)

add_subdirectory("container")
add_subdirectory("tests")
9 changes: 9 additions & 0 deletions libopenage/curve/container/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_sources(libopenage
array.cpp
element_wrapper.cpp
iterator.cpp
map.cpp
map_filter_iterator.cpp
queue.cpp
queue_filter_iterator.cpp
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024-2024 the openage authors. See copying.md for legal info.
// Copyright 2024-2025 the openage authors. See copying.md for legal info.


#include "array.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <array>

#include "curve/iterator.h"
#include "curve/container/iterator.h"
#include "curve/keyframe_container.h"
#include "event/evententity.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024-2024 the openage authors. See copying.md for legal info.
// Copyright 2024-2025 the openage authors. See copying.md for legal info.

#include "element_wrapper.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024-2024 the openage authors. See copying.md for legal info.
// Copyright 2024-2025 the openage authors. See copying.md for legal info.

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2018 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#include "iterator.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2024 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2018 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#include "map.h"

Expand Down
7 changes: 3 additions & 4 deletions libopenage/curve/map.h → libopenage/curve/container/map.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2024 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#pragma once

Expand All @@ -7,8 +7,8 @@
#include <unordered_map>
#include <utility>

#include "curve/map_filter_iterator.h"
#include "curve/element_wrapper.h"
#include "curve/container/element_wrapper.h"
#include "curve/container/map_filter_iterator.h"
#include "time/time.h"
#include "util/fixed_point.h"

Expand All @@ -21,7 +21,6 @@ namespace openage::curve {
*/
template <typename key_t, typename val_t>
class UnorderedMap {

/**
* Data holder. Maps keys to map elements.
* Map elements themselves store when they are valid.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2018 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#include "map_filter_iterator.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2017-2024 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#pragma once

#include "curve/iterator.h"
#include "curve/container/iterator.h"
#include "time/time.h"


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2018 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#include "queue.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2024 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#pragma once

Expand All @@ -11,9 +11,9 @@

#include "error/error.h"

#include "curve/iterator.h"
#include "curve/queue_filter_iterator.h"
#include "curve/element_wrapper.h"
#include "curve/container/element_wrapper.h"
#include "curve/container/iterator.h"
#include "curve/container/queue_filter_iterator.h"
#include "event/evententity.h"
#include "time/time.h"
#include "util/fixed_point.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2018 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#include "queue_filter_iterator.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2017-2024 the openage authors. See copying.md for legal info.
// Copyright 2017-2025 the openage authors. See copying.md for legal info.

#pragma once

#include "curve/iterator.h"
#include "curve/container/iterator.h"
#include "time/time.h"


Expand Down
12 changes: 6 additions & 6 deletions libopenage/curve/tests/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include <unordered_map>
#include <unordered_set>

#include "curve/array.h"
#include "curve/iterator.h"
#include "curve/map.h"
#include "curve/map_filter_iterator.h"
#include "curve/queue.h"
#include "curve/queue_filter_iterator.h"
#include "curve/container/array.h"
#include "curve/container/iterator.h"
#include "curve/container/map.h"
#include "curve/container/map_filter_iterator.h"
#include "curve/container/queue.h"
#include "curve/container/queue_filter_iterator.h"
#include "event/event_loop.h"
#include "testing/testing.h"

Expand Down
6 changes: 3 additions & 3 deletions libopenage/gamestate/component/api/live.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2021-2023 the openage authors. See copying.md for legal info.
// Copyright 2021-2025 the openage authors. See copying.md for legal info.

#include "live.h"

#include <optional>

#include "curve/container/iterator.h"
#include "curve/container/map_filter_iterator.h"
#include "curve/discrete.h"
#include "curve/iterator.h"
#include "curve/map_filter_iterator.h"
#include "gamestate/component/types.h"


Expand Down
4 changes: 2 additions & 2 deletions libopenage/gamestate/component/api/live.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2024 the openage authors. See copying.md for legal info.
// Copyright 2021-2025 the openage authors. See copying.md for legal info.

#pragma once

Expand All @@ -7,7 +7,7 @@

#include <nyan/nyan.h>

#include "curve/map.h"
#include "curve/container/map.h"
#include "gamestate/component/api_component.h"
#include "gamestate/component/types.h"
#include "time/time.h"
Expand Down
4 changes: 2 additions & 2 deletions libopenage/gamestate/component/internal/command_queue.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2021-2024 the openage authors. See copying.md for legal info.
// Copyright 2021-2025 the openage authors. See copying.md for legal info.

#pragma once

#include <memory>

#include "curve/queue.h"
#include "curve/container/queue.h"
#include "gamestate/component/internal/commands/base_command.h"
#include "gamestate/component/internal_component.h"
#include "gamestate/component/types.h"
Expand Down
4 changes: 2 additions & 2 deletions libopenage/gamestate/entity_factory.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023-2023 the openage authors. See copying.md for legal info.
// Copyright 2023-2025 the openage authors. See copying.md for legal info.

#include "entity_factory.h"

Expand All @@ -10,8 +10,8 @@

#include "error/error.h"

#include "curve/container/queue.h"
#include "curve/discrete.h"
#include "curve/queue.h"
#include "event/event_loop.h"
#include "gamestate/activity/activity.h"
#include "gamestate/activity/condition/command_in_queue.h"
Expand Down

0 comments on commit d571822

Please sign in to comment.