aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/politics/Rule.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-09-11 23:07:12 +0200
committer hop311 <hop3114@gmail.com>2024-09-12 23:08:42 +0200
commita424969548083a977480a6be0f078760a5789bbf (patch)
tree7754de92a23f21e0546dcd09439bf0d3962b096f /src/openvic-simulation/politics/Rule.cpp
parent237e42fd1cdff02862c6a2279c7cad9786ab0e65 (diff)
Country reforms and rulescountry-unlock
Diffstat (limited to 'src/openvic-simulation/politics/Rule.cpp')
-rw-r--r--src/openvic-simulation/politics/Rule.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/openvic-simulation/politics/Rule.cpp b/src/openvic-simulation/politics/Rule.cpp
index 37aa22a..1d61652 100644
--- a/src/openvic-simulation/politics/Rule.cpp
+++ b/src/openvic-simulation/politics/Rule.cpp
@@ -62,6 +62,20 @@ size_t RuleSet::get_rule_count() const {
return ret;
}
+void RuleSet::clear() {
+ rule_groups.clear();
+}
+
+bool RuleSet::empty() const {
+ for (auto const& [group, rule_map] : rule_groups) {
+ if (!rule_map.empty()) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
RuleSet::rule_map_t const& RuleSet::get_rule_group(Rule::rule_group_t group, bool* successful) const {
const rule_group_map_t::const_iterator it = rule_groups.find(group);
if (it != rule_groups.end()) {