|
OpenTTD Source
14.0-beta1
|
Go to the documentation of this file.
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;
Money GetPrice(Price index, uint cost_factor, const GRFFile *grf_file, int shift)
Determine a certain price.
void LoadUnloadStation(Station *st)
Load/unload the vehicles in this station according to the order they entered.
Price
Enumeration of all base prices for use with Prices.
uint16_t town_cargo_scale
scale cargo production of towns by this percentage.
void PrepareUnload(Vehicle *front_v)
Prepare the vehicle to be unloaded.
bool Chance16(const uint a, const uint b)
Flips a coin with given probability.
Owner
Enum for all companies/owners.
void ResetPriceBaseMultipliers()
Reset changes to the price base multipliers.
int16_t fluct
Economy fluctuation status.
uint ScaleByCargoScale(uint num, bool town)
Scale a number by the cargo scale setting.
void InitializeEconomy()
Resets economy to initial values.
void StartupIndustryDailyChanges(bool init_counter)
Initialize the variables that will maintain the daily industry change system.
@ SCORE_END
How many scores are there..
@ INVALID_OWNER
An invalid owner.
uint16_t SourceID
Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
void SetPriceBaseMultiplier(Price price, int factor)
Change a price base by the given factor.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
EconomySettings economy
settings to change the economy
@ MAX_COMPANIES
Maximum number of companies.
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.
std::set< Station *, StationCompare > StationList
List of stations.
void RecomputePrices()
Computes all prices, payments and maximum loan.
SourceType
Types of cargo source and destination.
int UpdateCompanyRatingAndValue(Company *c, bool update)
if update is set to true, the economy is updated with this score (also the house is updated,...
uint16_t industry_cargo_scale
scale cargo production of industries by this percentage.
byte CargoID
Cargo slots to indicate a cargo type within a game.
bool EconomyIsInRecession()
Is the economy in recession?
bool AddInflation(bool check_year=true)
Add monthly inflation.
Dynamic data of a loaded NewGRF.
Money Prices[PR_END]
Prices of everything.
Data structure for storing how the score is computed for a single score id.