OpenTTD Source 20250312-master-gcdcc6b491d
|
Scope resolver for road stops. More...
#include <newgrf_roadstop.h>
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 | GetTriggers () 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 = nullptr |
Instance of the station. | |
const struct RoadStopSpec * | roadstopspec = 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) | |
![]() | |
ResolverObject & | ro |
Surrounding resolver object. | |
Scope resolver for road stops.
Definition at line 91 of file newgrf_roadstop.h.
|
inline |
Definition at line 100 of file newgrf_roadstop.h.
|
overridevirtual |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 52 of file newgrf_roadstop.cpp.
References SpecializedStation< Station, false >::From(), INVALID_TILE, SpecializedStation< Station, false >::IsExpected(), BaseStation::random_bits, st, and tile.
|
overridevirtual |
Get the triggers.
Base class returns 0
to prevent trouble.
Reimplemented from ScopeResolver.
Definition at line 63 of file newgrf_roadstop.cpp.
References st, and BaseStation::waiting_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 68 of file newgrf_roadstop.cpp.
References _current_company, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), BaseStation::build_date, ClosestTownFromTile(), TimerGameCalendar::date, TimerGameConst< struct Calendar >::DAYS_TILL_ORIGINAL_BASE_YEAR, DistanceManhattan(), DistanceSquare(), BaseStation::facilities, GetBadgeVariableResult(), BaseStation::GetByTile(), GetCompanyInfo(), GetCustomRoadStopSpecIndex(), GetNearbyTile(), GetNearbyTileInformation(), BaseStation::GetNewGRFVariable(), GetReverseRoadTypeTranslation(), GetStationGfx(), GetStationIndex(), GetStationType(), GetTerrainType(), GetTileSlope(), GetTownRadiusGroup(), RoadStopSpec::grf_prop, GRFFilePropsBase::grffile, ResolverObject::grffile, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, INVALID_ROADTYPE, INVALID_TILE, IsAnyRoadStopTile(), IsCustomRoadStopSpecIndex(), BaseStation::owner, ScopeResolver::ro, BaseStation::roadstop_speclist, roadstopspec, roadtype, SetBit(), st, TCX_NORMAL, tile, BaseStation::town, type, view, and Town::xy.
CargoType RoadStopScopeResolver::cargo_type {} |
Type of cargo of the station.
Definition at line 95 of file newgrf_roadstop.h.
const struct RoadStopSpec* RoadStopScopeResolver::roadstopspec = nullptr |
Station (type) specification.
Definition at line 94 of file newgrf_roadstop.h.
Referenced by GetVariable().
RoadType RoadStopScopeResolver::roadtype {} |
Road type (used when no tile)
Definition at line 98 of file newgrf_roadstop.h.
Referenced by GetVariable().
struct BaseStation* RoadStopScopeResolver::st = nullptr |
Instance of the station.
Definition at line 93 of file newgrf_roadstop.h.
Referenced by GetRandomBits(), GetTriggers(), and GetVariable().
TileIndex RoadStopScopeResolver::tile {} |
Tile of the station.
Definition at line 92 of file newgrf_roadstop.h.
Referenced by GetRandomBits(), and GetVariable().
StationType RoadStopScopeResolver::type {} |
uint8_t RoadStopScopeResolver::view = 0 |