2007-12-21 21:50:46 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2007-12-21 21:50:46 +00:00
|
|
|
/** @file economy_func.h Functions related to the economy. */
|
|
|
|
|
|
|
|
#ifndef ECONOMY_FUNC_H
|
|
|
|
#define ECONOMY_FUNC_H
|
|
|
|
|
|
|
|
#include "economy_type.h"
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "station_type.h"
|
2007-12-21 22:50:51 +00:00
|
|
|
#include "cargo_type.h"
|
|
|
|
#include "vehicle_type.h"
|
2008-09-30 20:51:04 +00:00
|
|
|
#include "company_type.h"
|
2007-12-21 21:50:46 +00:00
|
|
|
|
|
|
|
void ResetPriceBaseMultipliers();
|
2009-11-08 18:04:53 +00:00
|
|
|
void SetPriceBaseMultiplier(Price price, int factor);
|
2007-12-21 21:50:46 +00:00
|
|
|
|
|
|
|
extern const ScoreInfo _score_info[];
|
2008-09-30 20:39:50 +00:00
|
|
|
extern int _score_part[MAX_COMPANIES][SCORE_END];
|
2007-12-21 21:50:46 +00:00
|
|
|
extern Economy _economy;
|
|
|
|
/* Prices and also the fractional part. */
|
|
|
|
extern Prices _price;
|
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
int UpdateCompanyRatingAndValue(Company *c, bool update);
|
2009-01-04 15:32:25 +00:00
|
|
|
void StartupIndustryDailyChanges(bool init_counter);
|
2007-12-21 21:50:46 +00:00
|
|
|
|
|
|
|
Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type);
|
2009-11-15 21:06:13 +00:00
|
|
|
uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, SourceID source_id, const StationList *all_stations);
|
2007-12-21 21:50:46 +00:00
|
|
|
|
2009-06-29 19:55:36 +00:00
|
|
|
void PrepareUnload(Vehicle *front_v);
|
2007-12-21 21:50:46 +00:00
|
|
|
void LoadUnloadStation(Station *st);
|
|
|
|
|
2009-11-24 13:15:58 +00:00
|
|
|
Money GetPrice(Price index, uint cost_factor, const struct GRFFile *grf_file, int shift = 0);
|
2008-02-21 19:09:10 +00:00
|
|
|
|
2009-09-06 18:53:57 +00:00
|
|
|
void InitializeEconomy();
|
|
|
|
void RecomputePrices();
|
2012-10-01 19:31:55 +00:00
|
|
|
bool AddInflation(bool check_year = true);
|
2009-09-06 18:53:57 +00:00
|
|
|
|
2010-11-13 09:45:20 +00:00
|
|
|
/**
|
|
|
|
* Is the economy in recession?
|
|
|
|
* @return \c True if economy is in recession, \c false otherwise.
|
|
|
|
*/
|
|
|
|
static inline bool EconomyIsInRecession()
|
|
|
|
{
|
|
|
|
return _economy.fluct <= 0;
|
|
|
|
}
|
|
|
|
|
2007-12-21 21:50:46 +00:00
|
|
|
#endif /* ECONOMY_FUNC_H */
|