10 #ifndef ECONOMY_FUNC_H
11 #define ECONOMY_FUNC_H
33 Money GetTransportedGoodsIncome(uint num_pieces, uint dist, uint16_t transit_periods,
CargoID cargo_type);
51 return _economy.
fluct <= 0;
65 if (percentage == 100)
return num;
68 return std::max((num * 100) / percentage, 1u);
80 if (_game_mode == GM_MENU)
return num;
82 if (num == 0)
return num;
87 if (percentage == 100)
return num;
89 uint scaled = (num * percentage) / 100;
Types related to cargoes...
uint8_t CargoID
Cargo slots to indicate a cargo type within a game.
uint16_t SourceID
Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
SourceType
Types of cargo source and destination.
Types related to companies.
Owner
Enum for all companies/owners.
@ INVALID_OWNER
An invalid owner.
@ MAX_COMPANIES
Maximum number of companies.
Money GetPrice(Price index, uint cost_factor, const GRFFile *grf_file, int shift)
Determine a certain price.
int UpdateCompanyRatingAndValue(Company *c, bool update)
if update is set to true, the economy is updated with this score (also the house is updated,...
const ScoreInfo _score_info[]
Score info, values used for computing the detailed performance rating.
static uint ScaleByInverseCargoScale(uint num, bool town)
Scale a number by the inverse of the cargo scale setting, e.g.
bool AddInflation(bool check_year=true)
Add monthly inflation.
void LoadUnloadStation(Station *st)
Load/unload the vehicles in this station according to the order they entered.
void RecomputePrices()
Computes all prices, payments and maximum loan.
void PrepareUnload(Vehicle *front_v)
Prepare the vehicle to be unloaded.
bool EconomyIsInRecession()
Is the economy in recession?
void SetPriceBaseMultiplier(Price price, int factor)
Change a price base by the given factor.
void InitializeEconomy()
Resets economy to initial values.
void ResetPriceBaseMultipliers()
Reset changes to the price base multipliers.
uint ScaleByCargoScale(uint num, bool town)
Scale a number by the cargo scale setting.
void StartupIndustryDailyChanges(bool init_counter)
Initialize the variables that will maintain the daily industry change system.
Types related to the economy.
@ SCORE_END
How many scores are there..
Money Prices[PR_END]
Prices of everything.
Price
Enumeration of all base prices for use with Prices.
Pseudo random number generator.
bool Chance16(const uint32_t a, const uint32_t b, const std::source_location location=std::source_location::current())
Flips a coin with given probability.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Types related to global configuration settings.
Types related to stations.
std::set< Station *, StationCompare > StationList
List of stations.
uint16_t industry_cargo_scale
scale cargo production of industries by this percentage.
uint16_t town_cargo_scale
scale cargo production of towns by this percentage.
int16_t fluct
Economy fluctuation status.
Dynamic data of a loaded NewGRF.
EconomySettings economy
settings to change the economy
Data structure for storing how the score is computed for a single score id.
Types related to vehicles.