diff options
Diffstat (limited to 'src/openvic-simulation/history')
-rw-r--r-- | src/openvic-simulation/history/ProvinceHistory.cpp | 16 | ||||
-rw-r--r-- | src/openvic-simulation/history/ProvinceHistory.hpp | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/openvic-simulation/history/ProvinceHistory.cpp b/src/openvic-simulation/history/ProvinceHistory.cpp index 379c7d1..991dfee 100644 --- a/src/openvic-simulation/history/ProvinceHistory.cpp +++ b/src/openvic-simulation/history/ProvinceHistory.cpp @@ -33,10 +33,10 @@ bool ProvinceHistoryMap::_load_history_entry( [this, &game_manager, &building_manager, &entry]( std::string_view key, ast::NodeCPtr value) -> bool { // used for province buildings like forts or railroads - Building const* building = building_manager.get_building_by_identifier(key); - if (building != nullptr) { - return expect_uint<Building::level_t>([&entry, building](Building::level_t level) -> bool { - entry.province_buildings[building] = level; + BuildingType const* building_type = building_manager.get_building_type_by_identifier(key); + if (building_type != nullptr) { + return expect_uint<BuildingType::level_t>([&entry, building_type](BuildingType::level_t level) -> bool { + entry.province_buildings[building_type] = level; return true; })(value); } @@ -83,17 +83,17 @@ bool ProvinceHistoryMap::_load_history_entry( return ret; }, "state_building", ZERO_OR_MORE, [&building_manager, &entry](ast::NodeCPtr node) -> bool { - Building const* building = nullptr; + BuildingType const* building_type = nullptr; uint8_t level = 0; const bool ret = expect_dictionary_keys( "level", ONE_EXACTLY, expect_uint(assign_variable_callback(level)), - "building", ONE_EXACTLY, building_manager.expect_building_identifier( - assign_variable_callback_pointer(building) + "building", ONE_EXACTLY, building_manager.expect_building_type_identifier( + assign_variable_callback_pointer(building_type) ), "upgrade", ZERO_OR_ONE, success_callback // doesn't appear to have an effect )(node); - entry.state_buildings[building] = level; + entry.state_buildings[building_type] = level; return ret; } )(root); diff --git a/src/openvic-simulation/history/ProvinceHistory.hpp b/src/openvic-simulation/history/ProvinceHistory.hpp index d0136bb..e4adc08 100644 --- a/src/openvic-simulation/history/ProvinceHistory.hpp +++ b/src/openvic-simulation/history/ProvinceHistory.hpp @@ -5,7 +5,7 @@ #include <vector> #include "openvic-simulation/country/Country.hpp" -#include "openvic-simulation/economy/Building.hpp" +#include "openvic-simulation/economy/BuildingType.hpp" #include "openvic-simulation/economy/Good.hpp" #include "openvic-simulation/history/Bookmark.hpp" #include "openvic-simulation/history/HistoryMap.hpp" @@ -30,8 +30,8 @@ namespace OpenVic { std::optional<Good const*> PROPERTY(rgo); std::optional<Province::life_rating_t> PROPERTY(life_rating); std::optional<TerrainType const*> PROPERTY(terrain_type); - std::map<Building const*, Building::level_t> PROPERTY(province_buildings); - std::map<Building const*, Building::level_t> PROPERTY(state_buildings); + std::map<BuildingType const*, BuildingType::level_t> PROPERTY(province_buildings); + std::map<BuildingType const*, BuildingType::level_t> PROPERTY(state_buildings); fixed_point_map_t<Ideology const*> PROPERTY(party_loyalties); ProvinceHistoryEntry(Province const& new_province, Date new_date); |