OpenTTD Source 20260206-master-g4d4e37dbf1
RoadStopScopeResolver Struct Reference

Scope resolver for road stops. More...

#include <newgrf_roadstop.h>

Inheritance diagram for RoadStopScopeResolver:
ScopeResolver

Public Member Functions

 RoadStopScopeResolver (ResolverObject &ro, BaseStation *st, const RoadStopSpec *roadstopspec, TileIndex tile, RoadType roadtype, StationType type, uint8_t view=0)
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 = nullptr
 Instance of the station.
const struct RoadStopSpecroadstopspec = nullptr
 Station (type) specification.
CargoType cargo_type {}
 Type of cargo of the station.
StationType type {}
 Station type.
uint8_t view = 0
 Station axis.
RoadType roadtype {}
 Road type (used when no tile).
Data Fields inherited from ScopeResolver
ResolverObjectro
 Surrounding resolver object.

Detailed Description

Scope resolver for road stops.

Definition at line 83 of file newgrf_roadstop.h.

Constructor & Destructor Documentation

◆ RoadStopScopeResolver()

RoadStopScopeResolver::RoadStopScopeResolver ( ResolverObject & ro,
BaseStation * st,
const RoadStopSpec * roadstopspec,
TileIndex tile,
RoadType roadtype,
StationType type,
uint8_t view = 0 )
inline

Definition at line 92 of file newgrf_roadstop.h.

Member Function Documentation

◆ GetRandomBits()

uint32_t RoadStopScopeResolver::GetRandomBits ( ) const
overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 56 of file newgrf_roadstop.cpp.

References SpecializedStation< Station, false >::From(), INVALID_TILE, SpecializedStation< Station, false >::IsExpected(), st, and tile.

◆ GetRandomTriggers()

uint32_t RoadStopScopeResolver::GetRandomTriggers ( ) const
overridevirtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented from ScopeResolver.

Definition at line 67 of file newgrf_roadstop.cpp.

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

◆ GetVariable()

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

Field Documentation

◆ cargo_type

CargoType RoadStopScopeResolver::cargo_type {}

Type of cargo of the station.

Definition at line 87 of file newgrf_roadstop.h.

◆ roadstopspec

const struct RoadStopSpec* RoadStopScopeResolver::roadstopspec = nullptr

Station (type) specification.

Definition at line 86 of file newgrf_roadstop.h.

Referenced by GetVariable().

◆ roadtype

RoadType RoadStopScopeResolver::roadtype {}

Road type (used when no tile).

Definition at line 90 of file newgrf_roadstop.h.

Referenced by GetVariable().

◆ st

struct BaseStation* RoadStopScopeResolver::st = nullptr

Instance of the station.

Definition at line 85 of file newgrf_roadstop.h.

Referenced by GetRandomBits(), GetRandomTriggers(), and GetVariable().

◆ tile

TileIndex RoadStopScopeResolver::tile {}

Tile of the station.

Definition at line 84 of file newgrf_roadstop.h.

Referenced by GetRandomBits(), GetRandomTriggers(), and GetVariable().

◆ type

StationType RoadStopScopeResolver::type {}

Station type.

Definition at line 88 of file newgrf_roadstop.h.

Referenced by GetVariable().

◆ view

uint8_t RoadStopScopeResolver::view = 0

Station axis.

Definition at line 89 of file newgrf_roadstop.h.

Referenced by GetVariable().


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