truelight@0: #ifndef TOWN_H truelight@0: #define TOWN_H truelight@0: truelight@0: #include "player.h" truelight@0: truelight@0: struct Town { truelight@0: TileIndex xy; truelight@0: truelight@0: // Current population of people and amount of houses. truelight@0: uint16 num_houses; truelight@0: uint32 population; truelight@193: truelight@0: // Town name truelight@0: uint16 townnametype; truelight@0: uint32 townnameparts; truelight@193: truelight@193: // NOSAVE: Location of name sign, UpdateTownVirtCoord updates this. truelight@0: ViewportSign sign; truelight@193: truelight@0: // Makes sure we don't build certain house types twice. truelight@0: byte flags12; truelight@0: truelight@0: // Which players have a statue? truelight@0: byte statues; truelight@0: truelight@0: // Sort index in listings truelight@0: byte sort_index_obsolete; truelight@0: truelight@0: // Player ratings as well as a mask that determines which players have a rating. truelight@0: byte have_ratings; truelight@0: uint8 unwanted[MAX_PLAYERS]; // how many months companies aren't wanted by towns (bribe) dominik@121: uint8 exclusivity; // which player has exslusivity dominik@121: uint8 exclusive_counter; // months till the exclusivity expires truelight@0: int16 ratings[MAX_PLAYERS]; truelight@193: truelight@0: // Maximum amount of passengers and mail that can be transported. truelight@0: uint16 max_pass; truelight@0: uint16 max_mail; truelight@0: uint16 new_max_pass; truelight@0: uint16 new_max_mail; truelight@0: uint16 act_pass; truelight@0: uint16 act_mail; truelight@0: uint16 new_act_pass; truelight@0: uint16 new_act_mail; truelight@0: truelight@0: // Amount of passengers that were transported. truelight@0: byte pct_pass_transported; truelight@0: byte pct_mail_transported; truelight@0: truelight@0: // Amount of food and paper that was transported. Actually a bit mask would be enough. truelight@0: uint16 act_food; darkvater@4: uint16 act_water; truelight@0: uint16 new_act_food; darkvater@4: uint16 new_act_water; truelight@193: truelight@0: // Time until we rebuild a house. truelight@0: byte time_until_rebuild; truelight@0: truelight@0: // When to grow town next time. truelight@0: byte grow_counter; truelight@193: byte growth_rate; truelight@0: truelight@0: // Fund buildings program in action? truelight@0: byte fund_buildings_months; truelight@193: truelight@0: // Fund road reconstruction in action? truelight@0: byte road_build_months; truelight@0: truelight@0: // Index in town array truelight@0: byte index; truelight@0: truelight@0: // NOSAVE: UpdateTownRadius updates this given the house count. truelight@0: uint16 radius[5]; truelight@0: }; truelight@0: truelight@0: truelight@0: void InitializeTown(); truelight@0: void ShowTownViewWindow(uint town); truelight@0: void DeleteTown(Town *t); truelight@0: void ExpandTown(Town *t); truelight@0: bool GrowTown(Town *t); truelight@0: Town *CreateRandomTown(); truelight@0: truelight@0: enum { truelight@0: ROAD_REMOVE = 0, truelight@0: UNMOVEABLE_REMOVE = 1, truelight@0: TUNNELBRIDGE_REMOVE = 1, truelight@0: INDUSTRY_REMOVE = 2 truelight@0: }; truelight@0: truelight@0: bool CheckforTownRating(uint tile, uint32 flags, Town *t, byte type); truelight@0: truelight@0: #define DEREF_TOWN(i) (&_towns[i]) truelight@0: #define FOR_ALL_TOWNS(c) for(c=_towns; c != endof(_towns); c++) truelight@0: truelight@0: VARDEF Town _towns[70]; truelight@0: VARDEF int _total_towns; // For the AI: the amount of towns active truelight@0: truelight@0: VARDEF bool _town_sort_dirty; truelight@0: VARDEF byte _town_sort_order; truelight@0: truelight@0: VARDEF Town *_cleared_town; truelight@0: VARDEF int _cleared_town_rating; truelight@0: truelight@0: #endif /* TOWN_H */