aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Crime.hpp
blob: d0dd8440a435447eb2f2dbdebc75bff08564bf1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);
   };
}