diff options
Diffstat (limited to 'src/openvic-simulation/economy/GoodInstance.hpp')
-rw-r--r-- | src/openvic-simulation/economy/GoodInstance.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
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 <vector> #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<fixed_point_t> PROPERTY(buy_up_to_order_max_quantities); + std::vector<fixed_point_t> PROPERTY(buy_up_to_order_money_to_spend); + std::vector<std::function<void(BuyResult)>> PROPERTY(buy_up_to_order_callbacks); std::vector<fixed_point_t> PROPERTY(market_sell_order_quantities); std::vector<std::function<void(SellResult)>> 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<void(const BuyResult)> callback + ); void add_market_sell_order(const fixed_point_t quantity, const std::function<void(SellResult)> callback); void clear_orders(); }; |