OpenTTD Source  20241121-master-g67a0fccfad
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. More...
 
void SetVehicle (const Vehicle *v)
 
uint32_t GetRandomBits () const override
 Get a few random bits. More...
 
uint32_t GetVariable (uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const override
 Get a variable value. More...
 
uint32_t GetTriggers () const override
 Get the triggers. More...
 
- 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). More...
 

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 307 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 312 of file newgrf_engine.cpp.

References Vehicle::waiting_triggers.

◆ GetVariable()

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

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