OpenTTD Source  20241108-master-g80f628063a
ObjectScopeResolver Struct Reference

Object scope resolver. More...

#include <newgrf_object.h>

Inheritance diagram for ObjectScopeResolver:
ScopeResolver

Public Member Functions

 ObjectScopeResolver (ResolverObject &ro, Object *obj, const ObjectSpec *spec, TileIndex tile, uint8_t view=0)
 Constructor of an object scope resolver. More...
 
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
 Used by the resolver to get values for feature 0F deterministic spritegroups.
 
- Public Member Functions inherited from ScopeResolver
 ScopeResolver (ResolverObject &ro)
 
virtual uint32_t GetTriggers () const
 Get the triggers. More...
 
virtual void StorePSA (uint reg, int32_t value)
 Store a value into the persistent storage area (PSA). More...
 

Data Fields

struct Objectobj
 The object the callback is ran for.
 
const ObjectSpecspec
 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
ResolverObjectro
 Surrounding resolver object.
 

Detailed Description

Object scope resolver.

Definition at line 110 of file newgrf_object.h.

Constructor & Destructor Documentation

◆ ObjectScopeResolver()

ObjectScopeResolver::ObjectScopeResolver ( ResolverObject ro,
Object obj,
const ObjectSpec spec,
TileIndex  tile,
uint8_t  view = 0 
)
inline

Constructor of an object scope resolver.

Parameters
roSurrounding resolver.
objObject being resolved.
tileTile of the object.
viewView of the object.

Definition at line 123 of file newgrf_object.h.

Member Function Documentation

◆ GetRandomBits()

uint32_t ObjectScopeResolver::GetRandomBits ( ) const
overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 155 of file newgrf_object.cpp.

References GetObjectRandomBits(), IsTileType(), IsValidTile(), MP_OBJECT, and tile.


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