OpenTTD Source  14.0-beta3
AirportScopeResolver Struct Reference

Resolver for the airport scope. More...

#include <newgrf_airport.h>

Inheritance diagram for AirportScopeResolver:
ScopeResolver

Public Member Functions

 AirportScopeResolver (ResolverObject &ro, TileIndex tile, Station *st, byte airport_id, byte layout)
 Constructor of the scope resolver for an airport. More...
 
uint32_t GetRandomBits () const override
 Get a few random bits. More...
 
uint32_t GetVariable (byte 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 Stationst
 Station of the airport for which the callback is run, or nullptr 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.
 
- Data Fields inherited from ScopeResolver
ResolverObjectro
 Surrounding resolver object.
 

Detailed Description

Resolver for the airport scope.

Definition at line 149 of file newgrf_airport.h.

Constructor & Destructor Documentation

◆ AirportScopeResolver()

AirportScopeResolver::AirportScopeResolver ( ResolverObject ro,
TileIndex  tile,
Station st,
byte  airport_id,
byte  layout 
)
inline

Constructor of the scope resolver for an airport.

Parameters
roSurrounding resolver.
tileTile for the callback, only valid for airporttile callbacks.
stStation of the airport for which the callback is run, or nullptr for build gui.
airport_idType of airport for which the callback is run.
layoutLayout of the airport to build.

Definition at line 163 of file newgrf_airport.h.

Member Function Documentation

◆ GetRandomBits()

uint32_t AirportScopeResolver::GetRandomBits ( ) const
overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 188 of file newgrf_airport.cpp.

References BaseStation::random_bits, and st.

◆ GetVariable()

uint32_t AirportScopeResolver::GetVariable ( byte  variable,
[[maybe_unused] ] uint32_t  parameter,
bool *  available 
) const
overridevirtual

Get a variable value.

Default implementation has no available variables.

Parameters
variableVariable to read
parameterParameter for 60+x variables
[out]availableSet to false, in case the variable does not exist.
Returns
Value

Reimplemented from ScopeResolver.

Definition at line 156 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.

◆ StorePSA()

void AirportScopeResolver::StorePSA ( uint  pos,
int32_t  value 
)
overridevirtual

Store a value into the object's persistent storage.

Parameters
posPosition in the persistent storage to use.
valueValue to store.

Reimplemented from ScopeResolver.

Definition at line 198 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.


The documentation for this struct was generated from the following files: