|
Symphony Of Empires
|
A product (based off a Commodity) which can be bought by POPs, converted by factories and transported. More...
#include <product.hpp>


Public Member Functions | |
| float | get_price_delta () const |
| float | sd_ratio () const |
| float | ds_ratio () const |
| void | close_market () |
| float | buy (float amount) |
| Buy a portion of the item. More... | |
| float | produce (float amount) |
| Produce the product. More... | |
Public Member Functions inherited from Entity< ProductId > | |
| constexpr | Entity () noexcept=default |
| constexpr | Entity (Entity &&) noexcept=default |
| constexpr | Entity (const Entity &) noexcept=default |
| constexpr Entity & | operator= (const Entity &) noexcept=default |
| constexpr | ~Entity () noexcept=default |
| constexpr bool | is_invalid () const |
| Checks if the current id is invalid. More... | |
| constexpr bool | is_valid () const |
| Checks if the current id is valid. More... | |
| constexpr | operator Id () const noexcept |
| constexpr | operator size_t () const noexcept |
| constexpr Id | get_id () const |
Public Attributes | |
| float | price = 1.f |
| float | price_delta = 0.f |
| float | bought = 0.f |
| float | produced = 0.f |
| float | supply = 1.f |
| float | demand = 1.f |
| float | global_demand = 1.f |
| float | speculative_demand = 0.f |
Public Attributes inherited from Entity< ProductId > | |
| Id | cached_id |
| Id used to speed up Id lookups on any context. More... | |
Additional Inherited Members | |
Public Types inherited from Entity< ProductId > | |
| using | Id = ProductId |
Static Public Member Functions inherited from Entity< ProductId > | |
| constexpr static Id | invalid () |
| Returns an invalid id. More... | |
| constexpr static bool | is_invalid (Id id) |
| Checks if the id is not valid. More... | |
| constexpr static bool | is_valid (Id id) |
| Checks if the id is valid. More... | |
A product (based off a Commodity) which can be bought by POPs, converted by factories and transported.
Definition at line 54 of file product.hpp.
|
inline |
Buy a portion of the item.
| amount | Amount to buy |
Definition at line 97 of file product.hpp.
|
inline |
|
inline |
Definition at line 74 of file product.hpp.
|
inline |
|
inline |
Produce the product.
| amount | Amount to produce |
Definition at line 108 of file product.hpp.
|
inline |
Definition at line 68 of file product.hpp.
| float Product::bought = 0.f |
Definition at line 116 of file product.hpp.
| float Product::demand = 1.f |
Definition at line 119 of file product.hpp.
| float Product::global_demand = 1.f |
Definition at line 120 of file product.hpp.
| float Product::price = 1.f |
Definition at line 114 of file product.hpp.
| float Product::price_delta = 0.f |
Definition at line 115 of file product.hpp.
| float Product::produced = 0.f |
Definition at line 117 of file product.hpp.
| float Product::speculative_demand = 0.f |
Definition at line 121 of file product.hpp.
| float Product::supply = 1.f |
Definition at line 118 of file product.hpp.