Skip to content

Commit fd1b24d

Browse files
authored
Merge pull request #60 from OpenVicProject/country-history-loading
2 parents 7bda541 + c9c198e commit fd1b24d

17 files changed

Lines changed: 883 additions & 147 deletions

src/openvic-simulation/country/Country.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ const std::vector<UnitNames>& Country::get_unit_names() const {
8181
return unit_names;
8282
}
8383

84-
bool Country::is_dynamic_tag() const {
84+
const std::map<const GovernmentType*, colour_t>& Country::get_alternative_colours() const {
85+
return alternative_colours;
86+
}
87+
88+
const bool Country::is_dynamic_tag() const {
8589
return dynamic_tag;
8690
}
8791

@@ -181,7 +185,7 @@ bool CountryManager::load_country_data_file(GameManager& game_manager, std::stri
181185

182186
country_parties.push_back({ party_name, start_date, end_date, *ideology, std::move(policies) });
183187

184-
return ret; //
188+
return ret;
185189
},
186190
"unit_names", ZERO_OR_ONE, expect_dictionary([&unit_names](std::string_view key, ast::NodeCPtr value) -> bool {
187191
std::vector<std::string> names;
@@ -201,4 +205,4 @@ bool CountryManager::load_country_data_file(GameManager& game_manager, std::stri
201205

202206
ret &= add_country(name, color, *graphical_culture, std::move(country_parties), std::move(unit_names), is_dynamic, std::move(alternative_colours));
203207
return ret;
204-
}
208+
}

src/openvic-simulation/country/Country.hpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010

1111
#include <openvic-dataloader/v2script/AbstractSyntaxTree.hpp>
1212

13+
#include "openvic-simulation/dataloader/Dataloader.hpp"
14+
#include "openvic-simulation/map/Province.hpp"
1315
#include "openvic-simulation/politics/Government.hpp"
1416
#include "openvic-simulation/politics/Ideology.hpp"
1517
#include "openvic-simulation/politics/Issue.hpp"
18+
#include "openvic-simulation/politics/NationalValue.hpp"
1619
#include "openvic-simulation/pop/Culture.hpp"
20+
#include "openvic-simulation/pop/Religion.hpp"
1721
#include "openvic-simulation/types/Colour.hpp"
1822
#include "openvic-simulation/types/Date.hpp"
1923
#include "openvic-simulation/types/IdentifierRegistry.hpp"
@@ -30,7 +34,7 @@ namespace OpenVic {
3034
const Date start_date;
3135
const Date end_date;
3236
const Ideology& ideology;
33-
const std::vector<const Issue*> policies;
37+
const std::vector<Issue const*> policies;
3438

3539
CountryParty(
3640
std::string_view new_name,
@@ -69,7 +73,7 @@ namespace OpenVic {
6973
const GraphicalCultureType& graphical_culture;
7074
const std::vector<CountryParty> parties;
7175
const std::vector<UnitNames> unit_names;
72-
bool dynamic_tag;
76+
const bool dynamic_tag;
7377
const std::map<const GovernmentType*, colour_t> alternative_colours;
7478

7579
Country(
@@ -78,15 +82,15 @@ namespace OpenVic {
7882
const GraphicalCultureType& new_graphical_culture,
7983
std::vector<CountryParty>&& new_parties,
8084
std::vector<UnitNames>&& new_unit_names,
81-
bool new_dynamic_tag,
85+
const bool new_dynamic_tag,
8286
std::map<const GovernmentType*, colour_t>&& new_alternative_colours
8387
);
8488

8589
public:
8690
const GraphicalCultureType& get_graphical_culture() const;
8791
const std::vector<CountryParty>& get_parties() const;
8892
const std::vector<UnitNames>& get_unit_names() const;
89-
bool is_dynamic_tag() const;
93+
const bool is_dynamic_tag() const;
9094
const std::map<const GovernmentType*, colour_t>& get_alternative_colours() const;
9195
};
9296

@@ -104,7 +108,7 @@ namespace OpenVic {
104108
std::vector<CountryParty>&& parties,
105109
std::vector<UnitNames>&& unit_names,
106110
bool dynamic_tag,
107-
std::map<const GovernmentType*, colour_t>&& new_alternative_colours
111+
std::map<const GovernmentType*, colour_t>&& alternative_colours
108112
);
109113
IDENTIFIER_REGISTRY_ACCESSORS_CUSTOM_PLURAL(country, countries);
110114

0 commit comments

Comments
 (0)