2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2007-02-23 18:55:07 +00:00
|
|
|
/** @file economy.h */
|
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
#ifndef ECONOMY_H
|
|
|
|
#define ECONOMY_H
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
void ResetPriceBaseMultipliers();
|
2005-10-12 09:54:29 +00:00
|
|
|
void SetPriceBaseMultiplier(uint price, byte factor);
|
2005-10-12 07:27:56 +00:00
|
|
|
|
2007-03-07 12:11:48 +00:00
|
|
|
struct Economy {
|
2007-02-23 18:55:07 +00:00
|
|
|
int32 max_loan; ///< Maximum possible loan
|
|
|
|
int32 max_loan_unround; ///< Economy fluctuation status
|
2004-08-09 17:04:08 +00:00
|
|
|
int fluct;
|
2007-02-23 18:55:07 +00:00
|
|
|
byte interest_rate; ///< Interest
|
|
|
|
byte infl_amount; ///< inflation amount
|
|
|
|
byte infl_amount_pr; ///< "floating" portion of inflation
|
2007-03-07 12:11:48 +00:00
|
|
|
};
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
VARDEF Economy _economy;
|
|
|
|
|
2007-03-07 12:11:48 +00:00
|
|
|
struct Subsidy {
|
2006-03-26 22:23:32 +00:00
|
|
|
CargoID cargo_type;
|
2004-08-09 17:04:08 +00:00
|
|
|
byte age;
|
2006-03-26 22:41:56 +00:00
|
|
|
/* from and to can either be TownID, StationID or IndustryID */
|
2004-12-28 17:40:15 +00:00
|
|
|
uint16 from;
|
|
|
|
uint16 to;
|
2007-03-07 12:11:48 +00:00
|
|
|
};
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
|
2007-01-10 18:56:51 +00:00
|
|
|
enum ScoreID {
|
|
|
|
SCORE_BEGIN = 0,
|
2006-06-27 21:25:53 +00:00
|
|
|
SCORE_VEHICLES = 0,
|
|
|
|
SCORE_STATIONS = 1,
|
|
|
|
SCORE_MIN_PROFIT = 2,
|
|
|
|
SCORE_MIN_INCOME = 3,
|
|
|
|
SCORE_MAX_INCOME = 4,
|
|
|
|
SCORE_DELIVERED = 5,
|
|
|
|
SCORE_CARGO = 6,
|
|
|
|
SCORE_MONEY = 7,
|
|
|
|
SCORE_LOAN = 8,
|
2007-02-23 18:55:07 +00:00
|
|
|
SCORE_TOTAL = 9, ///< This must always be the last entry
|
|
|
|
SCORE_END = 10, ///< How many scores are there..
|
2004-09-10 19:02:27 +00:00
|
|
|
|
2007-02-23 18:55:07 +00:00
|
|
|
SCORE_MAX = 1000 ///< The max score that can be in the performance history
|
|
|
|
/* the scores together of score_info is allowed to be more! */
|
2004-08-23 10:59:03 +00:00
|
|
|
};
|
|
|
|
|
2007-01-10 18:56:51 +00:00
|
|
|
DECLARE_POSTFIX_INCREMENT(ScoreID);
|
|
|
|
|
2007-03-07 12:11:48 +00:00
|
|
|
struct ScoreInfo {
|
2007-02-23 18:55:07 +00:00
|
|
|
byte id; ///< Unique ID of the score
|
|
|
|
int needed; ///< How much you need to get the perfect score
|
|
|
|
int score; ///< How much score it will give
|
2007-03-07 12:11:48 +00:00
|
|
|
};
|
2004-08-23 10:59:03 +00:00
|
|
|
|
2005-08-01 16:31:19 +00:00
|
|
|
extern const ScoreInfo _score_info[];
|
2007-01-10 18:56:51 +00:00
|
|
|
extern int _score_part[MAX_PLAYERS][SCORE_END];
|
2004-08-23 10:59:03 +00:00
|
|
|
|
2004-09-01 21:54:12 +00:00
|
|
|
int UpdateCompanyRatingAndValue(Player *p, bool update);
|
2004-08-23 10:59:03 +00:00
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
VARDEF Subsidy _subsidies[MAX_PLAYERS];
|
2005-11-13 13:43:55 +00:00
|
|
|
Pair SetupSubsidyDecodeParam(const Subsidy* s, bool mode);
|
2006-12-26 15:28:11 +00:00
|
|
|
void DeleteSubsidyWithTown(TownID index);
|
|
|
|
void DeleteSubsidyWithIndustry(IndustryID index);
|
|
|
|
void DeleteSubsidyWithStation(StationID index);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2006-03-26 22:23:32 +00:00
|
|
|
int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type);
|
2007-03-21 13:19:01 +00:00
|
|
|
uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
#endif /* ECONOMY_H */
|