OpenTTD
economy_func.h
Go to the documentation of this file.
1 /* $Id: economy_func.h 24565 2012-10-01 19:31:55Z frosch $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef ECONOMY_FUNC_H
13 #define ECONOMY_FUNC_H
14 
15 #include "economy_type.h"
16 #include "station_type.h"
17 #include "cargo_type.h"
18 #include "vehicle_type.h"
19 #include "company_type.h"
20 
22 void SetPriceBaseMultiplier(Price price, int factor);
23 
24 extern const ScoreInfo _score_info[];
25 extern int _score_part[MAX_COMPANIES][SCORE_END];
26 extern Economy _economy;
27 /* Prices and also the fractional part. */
28 extern Prices _price;
29 
30 int UpdateCompanyRatingAndValue(Company *c, bool update);
31 void StartupIndustryDailyChanges(bool init_counter);
32 
33 Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type);
34 uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, SourceID source_id, const StationList *all_stations);
35 
36 void PrepareUnload(Vehicle *front_v);
37 void LoadUnloadStation(Station *st);
38 
39 Money GetPrice(Price index, uint cost_factor, const struct GRFFile *grf_file, int shift = 0);
40 
41 void InitializeEconomy();
42 void RecomputePrices();
43 bool AddInflation(bool check_year = true);
44 
49 static inline bool EconomyIsInRecession()
50 {
51  return _economy.fluct <= 0;
52 }
53 
54 #endif /* ECONOMY_FUNC_H */