aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/politics
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-12 01:34:53 +0100
committer hop311 <hop3114@gmail.com>2023-12-13 20:54:36 +0100
commit89c93f98b865c20cd3c3486a9b91323565e759fc (patch)
tree54155b9cf2a4384585941495f7525b77fa60d4e7 /src/openvic-simulation/politics
parentf556519575bbbf24d247f341ca762fb1878ed64d (diff)
Province pop history + country government flag override refactors
Diffstat (limited to 'src/openvic-simulation/politics')
-rw-r--r--src/openvic-simulation/politics/Government.cpp6
-rw-r--r--src/openvic-simulation/politics/Government.hpp2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/openvic-simulation/politics/Government.cpp b/src/openvic-simulation/politics/Government.cpp
index a226518..fc93cc3 100644
--- a/src/openvic-simulation/politics/Government.cpp
+++ b/src/openvic-simulation/politics/Government.cpp
@@ -111,3 +111,9 @@ bool GovernmentTypeManager::load_government_types_file(IdeologyManager const& id
return ret;
}
+
+bool GovernmentTypeManager::is_valid_flag_type(std::string_view type) const {
+ return std::any_of(flag_types.begin(), flag_types.end(), [type](std::string const& flag_type) -> bool {
+ return flag_type == type;
+ });
+}
diff --git a/src/openvic-simulation/politics/Government.hpp b/src/openvic-simulation/politics/Government.hpp
index 4682bbf..34a9194 100644
--- a/src/openvic-simulation/politics/Government.hpp
+++ b/src/openvic-simulation/politics/Government.hpp
@@ -38,5 +38,7 @@ namespace OpenVic {
);
bool load_government_types_file(IdeologyManager const& ideology_manager, ast::NodeCPtr root);
+
+ bool is_valid_flag_type(std::string_view type) const;
};
} // namespace OpenVic