tron@2186: /* $Id$ */ tron@2186: truelight@0: #ifndef ECONOMY_H truelight@0: #define ECONOMY_H truelight@0: peter1138@2506: void ResetPriceBaseMultipliers(void); peter1138@2508: void SetPriceBaseMultiplier(uint price, byte factor); peter1138@2506: truelight@0: typedef struct { truelight@0: // Maximum possible loan truelight@0: int32 max_loan; truelight@0: int32 max_loan_unround; truelight@0: // Economy fluctuation status truelight@0: int fluct; truelight@0: // Interest truelight@0: byte interest_rate; truelight@0: byte infl_amount; truelight@0: byte infl_amount_pr; truelight@0: } Economy; truelight@0: truelight@0: VARDEF Economy _economy; truelight@0: truelight@0: typedef struct Subsidy { truelight@0: byte cargo_type; truelight@0: byte age; truelight@820: uint16 from; truelight@820: uint16 to; truelight@0: } Subsidy; truelight@0: truelight@0: dominik@116: enum { dominik@116: SCORE_VEHICLES = 0, dominik@116: SCORE_STATIONS = 1, dominik@116: SCORE_MIN_PROFIT = 2, dominik@116: SCORE_MIN_INCOME = 3, dominik@116: SCORE_MAX_INCOME = 4, dominik@116: SCORE_DELIVERED = 5, dominik@116: SCORE_CARGO = 6, dominik@116: SCORE_MONEY = 7, dominik@116: SCORE_LOAN = 8, dominik@116: SCORE_TOTAL = 9, // This must always be the last entry dominik@116: dominik@116: NUM_SCORE = 10, // How many scores are there.. truelight@193: dominik@116: SCORE_MAX = 1000, // The max score that can be in the performance history dominik@116: // the scores together of score_info is allowed to be more! dominik@116: }; dominik@116: dominik@116: typedef struct ScoreInfo { dominik@116: byte id; // Unique ID of the score dominik@116: int needed; // How much you need to get the perfect score dominik@116: int score; // How much score it will give dominik@116: } ScoreInfo; dominik@116: ludde@2261: extern const ScoreInfo _score_info[]; ludde@2261: extern int _score_part[MAX_PLAYERS][NUM_SCORE]; dominik@116: darkvater@147: int UpdateCompanyRatingAndValue(Player *p, bool update); darkvater@147: void UpdatePlayerHouse(Player *p, uint score); dominik@116: dominik@116: truelight@0: VARDEF Subsidy _subsidies[MAX_PLAYERS]; truelight@0: Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode); truelight@820: void DeleteSubsidyWithIndustry(uint16 index); truelight@820: void DeleteSubsidyWithStation(uint16 index); truelight@0: truelight@0: int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, byte cargo_type); tron@1977: uint MoveGoodsToStation(TileIndex tile, int w, int h, int type, uint amount); truelight@0: truelight@0: #endif /* ECONOMY_H */