aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/economy/GoodInstance.hpp
diff options
context:
space:
mode:
author wvpm <24685035+wvpm@users.noreply.github.com>2024-10-28 11:07:15 +0100
committer wvpm <24685035+wvpm@users.noreply.github.com>2024-11-15 09:13:31 +0100
commita8ef75c96c579f74ee68789c5879df5262e36220 (patch)
treea10aeb9d4673f8eadf8bb397cf5f7cad3927e288 /src/openvic-simulation/economy/GoodInstance.hpp
parente91bd6c3322a73c3ac6707329e81b6f2edc0b8be (diff)
Add market placeholder
Diffstat (limited to 'src/openvic-simulation/economy/GoodInstance.hpp')
-rw-r--r--src/openvic-simulation/economy/GoodInstance.hpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/openvic-simulation/economy/GoodInstance.hpp b/src/openvic-simulation/economy/GoodInstance.hpp
index 74ec939..dbb533d 100644
--- a/src/openvic-simulation/economy/GoodInstance.hpp
+++ b/src/openvic-simulation/economy/GoodInstance.hpp
@@ -1,6 +1,10 @@
#pragma once
+#include <deque>
+
#include "openvic-simulation/economy/GoodDefinition.hpp"
+#include "openvic-simulation/economy/trading/MarketSellOrder.hpp"
+#include "openvic-simulation/types/fixed_point/FixedPoint.hpp"
#include "openvic-simulation/types/HasIdentifier.hpp"
#include "openvic-simulation/types/IdentifierRegistry.hpp"
#include "openvic-simulation/utility/Getters.hpp"
@@ -15,12 +19,19 @@ namespace OpenVic {
GoodDefinition const& PROPERTY(good_definition);
fixed_point_t PROPERTY(price);
bool PROPERTY(is_available);
- // TODO - supply, demand, actual bought
-
+ fixed_point_t PROPERTY(total_supply_yesterday);
+ std::deque<GoodMarketSellOrder> market_sell_orders;
+
GoodInstance(GoodDefinition const& new_good_definition);
public:
GoodInstance(GoodInstance&&) = default;
+
+ //thread safe
+ void add_market_sell_order(const GoodMarketSellOrder market_sell_order);
+
+ //not thread safe
+ void execute_orders();
};
struct GoodInstanceManager {
@@ -28,6 +39,7 @@ namespace OpenVic {
IdentifierRegistry<GoodInstance> IDENTIFIER_REGISTRY(good_instance);
public:
+ IDENTIFIER_REGISTRY_NON_CONST_ACCESSORS(good_instance);
bool setup(GoodDefinitionManager const& good_definition_manager);
};
}