|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
29 case 0x41:
return this->
t->
index;
35 if (grfid == 0xFFFFFFFF) {
36 if (this->
ro.
grffile ==
nullptr)
return 0;
40 for (
auto &it : this->
t->psa_list) {
41 if (it->grfid == grfid)
return it->GetValue(parameter);
48 case 0x80:
return this->
t->
xy.base();
49 case 0x81:
return GB(this->
t->
xy.base(), 8, 8);
53 case 0x92:
return this->
t->
flags;
65 case 0x9E:
return this->
t->
ratings[0];
66 case 0x9F:
return GB(this->
t->
ratings[0], 8, 8);
67 case 0xA0:
return this->
t->
ratings[1];
68 case 0xA1:
return GB(this->
t->
ratings[1], 8, 8);
69 case 0xA2:
return this->
t->
ratings[2];
70 case 0xA3:
return GB(this->
t->
ratings[2], 8, 8);
71 case 0xA4:
return this->
t->
ratings[3];
72 case 0xA5:
return GB(this->
t->
ratings[3], 8, 8);
73 case 0xA6:
return this->
t->
ratings[4];
74 case 0xA7:
return GB(this->
t->
ratings[4], 8, 8);
75 case 0xA8:
return this->
t->
ratings[5];
76 case 0xA9:
return GB(this->
t->
ratings[5], 8, 8);
77 case 0xAA:
return this->
t->
ratings[6];
78 case 0xAB:
return GB(this->
t->
ratings[6], 8, 8);
79 case 0xAC:
return this->
t->
ratings[7];
80 case 0xAD:
return GB(this->
t->
ratings[7], 8, 8);
101 case 0xCA:
return this->
t->GetPercentTransported(GetCargoIDByLabel(
CT_PASSENGERS));
102 case 0xCB:
return this->
t->GetPercentTransported(GetCargoIDByLabel(CT_MAIL));
115 Debug(grf, 1,
"Unhandled town variable 0x{:X}", variable);
125 assert(this->
t !=
nullptr);
133 if (grfid == 0xFFFFFFFF) grfid = this->
ro.
grffile->grfid;
134 if (grfid != this->
ro.
grffile->grfid)
return;
137 for (
auto &it :
t->psa_list) {
138 if (it->grfid == grfid) {
139 it->StoreValue(pos, value);
148 t->psa_list.push_back(psa);
CompanyMask have_ratings
which companies have a rating
Town * t
Town of the scope.
uint8_t larger_towns
the number of cities to build. These start off larger and grow twice as fast
@ TAE_FOOD
Cargo behaves food/fizzy-drinks-like.
byte road_build_months
fund road reconstruction in action?
CompanyMask statues
which companies have a statue?
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
uint32_t GetRegister(uint i)
Gets the value of a so-called newgrf "register".
Tindex index
Index of this pool item.
Interface for SpriteGroup-s to access the gamestate.
uint16_t growth_rate
town growth rate
const GRFFile * grffile
GRFFile the resolved SpriteGroup belongs to.
TileIndex xy
town center tile
byte fund_buildings_months
fund buildings program in action?
#define Debug(category, level, format_string,...)
Ouptut a line of debugging information.
TransportedCargoStat< uint32_t > supplied[NUM_CARGO]
Cargo statistics about supplied cargo.
bool readonly
When set, persistent storage of the town is read-only,.
uint16_t grow_counter
counter to count when to grow, value is smaller than or equal to growth_rate
@ GSF_FAKE_TOWNS
Fake town GrfSpecFeature for NewGRF debugging (parent scope)
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
byte CargoID
Cargo slots to indicate a cargo type within a game.
TownResolverObject(const struct GRFFile *grffile, Town *t, bool readonly)
Resolver for a town.
uint32_t population
Current population of people.
Tstorage new_max
Maximum amount this month.
static constexpr TimerGameTick::Ticks TOWN_GROWTH_TICKS
Cycle duration for towns trying to grow (this originates from the size of the town array in TTD).
Tstorage old_max
Maximum amount last month.
Tstorage new_act
Actually transported this month.
static constexpr CargoLabel CT_PASSENGERS
Available types of cargo Labels may be re-used between different climates.
@ TAE_WATER
Cargo behaves water-like.
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_t num_houses
Amount of houses.
void StorePSA(uint reg, int32_t value) override
Store a value into the persistent storage area (PSA).
int16_t ratings[MAX_COMPANIES]
ratings of each company for this town
TransportedCargoStat< uint16_t > received[NUM_TAE]
Cargo statistics about received cargotypes.
bool IsValidCargoID(CargoID t)
Test whether cargo type is not INVALID_CARGO.
uint32_t GetVariable(byte variable, [[maybe_unused]] uint32_t parameter, bool *available) const override
Get a variable value.
ResolverObject & ro
Surrounding resolver object.
bool larger_town
if this is a larger town and should grow more quickly
uint32_t squared_town_zone_radius[HZB_END]
UpdateTownRadius updates this given the house count.
void StoreValue(uint pos, int32_t value)
Stores some value at a given position.
Dynamic data of a loaded NewGRF.