OpenTTD Source 20250509-master-ga45f23686d
|
Scope resolver for stations. More...
#include <newgrf_station.h>
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. | |
![]() | |
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 BaseStation * | st |
Instance of the station. | |
const struct StationSpec * | statspec |
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 |
![]() | |
ResolverObject & | ro |
Surrounding resolver object. | |
Scope resolver for stations.
Definition at line 26 of file newgrf_station.h.
|
inline |
Constructor for station scopes.
ro | Surrounding resolver. |
statspec | Station (type) specification. |
st | Instance of the station. |
tile | Tile of the station. |
Definition at line 55 of file newgrf_station.h.
|
overridevirtual |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 241 of file newgrf_station.cpp.
References GetStationTileRandomBits(), INVALID_TILE, BaseStation::random_bits, and st.
|
overridevirtual |
Get the triggers.
Base class returns 0
to prevent trouble.
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.
|
overridevirtual |
Get a variable value.
Default implementation has no available variables.
variable | Variable to read | |
parameter | Parameter for 60+x variables | |
[out] | available | Set to false, in case the variable does not exist. |
Reimplemented from ScopeResolver.
Definition at line 273 of file newgrf_station.cpp.
References _current_company, axis, AXIS_Y, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), BaseStation::build_date, TimerGameCalendar::date, TimerGameConst< struct Calendar >::DAYS_TILL_ORIGINAL_BASE_YEAR, BaseStation::facilities, GB(), GetAnimationFrame(), GetBadgeVariableResult(), BaseStation::GetByTile(), GetCompanyInfo(), GetCustomStationSpecIndex(), GetNearbyTile(), GetNearbyTileInformation(), BaseStation::GetNewGRFVariable(), GetRailStationAxis(), GetRailType(), GetReverseRailTypeTranslation(), GetStationGfx(), GetTerrainType(), GetTileSlope(), StationSpec::grf_prop, GRFFilePropsBase::grffile, ResolverObject::grffile, HasBit(), HasStationReservation(), HasStationTileRail(), INVALID_AXIS, INVALID_TILE, IsCustomStationSpecIndex(), BaseStation::owner, ScopeResolver::ro, SLOPE_EW, BaseStation::speclist, st, statspec, BaseStation::string_id, tile, and BaseStation::TileBelongsToRailStation().
Axis StationScopeResolver::axis |
Station axis, used only for the slope check callback.
Definition at line 31 of file newgrf_station.h.
Referenced by GetVariable().
|
mutable |
Definition at line 46 of file newgrf_station.h.
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().
struct BaseStation* StationScopeResolver::st |
Instance of the station.
Definition at line 28 of file newgrf_station.h.
Referenced by GetRandomBits(), GetRandomTriggers(), StationResolverObject::GetTown(), GetVariable(), StationResolverObject::ResolveReal(), and StationResolverObject::StationResolverObject().
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().
TileIndex StationScopeResolver::tile |
Tile of the station.
Definition at line 27 of file newgrf_station.h.
Referenced by StationResolverObject::GetTown(), and GetVariable().