OpenTTD Source 20241224-master-gf74b0cf984
VehicleScopeResolver Struct Reference

Resolver for a vehicle scope. More...

#include <newgrf_engine.h>

Inheritance diagram for VehicleScopeResolver:
ScopeResolver

Public Member Functions

 VehicleScopeResolver (ResolverObject &ro, EngineID engine_type, const Vehicle *v, bool rotor_in_gui)
 Scope resolver of a single vehicle.
 
void SetVehicle (const Vehicle *v)
 
uint32_t GetRandomBits () const override
 Get a few random bits.
 
uint32_t GetVariable (uint8_t variable, uint32_t parameter, bool &available) const override
 Get a variable value.
 
uint32_t GetTriggers () const override
 Get the triggers.
 
- 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).
 

Data Fields

const struct Vehiclev
 The vehicle being resolved.
 
EngineID self_type
 Type of the vehicle.
 
bool rotor_in_gui
 Helicopter rotor is drawn in GUI.
 
- Data Fields inherited from ScopeResolver
ResolverObjectro
 Surrounding resolver object.
 

Detailed Description

Resolver for a vehicle scope.

Definition at line 22 of file newgrf_engine.h.

Constructor & Destructor Documentation

◆ VehicleScopeResolver()

VehicleScopeResolver::VehicleScopeResolver ( ResolverObject ro,
EngineID  engine_type,
const Vehicle v,
bool  rotor_in_gui 
)
inline

Scope resolver of a single vehicle.

Parameters
roSurrounding resolver.
engine_typeEngine type
vVehicle being resolved.
rotor_in_guiHelicopter rotor is drawn in GUI.

Definition at line 34 of file newgrf_engine.h.

Member Function Documentation

◆ GetRandomBits()

uint32_t VehicleScopeResolver::GetRandomBits ( ) const
overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 308 of file newgrf_engine.cpp.

References Vehicle::random_bits.

◆ GetTriggers()

uint32_t VehicleScopeResolver::GetTriggers ( ) const
overridevirtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented from ScopeResolver.

Definition at line 313 of file newgrf_engine.cpp.

References Vehicle::waiting_triggers.

◆ GetVariable()

uint32_t VehicleScopeResolver::GetVariable ( uint8_t  variable,
uint32_t  parameter,
bool &  available 
) const
overridevirtual

◆ SetVehicle()

void VehicleScopeResolver::SetVehicle ( const Vehicle v)
inline

Definition at line 39 of file newgrf_engine.h.

Field Documentation

◆ rotor_in_gui

bool VehicleScopeResolver::rotor_in_gui

Helicopter rotor is drawn in GUI.

Definition at line 25 of file newgrf_engine.h.

◆ self_type

EngineID VehicleScopeResolver::self_type

Type of the vehicle.

Definition at line 24 of file newgrf_engine.h.

Referenced by VehicleResolverObject::GetDebugID(), VehicleResolverObject::GetFeature(), and GetVariable().

◆ v

const struct Vehicle* VehicleScopeResolver::v

The vehicle being resolved.

Definition at line 23 of file newgrf_engine.h.

Referenced by VehicleResolverObject::GetScope(), and VehicleResolverObject::ResolveReal().


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