aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/politics/Government.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-12-02 20:42:06 +0100
committer GitHub <noreply@github.com>2023-12-02 20:42:06 +0100
commit444a27726695478e44e0166e75df1f354b6432d5 (patch)
treef1f6276c91beceecdfd9b09083d1c91ea8b41b60 /src/openvic-simulation/politics/Government.cpp
parentcd6875d5e0ca5e2545fd0e1647678cd18a6c81c2 (diff)
parent4a899c1a9e83ab9476b85522751081be434caa35 (diff)
Merge pull request #82 from OpenVicProject/backlog
Accumulated changes from Dev Diary GUI focus period
Diffstat (limited to 'src/openvic-simulation/politics/Government.cpp')
-rw-r--r--src/openvic-simulation/politics/Government.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/openvic-simulation/politics/Government.cpp b/src/openvic-simulation/politics/Government.cpp
index 0d1d063..609e75f 100644
--- a/src/openvic-simulation/politics/Government.cpp
+++ b/src/openvic-simulation/politics/Government.cpp
@@ -37,9 +37,16 @@ bool GovernmentTypeManager::add_government_type(
return false;
}
- return government_types.add_item({
+ const bool ret = government_types.add_item({
identifier, std::move(ideologies), elections, appoint_ruling_party, term_duration, flag_type
});
+
+ /* flag_type can be empty here for default/non-ideological flag */
+ if (ret && std::find(flag_types.begin(), flag_types.end(), flag_type) == flag_types.end()) {
+ flag_types.emplace_back(flag_type);
+ }
+
+ return ret;
}
/* REQUIREMENTS: FS-525, SIM-27 */
@@ -49,7 +56,7 @@ bool GovernmentTypeManager::load_government_types_file(IdeologyManager const& id
std::vector<Ideology const*> ideologies;
bool elections = false, appoint_ruling_party = false;
Timespan term_duration = 0;
- std::string_view flag_type_identifier = "republic";
+ std::string_view flag_type_identifier;
size_t total_expected_ideologies = 0;
bool ret = expect_dictionary_keys_and_default(