diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/menu_system.cpp | 2 | ||||
-rw-r--r-- | src/menu_system.h | 20 | ||||
-rw-r--r-- | src/system.h | 3 |
5 files changed, 27 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5427efc..c5c7767 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -56,6 +56,7 @@ add_executable(tanetane | |||
56 | src/effect_system.cpp | 56 | src/effect_system.cpp |
57 | src/behaviour_system.cpp | 57 | src/behaviour_system.cpp |
58 | src/mirror_system.cpp | 58 | src/mirror_system.cpp |
59 | src/menu_system.cpp | ||
59 | ) | 60 | ) |
60 | 61 | ||
61 | set_property(TARGET tanetane PROPERTY CXX_STANDARD 17) | 62 | set_property(TARGET tanetane PROPERTY CXX_STANDARD 17) |
diff --git a/src/main.cpp b/src/main.cpp index 56d4301..f1a8e42 100644 --- a/src/main.cpp +++ b/src/main.cpp | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "effect_system.h" | 15 | #include "effect_system.h" |
16 | #include "behaviour_system.h" | 16 | #include "behaviour_system.h" |
17 | #include "mirror_system.h" | 17 | #include "mirror_system.h" |
18 | #include "menu_system.h" | ||
18 | 19 | ||
19 | void loop(Renderer& renderer, std::mt19937& rng) { | 20 | void loop(Renderer& renderer, std::mt19937& rng) { |
20 | Game game(renderer, rng); | 21 | Game game(renderer, rng); |
@@ -28,6 +29,7 @@ void loop(Renderer& renderer, std::mt19937& rng) { | |||
28 | game.emplaceSystem<CameraSystem>(); | 29 | game.emplaceSystem<CameraSystem>(); |
29 | game.emplaceSystem<MessageSystem>(); | 30 | game.emplaceSystem<MessageSystem>(); |
30 | game.emplaceSystem<EffectSystem>(); | 31 | game.emplaceSystem<EffectSystem>(); |
32 | game.emplaceSystem<MenuSystem>(); | ||
31 | 33 | ||
32 | game.loadMap("hallucination_interior"); | 34 | game.loadMap("hallucination_interior"); |
33 | 35 | ||
diff --git a/src/menu_system.cpp b/src/menu_system.cpp new file mode 100644 index 0000000..a5f3539 --- /dev/null +++ b/src/menu_system.cpp | |||
@@ -0,0 +1,2 @@ | |||
1 | #include "menu_system.h" | ||
2 | #include "game.h" | ||
diff --git a/src/menu_system.h b/src/menu_system.h new file mode 100644 index 0000000..46963b2 --- /dev/null +++ b/src/menu_system.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef MENU_SYSTEM_H_205861EC | ||
2 | #define MENU_SYSTEM_H_205861EC | ||
3 | |||
4 | #include "system.h" | ||
5 | |||
6 | class Game; | ||
7 | |||
8 | class MenuSystem : public System { | ||
9 | public: | ||
10 | |||
11 | static constexpr SystemKey Key = SystemKey::Menu; | ||
12 | |||
13 | explicit MenuSystem(Game& game) : game_(game) {} | ||
14 | |||
15 | private: | ||
16 | |||
17 | Game& game_; | ||
18 | }; | ||
19 | |||
20 | #endif /* end of include guard: MENU_SYSTEM_H_205861EC */ | ||
diff --git a/src/system.h b/src/system.h index a129b3b..b712b72 100644 --- a/src/system.h +++ b/src/system.h | |||
@@ -11,7 +11,8 @@ enum class SystemKey { | |||
11 | Animation, | 11 | Animation, |
12 | Camera, | 12 | Camera, |
13 | Message, | 13 | Message, |
14 | Effect | 14 | Effect, |
15 | Menu | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | class System { | 18 | class System { |