aboutsummaryrefslogtreecommitdiff
path: root/src/openvic2/GameManager.hpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-05-03 20:37:26 +0200
committer Hop311 <hop3114@gmail.com>2023-05-03 20:37:26 +0200
commit64bbf86b623a3cca2eaf9009d7acdcde067592e3 (patch)
tree5d607f28019675c9eaaa2883acf036717fa45b2f /src/openvic2/GameManager.hpp
parentc92481448159d3a363d6a99b3025bd2358c3dab6 (diff)
Moved code to src/openvic2
Diffstat (limited to 'src/openvic2/GameManager.hpp')
-rw-r--r--src/openvic2/GameManager.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/openvic2/GameManager.hpp b/src/openvic2/GameManager.hpp
new file mode 100644
index 0000000..70e98bd
--- /dev/null
+++ b/src/openvic2/GameManager.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "GameAdvancementHook.hpp"
+#include "map/Map.hpp"
+
+namespace OpenVic2 {
+ struct GameManager {
+ using state_updated_func_t = std::function<void()>;
+
+ Map map;
+ BuildingManager building_manager;
+ GameAdvancementHook clock;
+ private:
+ Date today;
+ state_updated_func_t state_updated;
+ bool needs_update;
+
+ void set_needs_update();
+ void update_state();
+ void tick();
+ public:
+ GameManager(state_updated_func_t state_updated_callback);
+
+ return_t setup();
+
+ Date const& get_today() const;
+ return_t expand_building(index_t province_index, std::string const& building_type_identifier);
+ };
+}