aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/economy/GoodInstance.hpp
blob: 20370ef7c81583a483acc2996d0870d14a9d80b9 (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
#pragma once

#include "openvic-simulation/economy/GoodDefinition.hpp"
#include "openvic-simulation/types/HasIdentifier.hpp"
#include "openvic-simulation/types/IdentifierRegistry.hpp"
#include "openvic-simulation/utility/Getters.hpp"

namespace OpenVic {
   struct GoodInstanceManager;

   struct GoodInstance : HasIdentifierAndColour {
      friend struct GoodInstanceManager;

   private:
      GoodDefinition const& PROPERTY(good_definition);
      fixed_point_t PROPERTY(price);
      bool PROPERTY(available);
      // TODO - supply, demand, actual bought

      GoodInstance(GoodDefinition const& new_good_definition);

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

   struct GoodInstanceManager {
   private:
      IdentifierRegistry<GoodInstance> IDENTIFIER_REGISTRY(good_instance);

   public:
      bool setup(GoodDefinitionManager const& good_definition_manager);
   };
}