town.h
changeset 919 544f374ee392
parent 835 f6a341f541d7
child 1005 f48b2bdd84fc
equal deleted inserted replaced
918:c092add72215 919:544f374ee392
    89 	INDUSTRY_REMOVE = 2
    89 	INDUSTRY_REMOVE = 2
    90 };
    90 };
    91 
    91 
    92 bool CheckforTownRating(uint tile, uint32 flags, Town *t, byte type);
    92 bool CheckforTownRating(uint tile, uint32 flags, Town *t, byte type);
    93 
    93 
    94 #define DEREF_TOWN(i) (&_towns[i])
    94 VARDEF Town _towns[70];
    95 #define FOR_ALL_TOWNS(c) for(c=_towns; c != endof(_towns); c++)
    95 VARDEF uint _towns_size;
    96 
    96 
    97 VARDEF Town _towns[70];
    97 VARDEF uint16 *_town_sort;
       
    98 
       
    99 static inline Town *GetTown(uint index)
       
   100 {
       
   101 	assert(index < _towns_size);
       
   102 	return &_towns[index];
       
   103 }
       
   104 
       
   105 #define FOR_ALL_TOWNS(t) for(t = _towns; t != &_towns[_towns_size]; t++)
       
   106 
    98 VARDEF int _total_towns; // For the AI: the amount of towns active
   107 VARDEF int _total_towns; // For the AI: the amount of towns active
    99 
   108 
   100 VARDEF bool _town_sort_dirty;
   109 VARDEF bool _town_sort_dirty;
   101 VARDEF byte _town_sort_order;
   110 VARDEF byte _town_sort_order;
   102 
   111