From 42d9d1d5417deb5979a9d5775cfe97dcff4b77ba Mon Sep 17 00:00:00 2001 From: Hop311 Date: Tue, 16 May 2023 19:59:39 +0100 Subject: Changed from OpenVic2 to OpenVic --- src/openvic/GameManager.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/openvic/GameManager.hpp (limited to 'src/openvic/GameManager.hpp') diff --git a/src/openvic/GameManager.hpp b/src/openvic/GameManager.hpp new file mode 100644 index 0000000..e1a9e9b --- /dev/null +++ b/src/openvic/GameManager.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "GameAdvancementHook.hpp" +#include "map/Map.hpp" +#include "economy/Good.hpp" + +namespace OpenVic { + struct GameManager { + using state_updated_func_t = std::function; + + Map map; + BuildingManager building_manager; + GoodManager good_manager; + GameAdvancementHook clock; + private: + time_t session_start; /* SS-54, as well as allowing time-tracking */ + 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); + }; +} -- cgit v1.2.3-56-ga3b1