OpenTTD Source: AirportScopeResolver Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
AirportScopeResolver Struct Reference

Resolver for the airport scope. More...

`#include <newgrf_airport.h>`

Inheritance diagram for AirportScopeResolver:

## Public Member Functions
| AirportScopeResolver (ResolverObject &ro, TileIndex tile, Station *st, const AirportSpec *spec, uint8_t layout)
| Constructor of the scope resolver for an airport.
uint32_t | GetRandomBits () const override
| Get a few random bits.
uint32_t | GetVariable (uint8_t variable, uint32_t parameter, bool &available) const override
| Get a variable value.
void | StorePSA (uint pos, int32_t value) override
| Store a value into the object's persistent storage.
Public Member Functions inherited from ScopeResolver
| ScopeResolver (ResolverObject &ro)
virtual uint32_t | GetRandomTriggers () const
| Get the triggers.

## 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.

## Detailed Description

Resolver for the airport scope.

Definition at line 157 of file newgrf_airport.h.

## Constructor & Destructor Documentation

## ◆ AirportScopeResolver()

AirportScopeResolver::AirportScopeResolver | ( | ResolverObject & | ro,
|  | TileIndex | tile,
|  | Station * | st,
|  | const AirportSpec * | spec,
|  | uint8_t | layout
| ) |  |
| inline

Constructor of the scope resolver for an airport.

Parameters

  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 171 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 195 of file newgrf_airport.cpp.

References BaseStation::random_bits, and st.

## ◆ GetVariable()

uint32_t AirportScopeResolver::GetVariable | ( | uint8_t | variable,
|  | uint32_t | parameter,
|  | bool & | available
| ) |  | const
| overridevirtual

Get a variable value.

Default implementation has no available variables.

Parameters

  | variable | Variable to read
  | parameter | Parameter for 60+x variables
  [out] | available | Set to false, in case the variable does not exist.

Returns
  Value

Reimplemented from ScopeResolver.

Definition at line 161 of file newgrf_airport.cpp.

References Station::airport, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), BaseStation::build_date, TimerGameConst< struct Calendar >::DAYS_TILL_ORIGINAL_BASE_YEAR, BaseStation::facilities, GetBadgeVariableResult(), PersistentStorageArray< TYPE, SIZE >::GetValue(), ResolverObject::grffile, 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

  pos | Position in the persistent storage to use.
  value | Value to store.

Reimplemented from ScopeResolver.

Definition at line 205 of file newgrf_airport.cpp.

References Station::airport, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_persistent_storage_pool >::CanAllocateItem(), ResolverObject::grffile, Airport::psa, ScopeResolver::ro, st, PersistentStorageArray< TYPE, SIZE >::StoreValue(), and OrthogonalTileArea::tile.

## Field Documentation

## ◆ layout

uint8_t AirportScopeResolver::layout

Layout of the airport to build.

Definition at line 160 of file newgrf_airport.h.

Referenced by GetVariable().

## ◆ spec

const AirportSpec* AirportScopeResolver::spec

AirportSpec for which the callback is run.

Definition at line 159 of file newgrf_airport.h.

Referenced by AirportResolverObject::GetDebugID().

## ◆ st

struct Station* AirportScopeResolver::st

Station of the airport for which the callback is run, or `nullptr` for build gui.

Definition at line 158 of file newgrf_airport.h.

Referenced by GetRandomBits(), AirportResolverObject::GetTown(), GetVariable(), and StorePSA().

## ◆ tile

TileIndex AirportScopeResolver::tile

Tile for the callback, only valid for airporttile callbacks.

Definition at line 161 of file newgrf_airport.h.

Referenced by AirportResolverObject::GetTown().

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

- src/newgrf_airport.h
- src/newgrf_airport.cpp