From c0ba822ee46551a40ad6b43e8f56b80e27ae35b5 Mon Sep 17 00:00:00 2001 From: hop311 Date: Sat, 8 Jun 2024 00:17:25 +0100 Subject: Add GoodInstance --- src/openvic-simulation/economy/GoodInstance.hpp | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/openvic-simulation/economy/GoodInstance.hpp (limited to 'src/openvic-simulation/economy/GoodInstance.hpp') diff --git a/src/openvic-simulation/economy/GoodInstance.hpp b/src/openvic-simulation/economy/GoodInstance.hpp new file mode 100644 index 0000000..3c27209 --- /dev/null +++ b/src/openvic-simulation/economy/GoodInstance.hpp @@ -0,0 +1,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); + GoodDefinition::price_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 IDENTIFIER_REGISTRY(good_instance); + + public: + bool setup_good_instances(GoodDefinitionManager const& good_definition_manager); + }; +} -- cgit v1.2.3-56-ga3b1