diff options
Diffstat (limited to 'src/openvic-simulation/politics')
-rw-r--r-- | src/openvic-simulation/politics/Government.cpp | 11 | ||||
-rw-r--r-- | src/openvic-simulation/politics/Government.hpp | 6 | ||||
-rw-r--r-- | src/openvic-simulation/politics/Ideology.cpp | 11 | ||||
-rw-r--r-- | src/openvic-simulation/politics/Ideology.hpp | 6 | ||||
-rw-r--r-- | src/openvic-simulation/politics/Issue.cpp | 5 |
5 files changed, 26 insertions, 13 deletions
diff --git a/src/openvic-simulation/politics/Government.cpp b/src/openvic-simulation/politics/Government.cpp index 927c773..97b1d68 100644 --- a/src/openvic-simulation/politics/Government.cpp +++ b/src/openvic-simulation/politics/Government.cpp @@ -5,8 +5,12 @@ using namespace OpenVic; using namespace OpenVic::NodeTools; -GovernmentType::GovernmentType(std::string_view new_identifier, std::vector<Ideology const*>&& new_ideologies, bool new_elections, bool new_appoint_ruling_party, Timespan new_term_duration, std::string_view new_flag_type_identifier) - : HasIdentifier { new_identifier }, ideologies { std::move(new_ideologies) }, elections { new_elections }, appoint_ruling_party { new_appoint_ruling_party }, term_duration { new_term_duration }, flag_type_identifier { new_flag_type_identifier } {} +GovernmentType::GovernmentType( + std::string_view new_identifier, std::vector<Ideology const*>&& new_ideologies, bool new_elections, + bool new_appoint_ruling_party, Timespan new_term_duration, std::string_view new_flag_type_identifier +) : HasIdentifier { new_identifier }, ideologies { std::move(new_ideologies) }, elections { new_elections }, + appoint_ruling_party { new_appoint_ruling_party }, term_duration { new_term_duration }, + flag_type_identifier { new_flag_type_identifier } {} bool GovernmentType::is_ideology_compatible(Ideology const* ideology) const { return std::find(ideologies.begin(), ideologies.end(), ideology) != ideologies.end(); @@ -34,7 +38,8 @@ std::string_view GovernmentType::get_flag_type() const { GovernmentTypeManager::GovernmentTypeManager() : government_types { "government types" } {} -bool GovernmentTypeManager::add_government_type(std::string_view identifier, std::vector<Ideology const*>&& ideologies, bool elections, bool appoint_ruling_party, Timespan term_duration, std::string_view flag_type) { +bool GovernmentTypeManager::add_government_type(std::string_view identifier, std::vector<Ideology const*>&& ideologies, + bool elections, bool appoint_ruling_party, Timespan term_duration, std::string_view flag_type) { if (identifier.empty()) { Logger::error("Invalid government type identifier - empty!"); return false; diff --git a/src/openvic-simulation/politics/Government.hpp b/src/openvic-simulation/politics/Government.hpp index 8cdee48..455b822 100644 --- a/src/openvic-simulation/politics/Government.hpp +++ b/src/openvic-simulation/politics/Government.hpp @@ -14,7 +14,8 @@ namespace OpenVic { const Timespan term_duration; const std::string flag_type_identifier; - GovernmentType(std::string_view new_identifier, std::vector<Ideology const*>&& new_ideologies, bool new_elections, bool new_appoint_ruling_party, Timespan new_term_duration, std::string_view new_flag_type_identifier); + GovernmentType(std::string_view new_identifier, std::vector<Ideology const*>&& new_ideologies, bool new_elections, + bool new_appoint_ruling_party, Timespan new_term_duration, std::string_view new_flag_type_identifier); public: GovernmentType(GovernmentType&&) = default; @@ -34,7 +35,8 @@ namespace OpenVic { public: GovernmentTypeManager(); - bool add_government_type(std::string_view identifier, std::vector<Ideology const*>&& ideologies, bool elections, bool appoint_ruling_party, Timespan term_duration, std::string_view flag_type); + bool add_government_type(std::string_view identifier, std::vector<Ideology const*>&& ideologies, bool elections, + bool appoint_ruling_party, Timespan term_duration, std::string_view flag_type); IDENTIFIER_REGISTRY_ACCESSORS(government_type) bool load_government_types_file(IdeologyManager const& ideology_manager, ast::NodeCPtr root); diff --git a/src/openvic-simulation/politics/Ideology.cpp b/src/openvic-simulation/politics/Ideology.cpp index 5b2c0ef..c52d8b1 100644 --- a/src/openvic-simulation/politics/Ideology.cpp +++ b/src/openvic-simulation/politics/Ideology.cpp @@ -5,9 +5,11 @@ using namespace OpenVic::NodeTools; IdeologyGroup::IdeologyGroup(std::string_view new_identifier) : HasIdentifier { new_identifier } {} -Ideology::Ideology(std::string_view new_identifier, colour_t new_colour, IdeologyGroup const& new_group, bool new_uncivilised, bool new_can_reduce_militancy, Date new_spawn_date) - : HasIdentifierAndColour { new_identifier, new_colour, true, false }, group { new_group }, uncivilised { new_uncivilised }, - can_reduce_militancy { new_can_reduce_militancy }, spawn_date { new_spawn_date } {} +Ideology::Ideology( + std::string_view new_identifier, colour_t new_colour, IdeologyGroup const& new_group, + bool new_uncivilised, bool new_can_reduce_militancy, Date new_spawn_date +) : HasIdentifierAndColour { new_identifier, new_colour, true, false }, group { new_group }, + uncivilised { new_uncivilised }, can_reduce_militancy { new_can_reduce_militancy }, spawn_date { new_spawn_date } {} IdeologyGroup const& Ideology::get_group() const { return group; @@ -36,7 +38,8 @@ bool IdeologyManager::add_ideology_group(std::string_view identifier) { return ideology_groups.add_item({ identifier }); } -bool IdeologyManager::add_ideology(std::string_view identifier, colour_t colour, IdeologyGroup const* group, bool uncivilised, bool can_reduce_militancy, Date spawn_date) { +bool IdeologyManager::add_ideology(std::string_view identifier, colour_t colour, IdeologyGroup const* group, + bool uncivilised, bool can_reduce_militancy, Date spawn_date) { if (identifier.empty()) { Logger::error("Invalid ideology identifier - empty!"); return false; diff --git a/src/openvic-simulation/politics/Ideology.hpp b/src/openvic-simulation/politics/Ideology.hpp index 557333e..3cd72f4 100644 --- a/src/openvic-simulation/politics/Ideology.hpp +++ b/src/openvic-simulation/politics/Ideology.hpp @@ -25,7 +25,8 @@ namespace OpenVic { //TODO - willingness to repeal/pass reforms (and its modifiers) - Ideology(std::string_view new_identifier, colour_t new_colour, IdeologyGroup const& new_group, bool new_uncivilised, bool new_can_reduce_militancy, Date new_spawn_date); + Ideology(std::string_view new_identifier, colour_t new_colour, IdeologyGroup const& new_group, + bool new_uncivilised, bool new_can_reduce_militancy, Date new_spawn_date); public: Ideology(Ideology&&) = default; @@ -47,7 +48,8 @@ namespace OpenVic { bool add_ideology_group(std::string_view identifier); IDENTIFIER_REGISTRY_ACCESSORS(ideology_group) - bool add_ideology(std::string_view identifier, colour_t colour, IdeologyGroup const* group, bool uncivilised, bool can_reduce_militancy, Date spawn_date); + bool add_ideology(std::string_view identifier, colour_t colour, IdeologyGroup const* group, + bool uncivilised, bool can_reduce_militancy, Date spawn_date); IDENTIFIER_REGISTRY_ACCESSORS_CUSTOM_PLURAL(ideology, ideologies) bool load_ideology_file(ast::NodeCPtr root); diff --git a/src/openvic-simulation/politics/Issue.cpp b/src/openvic-simulation/politics/Issue.cpp index 3f2fd10..4f05a99 100644 --- a/src/openvic-simulation/politics/Issue.cpp +++ b/src/openvic-simulation/politics/Issue.cpp @@ -46,7 +46,7 @@ size_t Reform::get_ordinal() const { } IssueManager::IssueManager() : issue_groups { "issue groups" }, issues { "issues" }, - reform_types { "reform types" }, reform_groups { "reform groups" }, reforms { "reforms" } {} + reform_types { "reform types" }, reform_groups { "reform groups" }, reforms { "reforms" } {} bool IssueManager::add_issue_group(std::string_view identifier) { if (identifier.empty()) { @@ -120,7 +120,8 @@ bool IssueManager::_load_issue(std::string_view identifier, IssueGroup const* gr return add_issue(identifier, group); } -bool IssueManager::_load_reform_group(size_t& expected_reforms, std::string_view identifier, ReformType const* type, ast::NodeCPtr node) { +bool IssueManager::_load_reform_group(size_t& expected_reforms, std::string_view identifier, + ReformType const* type, ast::NodeCPtr node) { bool ordered = false, administrative = false; bool ret = expect_dictionary_keys_and_default( increment_callback(expected_reforms), |