aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/economy/GoodInstance.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-06-13 01:25:21 +0200
committer GitHub <noreply@github.com>2024-06-13 01:25:21 +0200
commit01a8f60aaca9784d814f4cb35a3fc4be86e1dd20 (patch)
treeebc9c03b5bd0a6b11068ac37aca302f6ceb24a18 /src/openvic-simulation/economy/GoodInstance.hpp
parenta49e4d0975e2b5dfd13ae50aa716f1a0307e618d (diff)
parentc0ba822ee46551a40ad6b43e8f56b80e27ae35b5 (diff)
Merge pull request #163 from OpenVicProject/good-instance
Add GoodInstance
Diffstat (limited to 'src/openvic-simulation/economy/GoodInstance.hpp')
-rw-r--r--src/openvic-simulation/economy/GoodInstance.hpp33
1 files changed, 33 insertions, 0 deletions
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<GoodInstance> IDENTIFIER_REGISTRY(good_instance);
+
+ public:
+ bool setup_good_instances(GoodDefinitionManager const& good_definition_manager);
+ };
+}