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