aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Crime.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-12-07 22:04:05 +0100
committer GitHub <noreply@github.com>2023-12-07 22:04:05 +0100
commit085fe94212c6f0ddbdfca1b2ba58223e7f6dcc8a (patch)
tree2a73255f595eabb1441419a08bd0d5e5407213e7 /src/openvic-simulation/map/Crime.hpp
parent48a3f1729d709847d7cad33f594c77cac414e802 (diff)
parent398377011cb3d3c970451dcd215f3610159f1ae2 (diff)
Merge pull request #85 from OpenVicProject/container-callbacks
Container (pointer) callbacks + format cleanup
Diffstat (limited to 'src/openvic-simulation/map/Crime.hpp')
-rw-r--r--src/openvic-simulation/map/Crime.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/openvic-simulation/map/Crime.hpp b/src/openvic-simulation/map/Crime.hpp
new file mode 100644
index 0000000..d0dd844
--- /dev/null
+++ b/src/openvic-simulation/map/Crime.hpp
@@ -0,0 +1,32 @@
+#pragma once
+
+#include "openvic-simulation/misc/Modifier.hpp"
+
+namespace OpenVic {
+ struct Crime final : TriggeredModifier {
+ friend struct CrimeManager;
+
+ private:
+ const bool PROPERTY(default_active);
+
+ Crime(std::string_view new_identifier, ModifierValue&& new_values, icon_t new_icon, bool new_default_active);
+
+ public:
+ Crime(Crime&&) = default;
+ };
+
+ struct CrimeManager {
+ private:
+ IdentifierRegistry<Crime> crime_modifiers;
+
+ public:
+ CrimeManager();
+
+ bool add_crime_modifier(
+ std::string_view identifier, ModifierValue&& values, Modifier::icon_t icon, bool default_active
+ );
+ IDENTIFIER_REGISTRY_ACCESSORS(crime_modifier)
+
+ bool load_crime_modifiers(ModifierManager const& modifier_manager, ast::NodeCPtr root);
+ };
+}