aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/politics/Rule.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-09-14 21:37:10 +0200
committer GitHub <noreply@github.com>2024-09-14 21:37:10 +0200
commitd8c04cbe53188d4717f8c49f918e01657dbf3440 (patch)
tree7754de92a23f21e0546dcd09439bf0d3962b096f /src/openvic-simulation/politics/Rule.cpp
parent7a9206e3869fbb659d296b854c90f5c81755a5ca (diff)
parenta424969548083a977480a6be0f078760a5789bbf (diff)
Merge pull request #197 from OpenVicProject/country-unlock
CountryInstance unlock tech, invention, crime, building, unit, gas etc.
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()) {