diff options
author | hop311 <hop3114@gmail.com> | 2024-06-13 00:34:06 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-06-13 21:26:35 +0200 |
commit | db246d901d1ccd39b0ed3fc024f28ad7b6b4848b (patch) | |
tree | 0c06560ddae94550077c997f8b7e14f69057f236 /extension/src/openvic-extension/singletons/GameSingleton.hpp | |
parent | 72ae774f249fb408d5a3e3de09695c251906a7cc (diff) |
Updated SIM to use separate Instance and Definition Managersinstance-definition-managers
Diffstat (limited to 'extension/src/openvic-extension/singletons/GameSingleton.hpp')
-rw-r--r-- | extension/src/openvic-extension/singletons/GameSingleton.hpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/extension/src/openvic-extension/singletons/GameSingleton.hpp b/extension/src/openvic-extension/singletons/GameSingleton.hpp index eab8f63..b29e588 100644 --- a/extension/src/openvic-extension/singletons/GameSingleton.hpp +++ b/extension/src/openvic-extension/singletons/GameSingleton.hpp @@ -13,8 +13,7 @@ namespace OpenVic { static inline GameSingleton* singleton = nullptr; - GameManager PROPERTY_REF(game_manager); - Dataloader PROPERTY(dataloader); + GameManager game_manager; godot::Vector2i image_subdivisions; godot::Ref<godot::Texture2DArray> province_shape_texture; @@ -54,6 +53,22 @@ namespace OpenVic { static void setup_logger(); + inline constexpr Dataloader const& get_dataloader() const { + return game_manager.get_dataloader(); + } + + inline constexpr DefinitionManager const& get_definition_manager() const { + return game_manager.get_definition_manager(); + } + + inline constexpr InstanceManager* get_instance_manager() { + return game_manager.get_instance_manager(); + } + + inline constexpr InstanceManager const* get_instance_manager() const { + return game_manager.get_instance_manager(); + } + /* Load the game's defines in compatiblity mode from the filepath * pointing to the defines folder. */ godot::Error load_defines_compatibility_mode(godot::PackedStringArray const& file_paths); @@ -63,6 +78,7 @@ namespace OpenVic { /* Post-load/restart game setup - reset the game to post-load state and load the specified bookmark. */ godot::Error setup_game(int32_t bookmark_index); + godot::Error start_game_session(); int32_t get_province_index_from_uv_coords(godot::Vector2 const& coords) const; |