aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Crime.hpp
blob: 01044f904cd294bd5f4d079fb03b3c33a1d33ef0 (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
33
34
35
#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, ConditionScript&& new_trigger,
         bool new_default_active
      );

   public:
      Crime(Crime&&) = default;
   };

   struct CrimeManager {
   private:
      IdentifierRegistry<Crime> IDENTIFIER_REGISTRY(crime_modifier);

   public:
      bool add_crime_modifier(
         std::string_view identifier, ModifierValue&& values, Modifier::icon_t icon, ConditionScript&& trigger,
         bool default_active
      );

      bool load_crime_modifiers(ModifierManager const& modifier_manager, ast::NodeCPtr root);

      bool parse_scripts(GameManager const& game_manager);
   };
}