|
OpenTTD Source 20260311-master-g511d3794ce
|
Object scope resolver. More...
#include <newgrf_object.h>
Public Member Functions | |
| ObjectScopeResolver (ResolverObject &ro, Object *obj, const ObjectSpec *spec, TileIndex tile, uint8_t view=0) | |
| Constructor of an object scope resolver. | |
| 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. | |
| Public Member Functions inherited from ScopeResolver | |
| ScopeResolver (ResolverObject &ro) | |
| virtual | ~ScopeResolver ()=default |
| Ensure the destructor of the sub classes are called as well. | |
| virtual uint32_t | GetRandomTriggers () const |
| Get the triggers. | |
| virtual void | StorePSA (uint reg, int32_t value) |
| Store a value into the persistent storage area (PSA). | |
Data Fields | |
| struct Object * | obj |
| The object the callback is ran for. | |
| const ObjectSpec * | spec |
| Specification of the object type. | |
| TileIndex | tile |
| The tile related to the object. | |
| uint8_t | view |
| The view of the object. | |
| Data Fields inherited from ScopeResolver | |
| ResolverObject & | ro |
| Surrounding resolver object. | |
Object scope resolver.
Definition at line 106 of file newgrf_object.h.
|
inline |
|
overridevirtual |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 159 of file newgrf_object.cpp.
References GetObjectRandomBits(), IsTileType(), IsValidTile(), Object, and tile.
|
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 261 of file newgrf_object.cpp.
References _current_company, ClampTo(), ClosestTownFromTile(), TimerGameCalendar::date, Debug, DistanceManhattan(), DistanceSquare(), GetAnimationFrame(), GetBadgeVariableResult(), Object::GetByTile(), GetCountAndDistanceOfClosestInstance(), GetNearbyObjectTileInformation(), GetNearbyTile(), GetObjectIDAtOffset(), GetObjectRandomBits(), GetTerrainType(), GetTileOwner(), GetTileSlope(), GetTownRadiusGroup(), IsTileType(), IsValidTile(), obj, Object, ScopeResolver::ro, tile, TileX(), TileY(), to_underlying(), view, and Town::xy.
| struct Object* ObjectScopeResolver::obj |
The object the callback is ran for.
Definition at line 107 of file newgrf_object.h.
Referenced by GetVariable(), and ObjectScopeResolver().
| const ObjectSpec* ObjectScopeResolver::spec |
Specification of the object type.
Definition at line 108 of file newgrf_object.h.
Referenced by ObjectScopeResolver().
| TileIndex ObjectScopeResolver::tile |
The tile related to the object.
Definition at line 109 of file newgrf_object.h.
Referenced by GetRandomBits(), GetVariable(), and ObjectScopeResolver().
| uint8_t ObjectScopeResolver::view |
The view of the object.
Definition at line 110 of file newgrf_object.h.
Referenced by GetVariable(), and ObjectScopeResolver().