OpenTTD Source
20241108-master-g80f628063a
|
Resolver for the airport scope. More...
#include <newgrf_airport.h>
Public Member Functions | |
AirportScopeResolver (ResolverObject &ro, TileIndex tile, Station *st, const AirportSpec *spec, uint8_t layout) | |
Constructor of the scope resolver for an airport. More... | |
uint32_t | GetRandomBits () const override |
Get a few random bits. More... | |
uint32_t | GetVariable (uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const override |
Get a variable value. More... | |
void | StorePSA (uint pos, int32_t value) override |
Store a value into the object's persistent storage. More... | |
Public Member Functions inherited from ScopeResolver | |
ScopeResolver (ResolverObject &ro) | |
virtual uint32_t | GetTriggers () const |
Get the triggers. More... | |
Data Fields | |
struct Station * | st |
Station of the airport for which the callback is run, or nullptr for build gui. | |
const AirportSpec * | spec |
AirportSpec for which the callback is run. | |
uint8_t | layout |
Layout of the airport to build. | |
TileIndex | tile |
Tile for the callback, only valid for airporttile callbacks. | |
Data Fields inherited from ScopeResolver | |
ResolverObject & | ro |
Surrounding resolver object. | |
Resolver for the airport scope.
Definition at line 150 of file newgrf_airport.h.
|
inline |
Constructor of the scope resolver for an airport.
ro | Surrounding resolver. |
tile | Tile for the callback, only valid for airporttile callbacks. |
st | Station of the airport for which the callback is run, or nullptr for build gui. |
spec | AirportSpec for which the callback is run. |
layout | Layout of the airport to build. |
Definition at line 164 of file newgrf_airport.h.
|
overridevirtual |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 189 of file newgrf_airport.cpp.
References BaseStation::random_bits, and st.
|
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 157 of file newgrf_airport.cpp.
References Station::airport, BaseStation::build_date, TimerGameConst< struct Calendar >::DAYS_TILL_ORIGINAL_BASE_YEAR, BaseStation::facilities, PersistentStorageArray< TYPE, SIZE >::GetValue(), layout, Airport::psa, ScopeResolver::ro, and st.
|
overridevirtual |
Store a value into the object's persistent storage.
pos | Position in the persistent storage to use. |
value | Value to store. |
Reimplemented from ScopeResolver.
Definition at line 199 of file newgrf_airport.cpp.
References Station::airport, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_persistent_storage_pool >::CanAllocateItem(), ResolverObject::grffile, Airport::psa, ScopeResolver::ro, and st.