aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/history/ProvinceHistory.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-12 01:34:53 +0100
committer hop311 <hop3114@gmail.com>2023-12-13 20:54:36 +0100
commit89c93f98b865c20cd3c3486a9b91323565e759fc (patch)
tree54155b9cf2a4384585941495f7525b77fa60d4e7 /src/openvic-simulation/history/ProvinceHistory.hpp
parentf556519575bbbf24d247f341ca762fb1878ed64d (diff)
Province pop history + country government flag override refactors
Diffstat (limited to 'src/openvic-simulation/history/ProvinceHistory.hpp')
-rw-r--r--src/openvic-simulation/history/ProvinceHistory.hpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/openvic-simulation/history/ProvinceHistory.hpp b/src/openvic-simulation/history/ProvinceHistory.hpp
index b69408e..c3c8e67 100644
--- a/src/openvic-simulation/history/ProvinceHistory.hpp
+++ b/src/openvic-simulation/history/ProvinceHistory.hpp
@@ -17,7 +17,6 @@ namespace OpenVic {
struct ProvinceHistoryEntry : HistoryEntry {
friend struct ProvinceHistoryMap;
- friend struct ProvinceHistoryManager;
private:
Province const& PROPERTY(province);
@@ -37,7 +36,8 @@ namespace OpenVic {
std::vector<Pop> PROPERTY(pops);
ProvinceHistoryEntry(Province const& new_province, Date new_date);
- bool _load_province_pop_history(PopManager const& pop_manager, ast::NodeCPtr root);
+
+ bool _load_province_pop_history(GameManager const& game_manager, ast::NodeCPtr root, bool *non_integer_size);
};
struct ProvinceHistoryManager;
@@ -48,13 +48,16 @@ namespace OpenVic {
private:
Province const& PROPERTY(province);
- ProvinceHistoryEntry* _get_entry(Date date);
-
protected:
ProvinceHistoryMap(Province const& new_province);
std::unique_ptr<ProvinceHistoryEntry> _make_entry(Date date) const override;
bool _load_history_entry(GameManager const& game_manager, ProvinceHistoryEntry& entry, ast::NodeCPtr root) override;
+
+ private:
+ bool _load_province_pop_history(
+ GameManager const& game_manager, Date date, ast::NodeCPtr root, bool *non_integer_size
+ );
};
struct ProvinceHistoryManager {
@@ -62,6 +65,8 @@ namespace OpenVic {
std::map<Province const*, ProvinceHistoryMap> PROPERTY(province_histories);
bool locked = false;
+ ProvinceHistoryMap* _get_or_make_province_history(Province const& province);
+
public:
ProvinceHistoryManager() = default;
@@ -71,6 +76,6 @@ namespace OpenVic {
ProvinceHistoryMap const* get_province_history(Province const* province) const;
bool load_province_history_file(GameManager const& game_manager, Province const& province, ast::NodeCPtr root);
- bool load_pop_history_file(GameManager const& game_manager, Date date, ast::NodeCPtr root);
+ bool load_pop_history_file(GameManager const& game_manager, Date date, ast::NodeCPtr root, bool *non_integer_size);
};
} // namespace OpenVic