aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/GameManager.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-04-23 20:52:33 +0200
committer GitHub <noreply@github.com>2023-04-23 20:52:33 +0200
commit7f433fe019310ecfd1d1c46afd97cbfcb210c88f (patch)
tree60971db586e78761341f2b48110d149b1ba0db9d /extension/src/openvic2/GameManager.hpp
parentc041b291c887db90a4e1112ffdd1e56865c27b13 (diff)
parentd3f3187209cb4085f27f95ce8ad2a77af25704fd (diff)
Merge pull request #94 from OpenVic2Project/province-buildings
Province buildings
Diffstat (limited to 'extension/src/openvic2/GameManager.hpp')
-rw-r--r--extension/src/openvic2/GameManager.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/extension/src/openvic2/GameManager.hpp b/extension/src/openvic2/GameManager.hpp
new file mode 100644
index 0000000..cba0180
--- /dev/null
+++ b/extension/src/openvic2/GameManager.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "openvic2/GameAdvancementHook.hpp"
+#include "openvic2/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 = true;
+
+ void set_needs_update();
+ void update_state();
+ void tick();
+ public:
+ GameManager(state_updated_func_t state_updated_callback);
+
+ void finished_loading_data();
+
+ Date const& get_today() const;
+ return_t expand_building(Province::index_t province_index, std::string const& building_type_identifier);
+ };
+}