economy_func.h

Go to the documentation of this file.
00001 /* $Id: economy_func.h 21156 2010-11-13 09:45:20Z alberth $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef ECONOMY_FUNC_H
00013 #define ECONOMY_FUNC_H
00014 
00015 #include "economy_type.h"
00016 #include "station_type.h"
00017 #include "cargo_type.h"
00018 #include "vehicle_type.h"
00019 #include "company_type.h"
00020 
00021 void ResetPriceBaseMultipliers();
00022 void SetPriceBaseMultiplier(Price price, int factor);
00023 
00024 extern const ScoreInfo _score_info[];
00025 extern int _score_part[MAX_COMPANIES][SCORE_END];
00026 extern Economy _economy;
00027 /* Prices and also the fractional part. */
00028 extern Prices _price;
00029 
00030 int UpdateCompanyRatingAndValue(Company *c, bool update);
00031 void StartupIndustryDailyChanges(bool init_counter);
00032 
00033 Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type);
00034 uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, SourceID source_id, const StationList *all_stations);
00035 
00036 void PrepareUnload(Vehicle *front_v);
00037 void LoadUnloadStation(Station *st);
00038 
00039 Money GetPrice(Price index, uint cost_factor, const struct GRFFile *grf_file, int shift = 0);
00040 
00041 void InitializeEconomy();
00042 void RecomputePrices();
00043 void AddInflation(bool check_year = true);
00044 
00049 static inline bool EconomyIsInRecession()
00050 {
00051   return _economy.fluct <= 0;
00052 }
00053 
00054 #endif /* ECONOMY_FUNC_H */

Generated on Fri Feb 4 20:53:39 2011 for OpenTTD by  doxygen 1.6.1