OpenTTD Source 20250312-master-gcdcc6b491d
|
Resolver for a vehicle scope. More...
#include <newgrf_engine.h>
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. | |
![]() | |
ScopeResolver (ResolverObject &ro) | |
virtual void | StorePSA (uint reg, int32_t value) |
Store a value into the persistent storage area (PSA). | |
Data Fields | |
const struct Vehicle * | v |
The vehicle being resolved. | |
EngineID | self_type |
Type of the vehicle. | |
bool | rotor_in_gui |
Helicopter rotor is drawn in GUI. | |
![]() | |
ResolverObject & | ro |
Surrounding resolver object. | |
Resolver for a vehicle scope.
Definition at line 22 of file newgrf_engine.h.
|
inline |
Scope resolver of a single vehicle.
ro | Surrounding resolver. |
engine_type | Engine type |
v | Vehicle being resolved. |
rotor_in_gui | Helicopter rotor is drawn in GUI. |
Definition at line 34 of file newgrf_engine.h.
|
overridevirtual |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 307 of file newgrf_engine.cpp.
References Vehicle::random_bits.
|
overridevirtual |
Get the triggers.
Base class returns 0
to prevent trouble.
Reimplemented from ScopeResolver.
Definition at line 312 of file newgrf_engine.cpp.
References Vehicle::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 961 of file newgrf_engine.cpp.
References _current_company, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), GRFFile::cargo_map, Clamp(), CargoSpec::classes, TimerGameCalendar::date, TimerGameConst< struct Calendar >::DAYS_TILL_ORIGINAL_BASE_YEAR, GB(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_engine_pool >::Get(), CargoSpec::Get(), GetBadgeVariableResult(), GetCompanyInfo(), Engine::GetDefaultCargoType(), ResolverObject::grffile, IsValidCargoType(), LiveryHelper(), TimerGameConst< struct Calendar >::ORIGINAL_BASE_YEAR, TimerGameConst< struct Calendar >::ORIGINAL_MAX_YEAR, ScopeResolver::ro, self_type, CargoSpec::weight, and TimerGameCalendar::year.
|
inline |
Definition at line 39 of file newgrf_engine.h.
bool VehicleScopeResolver::rotor_in_gui |
Helicopter rotor is drawn in GUI.
Definition at line 25 of file newgrf_engine.h.
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().
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().