29 case 0x41:
return this->
t->
index;
35 if (grfid == 0xFFFFFFFF) {
40 std::list<PersistentStorage *>::iterator iter;
41 for (iter = this->
t->psa_list.begin(); iter != this->
t->psa_list.end(); iter++) {
42 if ((*iter)->grfid == grfid)
return (*iter)->GetValue(parameter);
49 case 0x80:
return this->
t->
xy;
50 case 0x81:
return GB(this->
t->
xy, 8, 8);
54 case 0x92:
return this->
t->
flags;
66 case 0x9E:
return this->
t->
ratings[0];
67 case 0x9F:
return GB(this->
t->
ratings[0], 8, 8);
68 case 0xA0:
return this->
t->
ratings[1];
69 case 0xA1:
return GB(this->
t->
ratings[1], 8, 8);
70 case 0xA2:
return this->
t->
ratings[2];
71 case 0xA3:
return GB(this->
t->
ratings[2], 8, 8);
72 case 0xA4:
return this->
t->
ratings[3];
73 case 0xA5:
return GB(this->
t->
ratings[3], 8, 8);
74 case 0xA6:
return this->
t->
ratings[4];
75 case 0xA7:
return GB(this->
t->
ratings[4], 8, 8);
76 case 0xA8:
return this->
t->
ratings[5];
77 case 0xA9:
return GB(this->
t->
ratings[5], 8, 8);
78 case 0xAA:
return this->
t->
ratings[6];
79 case 0xAB:
return GB(this->
t->
ratings[6], 8, 8);
80 case 0xAC:
return this->
t->
ratings[7];
81 case 0xAD:
return GB(this->
t->
ratings[7], 8, 8);
102 case 0xCA:
return this->
t->GetPercentTransported(CT_PASSENGERS);
103 case 0xCB:
return this->
t->GetPercentTransported(CT_MAIL);
116 DEBUG(grf, 1,
"Unhandled town variable 0x%X", variable);
126 assert(this->
t != NULL);
134 if (grfid == 0xFFFFFFFF) grfid = this->
ro.
grffile->grfid;
135 if (grfid != this->
ro.
grffile->grfid)
return;
138 std::list<PersistentStorage *>::iterator iter;
139 for (iter =
t->psa_list.begin(); iter !=
t->psa_list.end(); iter++) {
140 if ((*iter)->grfid == grfid) {
141 (*iter)->StoreValue(pos, value);
150 t->psa_list.push_back(psa);
GameSettings _settings_game
Game settings of a running game or the scenario editor.
TransportedCargoStat< uint16 > received[NUM_TE]
Cargo statistics about received cargotypes.
CompanyMask statues
which companies have a statue?
ResolverObject & ro
Surrounding resolver object.
EconomySettings economy
settings to change the economy
uint32 squared_town_zone_radius[HZB_END]
UpdateTownRadius updates this given the house count.
byte fund_buildings_months
fund buildings program in action?
Functions related to debugging.
Interface for SpriteGroup-s to access the gamestate.
bool readonly
When set, persistent storage of the town is read-only,.
Tindex index
Index of this pool item.
Cargo behaves water-like.
virtual uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Get a variable value.
uint32 population
Current population of people.
Tstorage new_act
Actually transported this month.
Fake town GrfSpecFeature for NewGRF debugging (parent scope)
static uint32 GetRegister(uint i)
Gets the value of a so-called newgrf "register".
TileIndex xy
town center tile
int16 ratings[MAX_COMPANIES]
ratings of each company for this town
void StoreValue(uint pos, int32 value)
Stores some value at a given position.
static const uint16 TOWN_GROW_RATE_CUSTOM
If this mask is applied to Town::growth_rate, the grow_counter will not be calculated by the system (...
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
Class for pooled persistent storage of data.
Tstorage new_max
Maximum amount this month.
Town * t
Town of the scope.
#define DEBUG(name, level,...)
Output a line of debugging information.
const GRFFile * grffile
GRFFile the resolved SpriteGroup belongs to.
uint16 growth_rate
town growth rate
Tstorage old_max
Maximum amount last month.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
TownCache cache
Container for all cacheable data.
uint8 larger_towns
the number of cities to build. These start off larger and grow twice as fast
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() ...
bool larger_town
if this is a larger town and should grow more quickly
Cargo behaves food/fizzy-drinks-like.
virtual void StorePSA(uint reg, int32 value)
Store a value into the persistent storage area (PSA).
Functions to handle the town part of NewGRF towns.
TransportedCargoStat< uint32 > supplied[NUM_CARGO]
Cargo statistics about supplied cargo.
uint32 num_houses
Amount of houses.
byte road_build_months
fund road reconstruction in action?
uint16 grow_counter
counter to count when to grow, value is smaller than or equal to growth_rate
static uint16 ClampToU16(const uint64 a)
Reduce an unsigned 64-bit int to an unsigned 16-bit one.
Tstorage old_act
Actually transported last month.
CompanyMask have_ratings
which companies have a rating
TownResolverObject(const struct GRFFile *grffile, Town *t, bool readonly)
Resolver for a town.
Dynamic data of a loaded NewGRF.