OpenTTD Source  20241121-master-g67a0fccfad
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. More...
 
uint32_t GetTriggers () const override
 Get the triggers. More...
 
uint32_t GetVariable (uint8_t variable, [[maybe_unused]] uint32_t 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_t 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 RoadStopSpecroadstopspec
 Station (type) specification.
 
CargoID cargo_type
 Type of cargo of the station.
 
StationType type
 Station type.
 
uint8_t view
 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 89 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 51 of file newgrf_roadstop.cpp.

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

◆ GetTriggers()

uint32_t RoadStopScopeResolver::GetTriggers ( ) const
overridevirtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented from ScopeResolver.

Definition at line 62 of file newgrf_roadstop.cpp.

References st, and BaseStation::waiting_triggers.

◆ GetVariable()

uint32_t RoadStopScopeResolver::GetVariable ( uint8_t  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 67 of file newgrf_roadstop.cpp.

References INVALID_TILE, and tile.


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