OpenTTD Source 20250509-master-ga45f23686d
StationScopeResolver Struct Reference

Scope resolver for stations. More...

#include <newgrf_station.h>

Inheritance diagram for StationScopeResolver:
ScopeResolver

Data Structures

struct  Cache
 Station variable cache This caches 'expensive' station variable lookups which iterate over several tiles that may be called multiple times per Resolve(). More...
 

Public Member Functions

 StationScopeResolver (ResolverObject &ro, const StationSpec *statspec, BaseStation *st, TileIndex tile)
 Constructor for station scopes.
 
uint32_t GetRandomBits () const override
 Get a few random bits.
 
uint32_t GetRandomTriggers () const override
 Get the triggers.
 
uint32_t GetVariable (uint8_t variable, uint32_t parameter, bool &available) const override
 Get a variable value.
 
- Public Member Functions inherited from ScopeResolver
 ScopeResolver (ResolverObject &ro)
 
virtual void StorePSA (uint reg, int32_t value)
 Store a value into the persistent storage area (PSA).
 

Data Fields

TileIndex tile
 Tile of the station.
 
struct BaseStationst
 Instance of the station.
 
const struct StationSpecstatspec
 Station (type) specification.
 
CargoType cargo_type
 Type of cargo of the station.
 
Axis axis
 Station axis, used only for the slope check callback.
 
Cache cache
 
- Data Fields inherited from ScopeResolver
ResolverObjectro
 Surrounding resolver object.
 

Detailed Description

Scope resolver for stations.

Definition at line 26 of file newgrf_station.h.

Constructor & Destructor Documentation

◆ StationScopeResolver()

StationScopeResolver::StationScopeResolver ( ResolverObject ro,
const StationSpec statspec,
BaseStation st,
TileIndex  tile 
)
inline

Constructor for station scopes.

Parameters
roSurrounding resolver.
statspecStation (type) specification.
stInstance of the station.
tileTile of the station.

Definition at line 55 of file newgrf_station.h.

Member Function Documentation

◆ GetRandomBits()

uint32_t StationScopeResolver::GetRandomBits ( ) const
overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 241 of file newgrf_station.cpp.

References GetStationTileRandomBits(), INVALID_TILE, BaseStation::random_bits, and st.

◆ GetRandomTriggers()

uint32_t StationScopeResolver::GetRandomTriggers ( ) const
overridevirtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented from ScopeResolver.

Definition at line 247 of file newgrf_station.cpp.

References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), st, and BaseStation::waiting_random_triggers.

◆ GetVariable()

Field Documentation

◆ axis

Axis StationScopeResolver::axis

Station axis, used only for the slope check callback.

Definition at line 31 of file newgrf_station.h.

Referenced by GetVariable().

◆ cache

Cache StationScopeResolver::cache
mutable

Definition at line 46 of file newgrf_station.h.

◆ cargo_type

CargoType StationScopeResolver::cargo_type

Type of cargo of the station.

Definition at line 30 of file newgrf_station.h.

Referenced by StationResolverObject::ResolveReal(), and StationResolverObject::StationResolverObject().

◆ st

◆ statspec

const struct StationSpec* StationScopeResolver::statspec

Station (type) specification.

Definition at line 29 of file newgrf_station.h.

Referenced by StationResolverObject::GetDebugID(), GetVariable(), and StationResolverObject::ResolveReal().

◆ tile

TileIndex StationScopeResolver::tile

Tile of the station.

Definition at line 27 of file newgrf_station.h.

Referenced by StationResolverObject::GetTown(), and GetVariable().


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