aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/GameManager.hpp
diff options
context:
space:
mode:
author ClarkeCode <clarke.john.robert@gmail.com>2023-04-27 22:13:52 +0200
committer ClarkeCode <clarke.john.robert@gmail.com>2023-04-27 22:13:52 +0200
commit0b273743b480874281a8987c72b2f1b666bc289a (patch)
tree3f5d5a6316ac66407e61c8a56fe732cdf06209e5 /extension/src/openvic2/GameManager.hpp
parent98dd680a641a2cbe0f1f93202a5beffdfd35c9f7 (diff)
parent10053cf259c55ee45803268a844edf1011d8a16b (diff)
Merge branch 'main' of github.com:OpenVic2Project/OpenVic2 into goods
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..65cd566
--- /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;
+
+ 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(Province::index_t province_index, std::string const& building_type_identifier);
+ };
+}