1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#pragma once
#include <map>
#include <unordered_map>
#include <vector>
#include "openvic-simulation/country/Country.hpp"
#include "openvic-simulation/history/Bookmark.hpp"
#include "openvic-simulation/history/HistoryMap.hpp"
#include "openvic-simulation/map/Province.hpp"
#include "openvic-simulation/military/Deployment.hpp"
#include "openvic-simulation/politics/Government.hpp"
#include "openvic-simulation/politics/Ideology.hpp"
#include "openvic-simulation/politics/Issue.hpp"
#include "openvic-simulation/politics/NationalValue.hpp"
#include "openvic-simulation/pop/Culture.hpp"
#include "openvic-simulation/pop/Religion.hpp"
#include "openvic-simulation/types/Colour.hpp"
#include "openvic-simulation/types/Date.hpp"
#include "openvic-simulation/research/Invention.hpp"
#include "openvic-simulation/research/Technology.hpp"
namespace OpenVic {
struct CountryHistoryMap;
struct CountryHistoryEntry : HistoryEntry {
friend struct CountryHistoryMap;
private:
Country const& PROPERTY(country);
std::optional<Culture const*> PROPERTY(primary_culture);
std::vector<Culture const*> PROPERTY(accepted_cultures);
std::optional<Religion const*> PROPERTY(religion);
std::optional<CountryParty const*> PROPERTY(ruling_party);
std::optional<Date> PROPERTY(last_election);
fixed_point_map_t<Ideology const*> PROPERTY(upper_house);
std::optional<Province const*> PROPERTY(capital);
std::optional<GovernmentType const*> PROPERTY(government_type);
std::optional<fixed_point_t> PROPERTY(plurality);
std::optional<NationalValue const*> PROPERTY(national_value);
std::optional<bool> PROPERTY(civilised);
std::optional<fixed_point_t> PROPERTY(prestige);
std::vector<Reform const*> PROPERTY(reforms);
std::optional<Deployment const*> PROPERTY(inital_oob);
std::optional<TechnologySchool const*> PROPERTY(tech_school);
std::map<Technology const*, bool> PROPERTY(technologies);
std::map<Invention const*, bool> PROPERTY(inventions);
fixed_point_map_t<Country const*> PROPERTY(foreign_investment);
CountryHistoryEntry(Country const& new_country, Date new_date);
};
struct CountryHistoryManager;
struct CountryHistoryMap : HistoryMap<CountryHistoryEntry, Dataloader const&, DeploymentManager&> {
friend struct CountryHistoryManager;
private:
Country const& PROPERTY(country);
protected:
CountryHistoryMap(Country const& new_country);
std::unique_ptr<CountryHistoryEntry> _make_entry(Date date) const override;
bool _load_history_entry(
GameManager const& game_manager, Dataloader const& dataloader, DeploymentManager& deployment_manager,
CountryHistoryEntry& entry, ast::NodeCPtr root
) override;
};
struct CountryHistoryManager {
private:
std::map<Country const*, CountryHistoryMap> country_histories;
bool locked = false;
public:
CountryHistoryManager() = default;
void lock_country_histories();
bool is_locked() const;
CountryHistoryMap const* get_country_history(Country const* country) const;
bool load_country_history_file(
GameManager& game_manager, Dataloader const& dataloader, Country const& country, ast::NodeCPtr root
);
};
} // namespace OpenVic
|