aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/history
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-11-14 22:47:35 +0100
committer hop311 <hop3114@gmail.com>2023-11-16 20:38:34 +0100
commit886b8b8f396438fc2b7da7d2508f2064d14150a8 (patch)
treeeeed419a7d97ecb58adf63a17eb9184db3e5ed7a /src/openvic-simulation/history
parent8271b1519e095ee3e7245cde2f0b54561c3ec619 (diff)
Misc changes
Diffstat (limited to 'src/openvic-simulation/history')
-rw-r--r--src/openvic-simulation/history/ProvinceHistory.cpp16
-rw-r--r--src/openvic-simulation/history/ProvinceHistory.hpp6
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);