24#include <entt/entt.hpp>
124 std::map<entt::entity, std::vector<MarketOrder>>
demands;
125 std::map<entt::entity, std::vector<MarketOrder>>
requests;
154 double GetPrice(
const entt::entity& good);
156 double GetSupply(
const entt::entity& good);
157 double GetDemand(
const entt::entity& good);
217 double newbalance = this->
balance * coefficent;
231 if ((_balance -
balance) < 0) {
Definition: resource.h:74
Represents commercial areas and other amenities that generate economic activity. They don't export go...
Definition: market.h:278
entt::entity city
The city that it's based in.
Definition: market.h:280
int size
Definition: market.h:281
Records the prices of goods and other things
Definition: market.h:194
Will be handled in the future, but for now is just a market
Definition: market.h:189
int population_needed
Definition: market.h:286
entt::entity segment
Definition: market.h:288
int population_fufilled
Definition: market.h:287
An actor in a market that trades goods.
Definition: market.h:259
entt::entity market
Definition: market.h:260
An entity where the market is based, and the resources are traded.
Definition: market.h:266
entt::entity market
Definition: market.h:267
double GDP
Definition: market.h:145
entt::entity parent_market
Definition: market.h:143
auto begin()
Definition: market.h:163
std::vector< MarketInformation > history
Definition: market.h:132
std::map< entt::entity, MarketElementInformation > market_information
Definition: market.h:134
double GetPrice(const ResourceLedger &stockpile)
Definition: market.cpp:45
ResourceLedger market_access
Definition: market.h:141
void AddSupply(const ResourceLedger &stockpile)
Definition: market.cpp:21
void AddDemand(const ResourceLedger &stockpile)
Definition: market.cpp:33
std::map< entt::entity, MarketElementInformation > last_market_information
Definition: market.h:135
entt::basic_sparse_set< entt::entity > connected_markets
Definition: market.h:139
MarketElementInformation & operator[](entt::entity ent)
Definition: market.h:161
double GetSDRatio(const entt::entity &good)
Definition: market.cpp:53
std::set< entt::entity > participants
Definition: market.h:137
void AddParticipant(entt::entity participant)
Definition: market.h:159
double GetSupply(const entt::entity &good)
Definition: market.cpp:55
auto end()
Definition: market.h:165
double GetDemand(const entt::entity &good)
Definition: market.cpp:57
double price
Definition: market.h:117
entt::entity target
Definition: market.h:115
double amount
Definition: market.h:116
MarketOrder(entt::entity target, double amount, double price)
Definition: market.h:119
entt::entity owner
Definition: market.h:310
std::map< entt::entity, std::vector< MarketOrder > > requests
Definition: market.h:125
ResourceLedger supply_difference
Definition: market.h:128
ResourceLedger supplied_resources
Definition: market.h:127
std::map< entt::entity, std::vector< MarketOrder > > demands
Definition: market.h:124
Price of a good. This is temporary, because this is to determine initial prices for goods....
Definition: market.h:173
double price
Definition: market.h:174
double GDP_change
Definition: market.h:252
Wallet & operator=(double _balance)
Definition: market.h:229
double GetChange() const
Definition: market.h:240
double balance
Definition: market.h:249
Wallet & operator-=(const double amount)
Definition: market.h:206
void Reset()
Definition: market.h:242
double change
Definition: market.h:250
entt::entity currency
Definition: market.h:253
double GetBalance() const
Definition: market.h:238
Wallet & operator*=(const double coefficent)
Definition: market.h:216
Wallet & operator+=(const double amount)
Definition: market.h:201
double GetGDPChange()
Definition: market.h:246
Wallet(entt::entity _currency, double _balance)
Definition: market.h:199