|
OpenTTD Source
14.0-beta1
|
Go to the documentation of this file.
28 case 0x41:
return this->
t->
index;
34 if (grfid == 0xFFFFFFFF) {
35 if (this->
ro.
grffile ==
nullptr)
return 0;
39 for (
auto &it : this->
t->psa_list) {
40 if (it->grfid == grfid)
return it->GetValue(parameter);
47 case 0x80:
return this->
t->
xy.base();
48 case 0x81:
return GB(this->
t->
xy.base(), 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);
84 case 0xBA:
return ClampTo<uint16_t>(this->
t->
supplied[CT_PASSENGERS].
new_max);
85 case 0xBB:
return GB(ClampTo<uint16_t>(this->
t->
supplied[CT_PASSENGERS].
new_max), 8, 8);
88 case 0xBE:
return ClampTo<uint16_t>(this->
t->
supplied[CT_PASSENGERS].
new_act);
89 case 0xBF:
return GB(ClampTo<uint16_t>(this->
t->
supplied[CT_PASSENGERS].
new_act), 8, 8);
92 case 0xC2:
return ClampTo<uint16_t>(this->
t->
supplied[CT_PASSENGERS].
old_max);
93 case 0xC3:
return GB(ClampTo<uint16_t>(this->
t->
supplied[CT_PASSENGERS].
old_max), 8, 8);
96 case 0xC6:
return ClampTo<uint16_t>(this->
t->
supplied[CT_PASSENGERS].
old_act);
97 case 0xC7:
return GB(ClampTo<uint16_t>(this->
t->
supplied[CT_PASSENGERS].
old_act), 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 for (
auto &it :
t->psa_list) {
137 if (it->grfid == grfid) {
138 it->StoreValue(pos, value);
147 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
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.
@ 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.
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.