From c12e742ca980d7213e2bc08b902b63117aea54f6 Mon Sep 17 00:00:00 2001 From: wvpm <24685035+wvpm@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:17:55 +0100 Subject: Implement artisanal production --- src/openvic-simulation/economy/GoodInstance.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/openvic-simulation/economy/GoodInstance.hpp') diff --git a/src/openvic-simulation/economy/GoodInstance.hpp b/src/openvic-simulation/economy/GoodInstance.hpp index e9f2298..a733557 100644 --- a/src/openvic-simulation/economy/GoodInstance.hpp +++ b/src/openvic-simulation/economy/GoodInstance.hpp @@ -3,6 +3,7 @@ #include #include "openvic-simulation/economy/GoodDefinition.hpp" +#include "openvic-simulation/economy/trading/BuyResult.hpp" #include "openvic-simulation/economy/trading/SellResult.hpp" #include "openvic-simulation/types/fixed_point/FixedPoint.hpp" #include "openvic-simulation/types/HasIdentifier.hpp" @@ -19,8 +20,13 @@ namespace OpenVic { GoodDefinition const& PROPERTY(good_definition); fixed_point_t PROPERTY(price); bool PROPERTY(is_available); + fixed_point_t demand_running_total; fixed_point_t supply_running_total; + fixed_point_t PROPERTY(total_demand_yesterday); fixed_point_t PROPERTY(total_supply_yesterday); + std::vector PROPERTY(buy_up_to_order_max_quantities); + std::vector PROPERTY(buy_up_to_order_money_to_spend); + std::vector> PROPERTY(buy_up_to_order_callbacks); std::vector PROPERTY(market_sell_order_quantities); std::vector> PROPERTY(market_sell_order_callbacks); @@ -29,6 +35,11 @@ namespace OpenVic { public: GoodInstance(GoodInstance&&) = default; + void add_buy_up_to_order( + const fixed_point_t max_quantity, + const fixed_point_t money_to_spend, + const std::function callback + ); void add_market_sell_order(const fixed_point_t quantity, const std::function callback); void clear_orders(); }; -- cgit v1.2.3-56-ga3b1