Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
|
#include <resource.h>
Public Member Functions | |
ResourceLedger ()=default | |
~ResourceLedger ()=default | |
double | operator[] (const entt::entity) const |
bool | EnoughToTransfer (const ResourceLedger &amount) |
This resource ledger has enough resources inside to transfer "amount" amount of resources away More... | |
void | operator-= (const ResourceLedger &) |
void | operator+= (const ResourceLedger &) |
void | operator*= (const ResourceLedger &) |
void | operator/= (const ResourceLedger &) |
void | operator-= (const double value) |
void | operator+= (const double value) |
void | operator*= (const double value) |
void | operator/= (const double value) |
ResourceLedger | operator- (const ResourceLedger &) const |
ResourceLedger | operator+ (const ResourceLedger &) const |
ResourceLedger | operator* (const ResourceLedger &) const |
ResourceLedger | operator/ (const ResourceLedger &) const |
ResourceLedger | operator- (const double value) const |
ResourceLedger | operator+ (const double value) const |
ResourceLedger | operator* (const double value) const |
ResourceLedger | operator/ (const double value) const |
bool | operator< (const ResourceLedger &) |
All resources in this ledger are smaller than than the other ledger More... | |
bool | operator> (const ResourceLedger &) |
All resources in this ledger are greater than the other ledger More... | |
bool | operator<= (const ResourceLedger &) |
All resources in this ledger are smaller than or equal to than the other ledger More... | |
bool | operator>= (const ResourceLedger &) |
All resources in this ledger are greater than or equal to the other ledger More... | |
bool | LedgerEquals (const ResourceLedger &) |
bool | operator> (const double &) |
All resources in this ledger are greater than the number More... | |
bool | operator< (const double &) |
All resources in this ledger are less than than the number More... | |
bool | operator== (const double &) |
bool | operator<= (const double &) |
bool | operator>= (const double &) |
void | AssignFrom (const ResourceLedger &) |
void | TransferTo (ResourceLedger &, const ResourceLedger &) |
void | MultiplyAdd (const ResourceLedger &, double) |
void | RemoveResourcesLimited (const ResourceLedger &) |
Removes the resources, and if the amount of resources removed are more than the resources inside the stockpile, it will set that resource to zero. More... | |
ResourceLedger | LimitedRemoveResources (const ResourceLedger &) |
Same as RemoveResourcesLimited, except that it returns how much resources it took out. More... | |
ResourceLedger | UnitLeger (const double) |
Returns a copy of the vector with the values set to indicated value More... | |
ResourceLedger | Clamp (const double, const double) |
Returns a copy of the vector with the values clamped between the min and max indicated More... | |
ResourceLedger | SafeDivision (const ResourceLedger &) |
Returns a copy of the vector divided by the indicated vector, with division by zero resulting in infiniy More... | |
double | Average () |
Returns a copy of the vector divided by the indicated vector, with division by zero resulting in infiniy More... | |
double | Min () |
Finds the smallest value in the Ledger. More... | |
double | Max () |
Finds the largest value in the Ledger. More... | |
bool | HasAllResources (const ResourceLedger &) |
Checks if this current resource ledger has any resources in this list More... | |
bool | HasGood (entt::entity good) |
double | GetSum () |
double | MultiplyAndGetSum (ResourceLedger &other) |
Multiplies the numbers stated in the resource ledger. Used for calculating the price, becuase usually the resource ledger will be the price. More... | |
std::string | to_string () |
|
default |
|
default |
void cqsp::common::components::ResourceLedger::AssignFrom | ( | const ResourceLedger & | ledger | ) |
double cqsp::common::components::ResourceLedger::Average | ( | ) |
Returns a copy of the vector divided by the indicated vector, with division by zero resulting in infiniy
ResourceLedger cqsp::common::components::ResourceLedger::Clamp | ( | const double | minclamp, |
const double | maxclamp | ||
) |
Returns a copy of the vector with the values clamped between the min and max indicated
bool cqsp::common::components::ResourceLedger::EnoughToTransfer | ( | const ResourceLedger & | amount | ) |
This resource ledger has enough resources inside to transfer "amount" amount of resources away
amount | Other resource ledger |
double cqsp::common::components::ResourceLedger::GetSum | ( | ) |
bool cqsp::common::components::ResourceLedger::HasAllResources | ( | const ResourceLedger & | ledger | ) |
Checks if this current resource ledger has any resources in this list
|
inline |
bool cqsp::common::components::ResourceLedger::LedgerEquals | ( | const ResourceLedger & | ledger | ) |
ResourceLedger cqsp::common::components::ResourceLedger::LimitedRemoveResources | ( | const ResourceLedger & | other | ) |
Same as RemoveResourcesLimited, except that it returns how much resources it took out.
double cqsp::common::components::ResourceLedger::Max | ( | ) |
Finds the largest value in the Ledger.
double cqsp::common::components::ResourceLedger::Min | ( | ) |
Finds the smallest value in the Ledger.
void cqsp::common::components::ResourceLedger::MultiplyAdd | ( | const ResourceLedger & | other, |
double | value | ||
) |
double cqsp::common::components::ResourceLedger::MultiplyAndGetSum | ( | ResourceLedger & | other | ) |
Multiplies the numbers stated in the resource ledger. Used for calculating the price, becuase usually the resource ledger will be the price.
ResourceLedger cqsp::common::components::ResourceLedger::operator* | ( | const double | value | ) | const |
ResourceLedger cqsp::common::components::ResourceLedger::operator* | ( | const ResourceLedger & | other | ) | const |
void cqsp::common::components::ResourceLedger::operator*= | ( | const double | value | ) |
void cqsp::common::components::ResourceLedger::operator*= | ( | const ResourceLedger & | other | ) |
ResourceLedger cqsp::common::components::ResourceLedger::operator+ | ( | const double | value | ) | const |
ResourceLedger cqsp::common::components::ResourceLedger::operator+ | ( | const ResourceLedger & | other | ) | const |
void cqsp::common::components::ResourceLedger::operator+= | ( | const double | value | ) |
void cqsp::common::components::ResourceLedger::operator+= | ( | const ResourceLedger & | other | ) |
ResourceLedger cqsp::common::components::ResourceLedger::operator- | ( | const double | value | ) | const |
ResourceLedger cqsp::common::components::ResourceLedger::operator- | ( | const ResourceLedger & | other | ) | const |
void cqsp::common::components::ResourceLedger::operator-= | ( | const double | value | ) |
void cqsp::common::components::ResourceLedger::operator-= | ( | const ResourceLedger & | other | ) |
ResourceLedger cqsp::common::components::ResourceLedger::operator/ | ( | const double | value | ) | const |
ResourceLedger cqsp::common::components::ResourceLedger::operator/ | ( | const ResourceLedger & | other | ) | const |
void cqsp::common::components::ResourceLedger::operator/= | ( | const double | value | ) |
void cqsp::common::components::ResourceLedger::operator/= | ( | const ResourceLedger & | other | ) |
bool cqsp::common::components::ResourceLedger::operator< | ( | const double & | i | ) |
All resources in this ledger are less than than the number
bool cqsp::common::components::ResourceLedger::operator< | ( | const ResourceLedger & | ledger | ) |
All resources in this ledger are smaller than than the other ledger
bool cqsp::common::components::ResourceLedger::operator<= | ( | const double & | i | ) |
bool cqsp::common::components::ResourceLedger::operator<= | ( | const ResourceLedger & | ledger | ) |
All resources in this ledger are smaller than or equal to than the other ledger
bool cqsp::common::components::ResourceLedger::operator== | ( | const double & | i | ) |
bool cqsp::common::components::ResourceLedger::operator> | ( | const double & | i | ) |
All resources in this ledger are greater than the number
bool cqsp::common::components::ResourceLedger::operator> | ( | const ResourceLedger & | ledger | ) |
All resources in this ledger are greater than the other ledger
bool cqsp::common::components::ResourceLedger::operator>= | ( | const double & | i | ) |
bool cqsp::common::components::ResourceLedger::operator>= | ( | const ResourceLedger & | ledger | ) |
All resources in this ledger are greater than or equal to the other ledger
double cqsp::common::components::ResourceLedger::operator[] | ( | const entt::entity | entity | ) | const |
void cqsp::common::components::ResourceLedger::RemoveResourcesLimited | ( | const ResourceLedger & | other | ) |
Removes the resources, and if the amount of resources removed are more than the resources inside the stockpile, it will set that resource to zero.
ResourceLedger cqsp::common::components::ResourceLedger::SafeDivision | ( | const ResourceLedger & | other | ) |
Returns a copy of the vector divided by the indicated vector, with division by zero resulting in infiniy
std::string cqsp::common::components::ResourceLedger::to_string | ( | ) |
void cqsp::common::components::ResourceLedger::TransferTo | ( | ResourceLedger & | ledger_to, |
const ResourceLedger & | amount | ||
) |
ResourceLedger cqsp::common::components::ResourceLedger::UnitLeger | ( | const double | val | ) |
Returns a copy of the vector with the values set to indicated value