OpenTTD
|
Scope resolver for a town. More...
#include <newgrf_town.h>
Public Member Functions | |
TownScopeResolver (ResolverObject &ro, Town *t, bool readonly) | |
Resolver of a town scope. More... | |
virtual uint32 | GetVariable (byte variable, uint32 parameter, bool *available) const |
Get a variable value. More... | |
virtual void | StorePSA (uint reg, int32 value) |
Store a value into the persistent storage area (PSA). More... | |
![]() | |
ScopeResolver (ResolverObject &ro) | |
virtual uint32 | GetRandomBits () const |
Get a few random bits. More... | |
virtual uint32 | GetTriggers () const |
Get the triggers. More... | |
Data Fields | |
Town * | t |
Town of the scope. | |
bool | readonly |
When set, persistent storage of the town is read-only,. | |
![]() | |
ResolverObject & | ro |
Surrounding resolver object. | |
Scope resolver for a town.
Definition at line 24 of file newgrf_town.h.
|
inline |
Resolver of a town scope.
ro | Surrounding resolver. |
t | Town of the scope. |
readonly | Scope may change persistent storage of the town. |
Definition at line 34 of file newgrf_town.h.
References GetVariable(), and StorePSA().
|
virtual |
Get a variable value.
Default implementation has no available variables.
variable | Variable to read | |
parameter | Parameter for 60+x variables | |
[out] | available | Set to false, in case the variable does not exist. |
Reimplemented from ScopeResolver.
Definition at line 19 of file newgrf_town.cpp.
References _settings_game, Town::cache, ClampToU16(), GameSettings::economy, Town::flags, GB(), GetRegister(), ResolverObject::grffile, Town::grow_counter, Town::growth_rate, Town::have_ratings, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Town::larger_town, EconomySettings::larger_towns, TownCache::num_houses, TownCache::population, Town::ratings, ScopeResolver::ro, TownCache::squared_town_zone_radius, Town::statues, Town::supplied, t, TOWN_GROW_RATE_CUSTOM, and Town::xy.
Referenced by TownScopeResolver().
|
virtual |
Store a value into the persistent storage area (PSA).
Default implementation does nothing (for newgrf classes without storage).
pos | Position to store into. |
value | Value to store. |
Reimplemented from ScopeResolver.
Definition at line 122 of file newgrf_town.cpp.
References readonly.
Referenced by TownScopeResolver().