From a424969548083a977480a6be0f078760a5789bbf Mon Sep 17 00:00:00 2001 From: hop311 Date: Wed, 11 Sep 2024 22:07:12 +0100 Subject: Country reforms and rules --- src/openvic-simulation/politics/Rule.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/openvic-simulation/politics/Rule.cpp') 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()) { -- cgit v1.2.3-56-ga3b1