diff options
author | zaaarf <zaaarf@proton.me> | 2023-09-20 14:03:25 +0200 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-09-20 14:03:25 +0200 |
commit | ad17b83930d83c3bbe5d58cf30c54fe88ac5d927 (patch) | |
tree | 1f1f1d395f7d120ab7a23c42827f6c20253d48ba /src/openvic-simulation/politics/PoliticalReform.cpp | |
parent | 63e5866381234d6627174869b7a27770daef20fd (diff) |
feat: merged PartyIssue and PoliticalReform into single Issue structure
Diffstat (limited to 'src/openvic-simulation/politics/PoliticalReform.cpp')
-rw-r--r-- | src/openvic-simulation/politics/PoliticalReform.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/openvic-simulation/politics/PoliticalReform.cpp b/src/openvic-simulation/politics/PoliticalReform.cpp deleted file mode 100644 index 089e1b6..0000000 --- a/src/openvic-simulation/politics/PoliticalReform.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "PoliticalReform.hpp" - -using namespace OpenVic; - -PoliticalReformGroup::PoliticalReformGroup(const std::string_view new_identifier, bool ordered) - : HasIdentifier { new_identifier }, ordered { ordered } {} - -bool PoliticalReformGroup::is_ordered() const { - return ordered; -} - -PoliticalReform::PoliticalReform(const std::string_view new_identifier, PoliticalReformGroup const& new_group, size_t ordinal) - : HasIdentifier { new_identifier }, group { new_group }, ordinal { ordinal } {} - -size_t PoliticalReform::get_ordinal() const { - return ordinal; -} - -PoliticalReformManager::PoliticalReformManager() : political_reform_groups { "political reform groups" }, political_reforms { "political reforms" } {} - -bool PoliticalReformManager::add_political_reform_group(const std::string_view identifier, bool ordered) { - if (identifier.empty()) { - Logger::error("Invalid political reform group identifier - empty!"); - return false; - } - - return political_reform_groups.add_item({ identifier, ordered }); -} - -bool PoliticalReformManager::add_political_reform(const std::string_view identifier, PoliticalReformGroup const* group, size_t ordinal) { - if (identifier.empty()) { - Logger::error("Invalid political reform identifier - empty!"); - return false; - } - - if (group == nullptr) { - Logger::error("Null political reform group for ", identifier); - return false; - } - - return political_reforms.add_item({ identifier, *group, ordinal }); -}
\ No newline at end of file |