|
OpenTTD Source 20260206-master-g4d4e37dbf1
|
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. | |
| uint32_t | GetVariable (uint8_t variable, uint32_t parameter, bool &available) const override |
| Get a variable value. | |
| void | StorePSA (uint reg, int32_t value) override |
| Store a value into the persistent storage area (PSA). | |
| Public Member Functions inherited from ScopeResolver | |
| ScopeResolver (ResolverObject &ro) | |
| virtual uint32_t | GetRandomBits () const |
| Get a few random bits. | |
| virtual uint32_t | GetRandomTriggers () const |
| Get the triggers. | |
Data Fields | |
| Town * | t |
| Town of the scope. | |
| bool | readonly |
| When set, persistent storage of the town is read-only,. | |
| Data Fields inherited from ScopeResolver | |
| ResolverObject & | ro |
| Surrounding resolver object. | |
Scope resolver for a town.
Definition at line 22 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 32 of file newgrf_town.h.
References readonly, ScopeResolver::ro, and t.
|
overridevirtual |
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 27 of file newgrf_town.cpp.
References _settings_game, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), Town::cache, ClampTo(), CT_PASSENGERS, Debug, Town::flags, Town::fund_buildings_months, GB(), Town::grow_counter, Town::growth_rate, Town::have_ratings, Town::larger_town, TownCache::num_houses, TownCache::population, Town::SuppliedHistory::production, Town::ratings, Town::received, ScopeResolver::ro, Town::road_build_months, TownCache::squared_town_zone_radius, Town::statues, TAE_FOOD, TAE_WATER, to_underlying(), Ticks::TOWN_GROWTH_TICKS, TownCentre, TownEdge, TownInnerSuburb, TownOuterSuburb, TownOutskirt, Town::SuppliedHistory::transported, and Town::xy.
|
overridevirtual |
Store a value into the persistent storage area (PSA).
Default implementation does nothing (for newgrf classes without storage).
| pos | The position into the storage area. |
| value | The new value to store. |
Reimplemented from ScopeResolver.
Definition at line 134 of file newgrf_town.cpp.
References GSF_FAKE_TOWNS, readonly, ScopeResolver::ro, PersistentStorageArray< TYPE, SIZE >::StoreValue(), t, and Town::xy.
| bool TownScopeResolver::readonly |
When set, persistent storage of the town is read-only,.
Definition at line 24 of file newgrf_town.h.
Referenced by StorePSA(), and TownScopeResolver().
| Town* TownScopeResolver::t |
Town of the scope.
Definition at line 23 of file newgrf_town.h.
Referenced by StorePSA(), and TownScopeResolver().