24#include <entt/entt.hpp>
195 bool HasGood(entt::entity good) {
return (*this).find(good) != (*this).end(); }
210 using LedgerMap::operator[];
211 using LedgerMap::begin;
212 using LedgerMap::cbegin;
213 using LedgerMap::cend;
214 using LedgerMap::clear;
215 using LedgerMap::crbegin;
216 using LedgerMap::crend;
217 using LedgerMap::emplace;
218 using LedgerMap::empty;
219 using LedgerMap::end;
220 using LedgerMap::mapped_type;
221 using LedgerMap::rbegin;
222 using LedgerMap::rend;
223 using LedgerMap::size;
224 using LedgerMap::value_comp;
227ResourceLedger
CopyVals(
const ResourceLedger& keys,
const ResourceLedger& values);
314 std::map<entt::entity, double>
dist;
Definition: resource.h:76
bool HasAllResources(const ResourceLedger &)
Checks if this current resource ledger has any resources in this list
Definition: resource.cpp:315
ResourceLedger Clamp(const double, const double)
Returns a copy of the vector with the values clamped between the min and max indicated
Definition: resource.cpp:301
ResourceLedger SafeDivision(const ResourceLedger &)
Returns a copy of the vector divided by the indicated vector, with division by zero resulting in infi...
Definition: resource.cpp:338
double MultiplyAndGetSum(ResourceLedger &other)
Multiplies the numbers stated in the resource ledger. Used for calculating the price,...
Definition: resource.cpp:330
ResourceLedger UnitLeger(const double)
Returns a copy of the vector with the values set to indicated value
Definition: resource.cpp:293
bool operator==(const double &)
Definition: resource.cpp:223
double Min()
Finds the smallest value in the Ledger.
Definition: resource.cpp:356
ResourceLedger operator-(const ResourceLedger &) const
Definition: resource.cpp:165
bool operator>=(const ResourceLedger &)
All resources in this ledger are greater than or equal to the other ledger
Definition: resource.cpp:229
bool LedgerEquals(const ResourceLedger &)
Definition: resource.cpp:233
void operator/=(const ResourceLedger &)
Definition: resource.cpp:129
void operator-=(const ResourceLedger &)
Definition: resource.cpp:111
bool operator>(const ResourceLedger &)
All resources in this ledger are greater than the other ledger
Definition: resource.cpp:241
void RemoveResourcesLimited(const ResourceLedger &)
Removes the resources, and if the amount of resources removed are more than the resources inside the ...
Definition: resource.cpp:268
void operator*=(const ResourceLedger &)
Definition: resource.cpp:123
ResourceLedger operator/(const ResourceLedger &) const
Definition: resource.cpp:177
bool EnoughToTransfer(const ResourceLedger &amount)
This resource ledger has enough resources inside to transfer "amount" amount of resources away
Definition: resource.cpp:103
double GetSum()
Definition: resource.cpp:322
double Max()
Finds the largest value in the Ledger.
Definition: resource.cpp:368
void TransferTo(ResourceLedger &, const ResourceLedger &)
Definition: resource.cpp:255
void AssignFrom(const ResourceLedger &)
Definition: resource.cpp:249
ResourceLedger operator*(const ResourceLedger &) const
Definition: resource.cpp:171
void MultiplyAdd(const ResourceLedger &, double)
Definition: resource.cpp:262
std::string to_string()
Definition: resource.cpp:378
ResourceLedger LimitedRemoveResources(const ResourceLedger &)
Same as RemoveResourcesLimited, except that it returns how much resources it took out.
Definition: resource.cpp:278
bool operator<(const ResourceLedger &)
All resources in this ledger are smaller than than the other ledger
Definition: resource.cpp:237
double Average()
Returns a copy of the vector divided by the indicated vector, with division by zero resulting in infi...
Definition: resource.cpp:376
bool HasGood(entt::entity good)
Definition: resource.h:195
void operator+=(const ResourceLedger &)
Definition: resource.cpp:117
bool operator<=(const ResourceLedger &)
All resources in this ledger are smaller than or equal to than the other ledger
Definition: resource.cpp:245
ResourceLedger operator+(const ResourceLedger &) const
Definition: resource.cpp:159
double operator[](const entt::entity) const
Definition: resource.cpp:94
~ResourceLedger()=default
double kilogram
Definition: units.h:39
double joule
Definition: units.h:41
double meter_cube
Definition: units.h:38
ProductionType
Definition: area.h:30
ResourceLedger ResourceLedgerZip(const ResourceLedger &key, const ResourceLedger &value)
std::map< entt::entity, double > LedgerMap
Definition: resource.h:74
ResourceLedger CopyVals(const ResourceLedger &keys, const ResourceLedger &values)
Creates a new resource ledger using the keys from one resource ledger, and the values from annother
Definition: resource.cpp:404
When adding assets, it is extremely crucial that you read cqsp::asset::AssetLoader::LoadResources to ...
Definition: clientctx.h:21
Definition: resource.h:72
See SysPopulationConsumption for an explanation of these values
Definition: resource.h:57
double autonomous_consumption
Definition: resource.h:62
double marginal_propensity
Definition: resource.h:67
Definition: resource.h:260
double maintenance
Definition: resource.h:265
double transport
Definition: resource.h:270
double revenue
Definition: resource.h:261
double materialcosts
Definition: resource.h:263
double profit
Definition: resource.h:268
void Reset()
Definition: resource.h:272
double wages
Definition: resource.h:267
Definition: resource.h:40
cqsp::common::components::types::joule energy
Definition: resource.h:42
Definition: resource.h:289
float interval
Definition: resource.h:290
float time_left
Definition: resource.h:291
Definition: resource.h:311
Definition: resource.h:309
Definition: resource.h:305
Definition: resource.h:52
Definition: resource.h:254
double size
Definition: resource.h:255
double utilization
Definition: resource.h:256
double wages
Definition: resource.h:257
Something that has a mass.
Definition: resource.h:35
cqsp::common::components::types::meter_cube volume
Definition: resource.h:36
cqsp::common::components::types::kilogram mass
Definition: resource.h:37
Definition: resource.h:70
Definition: resource.h:248
ResourceLedger scaling
Definition: resource.h:250
ResourceLedger fixed
Definition: resource.h:249
Definition: resource.h:237
RecipeOutput output
Definition: resource.h:239
float interval
Definition: resource.h:241
ResourceLedger capitalcost
Definition: resource.h:245
ResourceLedger input
Definition: resource.h:238
ProductionType type
Definition: resource.h:240
double workers
Definition: resource.h:243
Definition: resource.h:230
ResourceLedger operator*(const double value) const
Definition: resource.cpp:390
entt::entity entity
Definition: resource.h:231
double amount
Definition: resource.h:232
Definition: resource.h:296
Definition: resource.h:299
entt::entity recipe
Definition: resource.h:300
Definition: resource.h:313
std::map< entt::entity, double > dist
Definition: resource.h:314
Definition: resource.h:283
ResourceLedger input
Definition: resource.h:284
ResourceLedger output
Definition: resource.h:285
Definition: resource.h:297
Definition: resource.h:303
The unit name of the good. If it doesn't have it, then it's a quantity.
Definition: resource.h:48
std::string unit_name
Definition: resource.h:49