OpenTTD Source 20260206-master-g4d4e37dbf1
ScopeResolver Struct Reference

Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope). More...

#include <newgrf_spritegroup.h>

Inheritance diagram for ScopeResolver:
AirportScopeResolver AirportTileScopeResolver BadgeScopeResolver CanalScopeResolver GenericScopeResolver HouseScopeResolver IndustriesScopeResolver IndustryTileScopeResolver ObjectScopeResolver RailTypeScopeResolver RoadStopScopeResolver RoadTypeScopeResolver StationScopeResolver TownScopeResolver VehicleScopeResolver

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

ResolverObjectro
 Surrounding resolver object.

Detailed Description

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 295 of file newgrf_spritegroup.h.

Constructor & Destructor Documentation

◆ ScopeResolver()

ScopeResolver::ScopeResolver ( ResolverObject & ro)
inline

Definition at line 298 of file newgrf_spritegroup.h.

Member Function Documentation

◆ GetRandomBits()

uint32_t ScopeResolver::GetRandomBits ( ) const
virtual

◆ GetRandomTriggers()

uint32_t ScopeResolver::GetRandomTriggers ( ) const
virtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented in HouseScopeResolver, IndustriesScopeResolver, IndustryTileScopeResolver, RoadStopScopeResolver, StationScopeResolver, and VehicleScopeResolver.

Definition at line 92 of file newgrf_spritegroup.cpp.

◆ GetVariable()

uint32_t ScopeResolver::GetVariable ( uint8_t variable,
uint32_t parameter,
bool & available ) const
virtual

◆ StorePSA()

void ScopeResolver::StorePSA ( uint pos,
int32_t value )
virtual

Store a value into the persistent storage area (PSA).

Default implementation does nothing (for newgrf classes without storage).

Parameters
posThe position into the storage area.
valueThe new value to store.

Reimplemented in AirportScopeResolver, IndustriesScopeResolver, and TownScopeResolver.

Definition at line 116 of file newgrf_spritegroup.cpp.

Field Documentation

◆ ro


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