Resolver for the airport scope. More...
Public Member Functions | |
| AirportScopeResolver (ResolverObject *ro, TileIndex tile, Station *st, byte airport_id, byte layout) | |
| Constructor of the scope resolver for an airport. | |
| uint32 | GetRandomBits () const |
| Get a few random bits. | |
| uint32 | GetVariable (byte variable, uint32 parameter, bool *available) const |
| Get a variable value. | |
| void | StorePSA (uint pos, int32 value) |
| Store a value into the object's persistent storage. | |
Data Fields | |
| struct Station * | st |
Station of the airport for which the callback is run, or NULL for build gui. | |
| byte | airport_id |
| Type of airport for which the callback is run. | |
| byte | layout |
| Layout of the airport to build. | |
| TileIndex | tile |
| Tile for the callback, only valid for airporttile callbacks. | |
Resolver for the airport scope.
Definition at line 21 of file newgrf_airport.cpp.
| AirportScopeResolver::AirportScopeResolver | ( | ResolverObject * | ro, | |
| TileIndex | tile, | |||
| Station * | st, | |||
| byte | airport_id, | |||
| byte | layout | |||
| ) |
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 NULL for build gui. | |
| airport_id | Type of airport for which the callback is run. | |
| layout | Layout of the airport to build. |
Definition at line 250 of file newgrf_airport.cpp.
| uint32 AirportScopeResolver::GetRandomBits | ( | ) | const [virtual] |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 199 of file newgrf_airport.cpp.
References BaseStation::random_bits, and st.
| uint32 AirportScopeResolver::GetVariable | ( | byte | variable, | |
| uint32 | parameter, | |||
| bool * | available | |||
| ) | const [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 167 of file newgrf_airport.cpp.
References Station::airport, BaseStation::build_date, Clamp(), DAYS_TILL_ORIGINAL_BASE_YEAR, BaseStation::facilities, PersistentStorageArray< TYPE, SIZE >::GetValue(), layout, Airport::psa, ScopeResolver::ro, and st.
| void AirportScopeResolver::StorePSA | ( | uint | pos, | |
| int32 | value | |||
| ) | [virtual] |
Store a value into the object's persistent storage.
| object | Object that we want to query. | |
| pos | Position in the persistent storage to use. | |
| value | Value to store. |
Reimplemented from ScopeResolver.
Definition at line 210 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, st, and PersistentStorageArray< TYPE, SIZE >::StoreValue().
1.7.1