diff options
author | hop311 <hop3114@gmail.com> | 2024-06-07 00:20:58 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-06-07 12:28:16 +0200 |
commit | 1198a780916e65cae048dd3478f614c1d18db846 (patch) | |
tree | f681dd2e76d489ba6e7beea44ae6ebd59e9d51f3 /src/openvic-simulation/history | |
parent | c94a06477fc3930e8f8f2e5f971fc4b5b838ea0d (diff) |
Separated MapDefinition and MapInstancemap-instance
Diffstat (limited to 'src/openvic-simulation/history')
4 files changed, 10 insertions, 9 deletions
diff --git a/src/openvic-simulation/history/CountryHistory.cpp b/src/openvic-simulation/history/CountryHistory.cpp index 90fe995..9ef230e 100644 --- a/src/openvic-simulation/history/CountryHistory.cpp +++ b/src/openvic-simulation/history/CountryHistory.cpp @@ -67,8 +67,9 @@ bool CountryHistoryMap::_load_history_entry( game_manager, dataloader, deployment_manager, entry.get_date(), value, key, value ); }, - "capital", ZERO_OR_ONE, - game_manager.get_map().expect_province_definition_identifier(assign_variable_callback_pointer_opt(entry.capital)), + "capital", ZERO_OR_ONE, game_manager.get_map_definition().expect_province_definition_identifier( + assign_variable_callback_pointer_opt(entry.capital) + ), "primary_culture", ZERO_OR_ONE, culture_manager.expect_culture_identifier(assign_variable_callback_pointer_opt(entry.primary_culture)), "culture", ZERO_OR_MORE, culture_manager.expect_culture_identifier( diff --git a/src/openvic-simulation/history/DiplomaticHistory.cpp b/src/openvic-simulation/history/DiplomaticHistory.cpp index f56b3dc..c8aa934 100644 --- a/src/openvic-simulation/history/DiplomaticHistory.cpp +++ b/src/openvic-simulation/history/DiplomaticHistory.cpp @@ -322,7 +322,7 @@ bool DiplomaticHistoryManager::load_war_history_file(GameManager const& game_man assign_variable_callback_pointer(*third_party) ), "state_province_id", ZERO_OR_ONE, - game_manager.get_map().expect_province_definition_identifier( + game_manager.get_map_definition().expect_province_definition_identifier( assign_variable_callback_pointer(*target) ) )(value); diff --git a/src/openvic-simulation/history/ProvinceHistory.cpp b/src/openvic-simulation/history/ProvinceHistory.cpp index 645cf8d..87d0713 100644 --- a/src/openvic-simulation/history/ProvinceHistory.cpp +++ b/src/openvic-simulation/history/ProvinceHistory.cpp @@ -22,7 +22,7 @@ bool ProvinceHistoryMap::_load_history_entry( CountryManager const& country_manager = game_manager.get_country_manager(); GoodManager const& good_manager = game_manager.get_economy_manager().get_good_manager(); IdeologyManager const& ideology_manager = game_manager.get_politics_manager().get_ideology_manager(); - TerrainTypeManager const& terrain_type_manager = game_manager.get_map().get_terrain_type_manager(); + TerrainTypeManager const& terrain_type_manager = game_manager.get_map_definition().get_terrain_type_manager(); using enum ProvinceInstance::colony_status_t; static const string_map_t<ProvinceInstance::colony_status_t> colony_status_map { @@ -120,8 +120,8 @@ void ProvinceHistoryManager::reserve_more_province_histories(size_t size) { } } -void ProvinceHistoryManager::lock_province_histories(Map const& map, bool detailed_errors) { - std::vector<ProvinceDefinition> const& provinces = map.get_province_definitions(); +void ProvinceHistoryManager::lock_province_histories(MapDefinition const& map_definition, bool detailed_errors) { + std::vector<ProvinceDefinition> const& provinces = map_definition.get_province_definitions(); std::vector<bool> province_checklist(provinces.size()); for (decltype(province_histories)::value_type const& entry : province_histories) { @@ -231,7 +231,7 @@ bool ProvinceHistoryManager::load_pop_history_file( Logger::error("Attempted to load pop history file after province history registry was locked!"); return false; } - return game_manager.get_map().expect_province_definition_dictionary( + return game_manager.get_map_definition().expect_province_definition_dictionary( [this, &game_manager, date, non_integer_size](ProvinceDefinition const& province, ast::NodeCPtr node) -> bool { ProvinceHistoryMap* province_history = _get_or_make_province_history(province); if (province_history != nullptr) { diff --git a/src/openvic-simulation/history/ProvinceHistory.hpp b/src/openvic-simulation/history/ProvinceHistory.hpp index 27d744d..c4cbd49 100644 --- a/src/openvic-simulation/history/ProvinceHistory.hpp +++ b/src/openvic-simulation/history/ProvinceHistory.hpp @@ -68,7 +68,7 @@ namespace OpenVic { ); }; - struct Map; + struct MapDefinition; struct ProvinceHistoryManager { private: @@ -81,7 +81,7 @@ namespace OpenVic { ProvinceHistoryManager() = default; void reserve_more_province_histories(size_t size); - void lock_province_histories(Map const& map, bool detailed_errors); + void lock_province_histories(MapDefinition const& map_definition, bool detailed_errors); bool is_locked() const; ProvinceHistoryMap const* get_province_history(ProvinceDefinition const* province) const; |