diff options
author | Hop311 <Hop3114@gmail.com> | 2024-07-04 10:39:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-04 10:39:28 +0200 |
commit | 6797e64ce8179635d56b73b5b4783eca560cbf11 (patch) | |
tree | 0c06560ddae94550077c997f8b7e14f69057f236 /extension/src/openvic-extension/singletons/GameSingleton.hpp | |
parent | 5a35e5f511c6af55c63cc0303e05da2812ab21a8 (diff) | |
parent | db246d901d1ccd39b0ed3fc024f28ad7b6b4848b (diff) |
Merge pull request #235 from OpenVicProject/instance-definition-managers
Update to use SIM Instance and 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; |