23#include <entt/entt.hpp>
52 using std::vector<Order>::vector;
70 std::map<entt::entity, DescendingSortedOrderList>
sell_orders;
71 std::map<entt::entity, AscendingSortedOrderList>
buy_orders;
80 for (
const Order& order : buy_list) {
81 demand += order.quantity;
89 for (
const Order& order : sell_list) {
90 supply += order.quantity;
void put(const Order &order)
Definition: auction.h:53
SortedOrderList< std::less< Order > > AscendingSortedOrderList
Smallest to greatest
Definition: auction.h:67
bool operator>(const Order &lhs, const Order &rhs)
Definition: auction.h:47
bool operator<(const Order &lhs, const Order &rhs)
Definition: auction.h:45
SortedOrderList< std::greater< Order > > DescendingSortedOrderList
Greatest to smallest
Definition: auction.h:62
When adding assets, it is extremely crucial that you read cqsp::asset::AssetLoader::LoadResources to ...
Definition: clientctx.h:21
double GetDemand(entt::entity good)
Definition: auction.h:77
double GetSupply(entt::entity good)
Definition: auction.h:86
std::map< entt::entity, DescendingSortedOrderList > sell_orders
Definition: auction.h:70
void AddBuyOrder(entt::entity good, Order &&order)
Definition: auction.h:75
std::map< entt::entity, AscendingSortedOrderList > buy_orders
Definition: auction.h:71
void AddSellOrder(entt::entity good, Order &&order)
Definition: auction.h:73
double quantity
Definition: auction.h:36
double price
Price per unit
Definition: auction.h:35
entt::entity agent
The agent that owns this order. Goods sold will go to the agent, money recieved will also go to the a...
Definition: auction.h:42
Order(double price, double quantity, entt::entity agent)
Definition: auction.h:30
Order()
Definition: auction.h:29