aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country
diff options
context:
space:
mode:
author BrickPi <49528459+BrickPi@users.noreply.github.com>2023-10-25 12:16:05 +0200
committer GitHub <noreply@github.com>2023-10-25 12:16:05 +0200
commitfd1b24dfc6988eaa301645f0f5f2fcd845eb0a29 (patch)
treebd5fba638a55c683e587eb5e2bbde43ab5fb1a00 /src/openvic-simulation/country
parent7bda541557722b2a244e80796c612b735d8b5cf7 (diff)
parentc9c198e3b47e84eaea998cd9d2f7a8aa2b50ce73 (diff)
Merge pull request #60 from OpenVicProject/country-history-loading
Diffstat (limited to 'src/openvic-simulation/country')
-rw-r--r--src/openvic-simulation/country/Country.cpp10
-rw-r--r--src/openvic-simulation/country/Country.hpp14
2 files changed, 16 insertions, 8 deletions
diff --git a/src/openvic-simulation/country/Country.cpp b/src/openvic-simulation/country/Country.cpp
index bcc0488..ed8c3cb 100644
--- a/src/openvic-simulation/country/Country.cpp
+++ b/src/openvic-simulation/country/Country.cpp
@@ -81,7 +81,11 @@ const std::vector<UnitNames>& Country::get_unit_names() const {
return unit_names;
}
-bool Country::is_dynamic_tag() const {
+const std::map<const GovernmentType*, colour_t>& Country::get_alternative_colours() const {
+ return alternative_colours;
+}
+
+const bool Country::is_dynamic_tag() const {
return dynamic_tag;
}
@@ -181,7 +185,7 @@ bool CountryManager::load_country_data_file(GameManager& game_manager, std::stri
country_parties.push_back({ party_name, start_date, end_date, *ideology, std::move(policies) });
- return ret; //
+ return ret;
},
"unit_names", ZERO_OR_ONE, expect_dictionary([&unit_names](std::string_view key, ast::NodeCPtr value) -> bool {
std::vector<std::string> names;
@@ -201,4 +205,4 @@ bool CountryManager::load_country_data_file(GameManager& game_manager, std::stri
ret &= add_country(name, color, *graphical_culture, std::move(country_parties), std::move(unit_names), is_dynamic, std::move(alternative_colours));
return ret;
-} \ No newline at end of file
+}
diff --git a/src/openvic-simulation/country/Country.hpp b/src/openvic-simulation/country/Country.hpp
index ce7638f..8077698 100644
--- a/src/openvic-simulation/country/Country.hpp
+++ b/src/openvic-simulation/country/Country.hpp
@@ -10,10 +10,14 @@
#include <openvic-dataloader/v2script/AbstractSyntaxTree.hpp>
+#include "openvic-simulation/dataloader/Dataloader.hpp"
+#include "openvic-simulation/map/Province.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/types/IdentifierRegistry.hpp"
@@ -30,7 +34,7 @@ namespace OpenVic {
const Date start_date;
const Date end_date;
const Ideology& ideology;
- const std::vector<const Issue*> policies;
+ const std::vector<Issue const*> policies;
CountryParty(
std::string_view new_name,
@@ -69,7 +73,7 @@ namespace OpenVic {
const GraphicalCultureType& graphical_culture;
const std::vector<CountryParty> parties;
const std::vector<UnitNames> unit_names;
- bool dynamic_tag;
+ const bool dynamic_tag;
const std::map<const GovernmentType*, colour_t> alternative_colours;
Country(
@@ -78,7 +82,7 @@ namespace OpenVic {
const GraphicalCultureType& new_graphical_culture,
std::vector<CountryParty>&& new_parties,
std::vector<UnitNames>&& new_unit_names,
- bool new_dynamic_tag,
+ const bool new_dynamic_tag,
std::map<const GovernmentType*, colour_t>&& new_alternative_colours
);
@@ -86,7 +90,7 @@ namespace OpenVic {
const GraphicalCultureType& get_graphical_culture() const;
const std::vector<CountryParty>& get_parties() const;
const std::vector<UnitNames>& get_unit_names() const;
- bool is_dynamic_tag() const;
+ const bool is_dynamic_tag() const;
const std::map<const GovernmentType*, colour_t>& get_alternative_colours() const;
};
@@ -104,7 +108,7 @@ namespace OpenVic {
std::vector<CountryParty>&& parties,
std::vector<UnitNames>&& unit_names,
bool dynamic_tag,
- std::map<const GovernmentType*, colour_t>&& new_alternative_colours
+ std::map<const GovernmentType*, colour_t>&& alternative_colours
);
IDENTIFIER_REGISTRY_ACCESSORS_CUSTOM_PLURAL(country, countries);