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-04 14:09:10 +0100
commit89e9c05f4d6276efa82fe486156357f841f864c3 (patch)
tree559be137cbbc7339c9d62658bf8a33366852bae5 /src/openvic-simulation/economy/GoodInstance.hpp
parent4eba08af501560e9139a562c53fbbc8b694fb4cf (diff)
Add market placeholder
Diffstat (limited to 'src/openvic-simulation/economy/GoodInstance.hpp')
-rw-r--r--src/openvic-simulation/economy/GoodInstance.hpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/openvic-simulation/economy/GoodInstance.hpp b/src/openvic-simulation/economy/GoodInstance.hpp
index 74ec939..e9f2298 100644
--- a/src/openvic-simulation/economy/GoodInstance.hpp
+++ b/src/openvic-simulation/economy/GoodInstance.hpp
@@ -1,6 +1,10 @@
#pragma once
+#include <vector>
+
#include "openvic-simulation/economy/GoodDefinition.hpp"
+#include "openvic-simulation/economy/trading/SellResult.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,18 @@ namespace OpenVic {
GoodDefinition const& PROPERTY(good_definition);
fixed_point_t PROPERTY(price);
bool PROPERTY(is_available);
- // TODO - supply, demand, actual bought
-
+ fixed_point_t supply_running_total;
+ fixed_point_t PROPERTY(total_supply_yesterday);
+ std::vector<fixed_point_t> PROPERTY(market_sell_order_quantities);
+ std::vector<std::function<void(SellResult)>> PROPERTY(market_sell_order_callbacks);
+
GoodInstance(GoodDefinition const& new_good_definition);
public:
GoodInstance(GoodInstance&&) = default;
+
+ void add_market_sell_order(const fixed_point_t quantity, const std::function<void(SellResult)> callback);
+ void clear_orders();
};
struct GoodInstanceManager {
@@ -28,6 +38,7 @@ namespace OpenVic {
IdentifierRegistry<GoodInstance> IDENTIFIER_REGISTRY(good_instance);
public:
+ IDENTIFIER_REGISTRY_NON_CONST_ACCESSORS(good_instance);
bool setup(GoodDefinitionManager const& good_definition_manager);
};
}