OpenTTD Source 20250516-master-g521d0465d9
|
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope). More...
#include <newgrf_spritegroup.h>
Public Member Functions | |
ScopeResolver (ResolverObject &ro) | |
virtual uint32_t | GetRandomBits () const |
Get a few random bits. | |
virtual uint32_t | GetRandomTriggers () const |
Get the triggers. | |
virtual uint32_t | GetVariable (uint8_t variable, uint32_t parameter, bool &available) const |
Get a variable value. | |
virtual void | StorePSA (uint reg, int32_t value) |
Store a value into the persistent storage area (PSA). | |
Data Fields | |
ResolverObject & | ro |
Surrounding resolver object. | |
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
Multiple of these interfaces are combined into a ResolverObject to allow access to different game entities from a SpriteGroup-chain (action 1-2-3 chain).
Definition at line 282 of file newgrf_spritegroup.h.
|
inline |
Definition at line 285 of file newgrf_spritegroup.h.
|
virtual |
Get a few random bits.
Default implementation has no random bits.
Reimplemented in AirportScopeResolver, AirportTileScopeResolver, CanalScopeResolver, VehicleScopeResolver, HouseScopeResolver, IndustriesScopeResolver, IndustryTileScopeResolver, ObjectScopeResolver, RailTypeScopeResolver, RoadStopScopeResolver, RoadTypeScopeResolver, and StationScopeResolver.
Definition at line 83 of file newgrf_spritegroup.cpp.
Referenced by RandomizedSpriteGroup::Resolve().
|
virtual |
Get the triggers.
Base class returns 0
to prevent trouble.
Reimplemented in VehicleScopeResolver, HouseScopeResolver, IndustriesScopeResolver, IndustryTileScopeResolver, RoadStopScopeResolver, and StationScopeResolver.
Definition at line 92 of file newgrf_spritegroup.cpp.
|
virtual |
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 in AirportScopeResolver, AirportTileScopeResolver, BadgeScopeResolver, CanalScopeResolver, VehicleScopeResolver, GenericScopeResolver, HouseScopeResolver, IndustriesScopeResolver, IndustryTileScopeResolver, ObjectScopeResolver, RailTypeScopeResolver, RoadStopScopeResolver, RoadTypeScopeResolver, StationScopeResolver, and TownScopeResolver.
Definition at line 104 of file newgrf_spritegroup.cpp.
References Debug.
Referenced by FillNewGRFVehicleCache(), NIHVehicle::Resolve(), NIHStation::Resolve(), NIHHouse::Resolve(), NIHIndustryTile::Resolve(), NIHIndustry::Resolve(), NIHObject::Resolve(), NIHRailType::Resolve(), NIHAirportTile::Resolve(), NIHAirport::Resolve(), NIHTown::Resolve(), and NIHRoadType< TRoadTramType >::Resolve().
|
virtual |
Store a value into the persistent storage area (PSA).
Default implementation does nothing (for newgrf classes without storage).
Reimplemented in AirportScopeResolver, IndustriesScopeResolver, and TownScopeResolver.
Definition at line 114 of file newgrf_spritegroup.cpp.
ResolverObject& ScopeResolver::ro |
Surrounding resolver object.
Definition at line 283 of file newgrf_spritegroup.h.
Referenced by AirportScopeResolver::GetVariable(), AirportTileScopeResolver::GetVariable(), VehicleScopeResolver::GetVariable(), GenericScopeResolver::GetVariable(), HouseScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), IndustryTileScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), RailTypeScopeResolver::GetVariable(), RoadStopScopeResolver::GetVariable(), RoadTypeScopeResolver::GetVariable(), StationScopeResolver::GetVariable(), TownScopeResolver::GetVariable(), AirportScopeResolver::StorePSA(), and TownScopeResolver::StorePSA().