aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/pop/Religion.hpp
blob: 14c2f57bea0ea7f3b5905759a65cbb8c998dd8b6 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once

#include "openvic-simulation/dataloader/NodeTools.hpp"
#include "openvic-simulation/types/IdentifierRegistry.hpp"

namespace OpenVic {

   struct ReligionManager;

   struct ReligionGroup : HasIdentifier {
      friend struct ReligionManager;

   private:
      ReligionGroup(std::string_view new_identifier);

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

   struct Religion : HasIdentifierAndColour {
      friend struct ReligionManager;

      using icon_t = uint8_t;

   private:
      ReligionGroup const& PROPERTY(group);
      const icon_t PROPERTY(icon);
      const bool PROPERTY(pagan);

      Religion(
         std::string_view new_identifier, colour_t new_colour, ReligionGroup const& new_group, icon_t new_icon,
         bool new_pagan
      );

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

   struct ReligionManager {
   private:
      IdentifierRegistry<ReligionGroup> IDENTIFIER_REGISTRY(religion_group);
      IdentifierRegistry<Religion> IDENTIFIER_REGISTRY(religion);

   public:
      bool add_religion_group(std::string_view identifier);

      bool add_religion(
         std::string_view identifier, colour_t colour, ReligionGroup const& group, Religion::icon_t icon, bool pagan
      );

      bool load_religion_file(ast::NodeCPtr root);
   };
}