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 { Darkvater@3344: CargoID cargo_type; truelight@0: byte age; Darkvater@3346: /* from and to can either be TownID, StationID or IndustryID */ truelight@820: uint16 from; truelight@820: uint16 to; truelight@0: } Subsidy; truelight@0: truelight@0: dominik@116: enum { tron@4077: SCORE_VEHICLES = 0, tron@4077: SCORE_STATIONS = 1, tron@4077: SCORE_MIN_PROFIT = 2, tron@4077: SCORE_MIN_INCOME = 3, tron@4077: SCORE_MAX_INCOME = 4, tron@4077: SCORE_DELIVERED = 5, tron@4077: SCORE_CARGO = 6, tron@4077: SCORE_MONEY = 7, tron@4077: SCORE_LOAN = 8, tron@4077: SCORE_TOTAL = 9, // This must always be the last entry dominik@116: tron@4077: NUM_SCORE = 10, // How many scores are there.. truelight@193: tron@4077: SCORE_MAX = 1000 // The max score that can be in the performance history tron@4077: // the scores together of score_info is allowed to be more! dominik@116: }; dominik@116: dominik@116: typedef struct ScoreInfo { tron@4077: byte id; // Unique ID of the score tron@4077: int needed; // How much you need to get the perfect score tron@4077: 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); dominik@116: truelight@0: VARDEF Subsidy _subsidies[MAX_PLAYERS]; tron@2630: Pair SetupSubsidyDecodeParam(const Subsidy* s, bool mode); rubidium@5566: void DeleteSubsidyWithTown(TownID index); rubidium@5566: void DeleteSubsidyWithIndustry(IndustryID index); rubidium@5566: void DeleteSubsidyWithStation(StationID index); truelight@0: Darkvater@3344: int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type); tron@1977: uint MoveGoodsToStation(TileIndex tile, int w, int h, int type, uint amount); truelight@0: truelight@0: #endif /* ECONOMY_H */