OpenTTD
|
Resolver for a vehicle scope. More...
#include <newgrf_engine.h>
Public Member Functions | |
VehicleScopeResolver (ResolverObject &ro, EngineID engine_type, const Vehicle *v, bool info_view) | |
Scope resolver of a single vehicle. More... | |
void | SetVehicle (const Vehicle *v) |
uint32 | GetRandomBits () const |
Get a few random bits. More... | |
uint32 | GetVariable (byte variable, uint32 parameter, bool *available) const |
Get a variable value. More... | |
uint32 | GetTriggers () const |
Get the triggers. More... | |
![]() | |
ScopeResolver (ResolverObject &ro) | |
virtual void | StorePSA (uint reg, int32 value) |
Store a value into the persistent storage area (PSA). More... | |
Data Fields | |
const struct Vehicle * | v |
The vehicle being resolved. | |
EngineID | self_type |
Type of the vehicle. | |
bool | info_view |
Indicates if the item is being drawn in an info window. | |
![]() | |
ResolverObject & | ro |
Surrounding resolver object. | |
Resolver for a vehicle scope.
Definition at line 24 of file newgrf_engine.h.
|
inline |
Scope resolver of a single vehicle.
ro | Surrounding resolver. |
engine_type | Engine type |
v | Vehicle being resolved. |
info_view | Indicates if the item is being drawn in an info window. |
Definition at line 36 of file newgrf_engine.h.
References GetRandomBits(), GetTriggers(), GetVariable(), and v.
|
virtual |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 340 of file newgrf_engine.cpp.
References Vehicle::random_bits.
Referenced by VehicleScopeResolver().
|
virtual |
Get the triggers.
Base class returns 0
to prevent trouble.
Reimplemented from ScopeResolver.
Definition at line 345 of file newgrf_engine.cpp.
References Vehicle::waiting_triggers.
Referenced by VehicleScopeResolver().
|
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 from ScopeResolver.
Definition at line 883 of file newgrf_engine.cpp.
References _cur_year, _current_company, _date, Clamp(), CargoSpec::classes, CT_INVALID, DAYS_TILL_ORIGINAL_BASE_YEAR, GB(), CargoSpec::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), GetCompanyInfo(), Engine::GetDefaultCargoType(), INVALID_VEHICLE, LiveryHelper(), ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR, and CargoSpec::weight.
Referenced by VehicleScopeResolver().