From 03647d2249f72b6545628bb844685f87c4581062 Mon Sep 17 00:00:00 2001 From: hop311 Date: Fri, 19 Jul 2024 19:02:25 +0100 Subject: Cleanup: inheritance, const movable variables, code formatting --- src/openvic-simulation/politics/Rule.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/openvic-simulation/politics/Rule.hpp') diff --git a/src/openvic-simulation/politics/Rule.hpp b/src/openvic-simulation/politics/Rule.hpp index 70a59e8..518c555 100644 --- a/src/openvic-simulation/politics/Rule.hpp +++ b/src/openvic-simulation/politics/Rule.hpp @@ -7,7 +7,8 @@ namespace OpenVic { struct RuleManager; struct BuildingTypeManager; - struct Rule : HasIdentifier { + /* The index of the Rule within its group, used to determine precedence in mutually exclusive rule groups. */ + struct Rule : HasIdentifier, HasIndex<> { friend struct RuleManager; enum class rule_group_t : uint8_t { @@ -27,10 +28,8 @@ namespace OpenVic { private: const rule_group_t PROPERTY(group); - /* The index of the Rule within its group, used to determine precedence in mutually exclusive rule groups. */ - const size_t PROPERTY(index); - Rule(std::string_view new_identifier, rule_group_t new_group, size_t new_index); + Rule(std::string_view new_identifier, rule_group_t new_group, index_t new_index); public: Rule(Rule&&) = default; -- cgit v1.2.3-56-ga3b1