OpenTTD Source  12.0-beta2
StationScopeResolver Struct Reference

Scope resolver for stations. More...

#include <newgrf_station.h>

Inheritance diagram for StationScopeResolver:
ScopeResolver

Public Member Functions

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

Data Fields

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

Detailed Description

Scope resolver for stations.

Definition at line 24 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 38 of file newgrf_station.h.

Member Function Documentation

◆ GetRandomBits()

uint32 StationScopeResolver::GetRandomBits ( ) const
overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 224 of file newgrf_station.cpp.

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

◆ GetTriggers()

uint32 StationScopeResolver::GetTriggers ( ) const
overridevirtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented from ScopeResolver.

Definition at line 230 of file newgrf_station.cpp.

References st, and BaseStation::waiting_triggers.

◆ GetVariable()

uint32 StationScopeResolver::GetVariable ( byte  variable,
uint32  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 271 of file newgrf_station.cpp.

References _current_company, AXIS_Y, GetCompanyInfo(), GetNearbyTile(), GetTileSlope(), HasBit(), INVALID_AXIS, INVALID_TILE, st, and tile.


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