OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
ObjectScopeResolver Struct Reference

Object scope resolver. More...

`#include <newgrf_object.h>`

Inheritance diagram for ObjectScopeResolver:

## Public Member Functions
| ObjectScopeResolver (ResolverObject &ro, Object *obj, TileIndex tile, uint8 view=0)
| Constructor of an object scope resolver.
uint32 | GetRandomBits () const
| Get a few random bits.
uint32 | GetVariable (byte variable, uint32 parameter, bool *available) const
| Used by the resolver to get values for feature 0F deterministic spritegroups.
Public Member Functions inherited from ScopeResolver
| ScopeResolver (ResolverObject &ro)
virtual uint32 | GetTriggers () const
| Get the triggers.
virtual void | StorePSA (uint reg, int32 value)
| Store a value into the persistent storage area (PSA).

## Data Fields
struct Object * | obj
| The object the callback is ran for.
TileIndex | tile
| The tile related to the object.
uint8 | view
| The view of the object.
Data Fields inherited from ScopeResolver
ResolverObject & | ro
| Surrounding resolver object.

## Detailed Description

Object scope resolver.

Definition at line 102 of file newgrf_object.h.

## Constructor & Destructor Documentation

ObjectScopeResolver::ObjectScopeResolver | ( | ResolverObject & | ro,
|  | Object * | obj,
|  | TileIndex | tile,
|  | uint8 | view = `0`
| ) |  |

Constructor of an object scope resolver.

Parameters

  ro | Surrounding resolver.
  obj | Object being resolved.
  tile | Tile of the object.
  view | View of the object.

Definition at line 138 of file newgrf_object.cpp.

## Member Function Documentation

uint32 ObjectScopeResolver::GetRandomBits | ( |  | ) | const
| virtual

Get a few random bits.

Default implementation has no random bits.

Returns
  Random bits.

Reimplemented from ScopeResolver.

Definition at line 146 of file newgrf_object.cpp.

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

uint32 ObjectScopeResolver::GetVariable | ( | byte | variable,
|  | uint32 | parameter,
|  | bool * | available
| ) |  | const
| virtual

Used by the resolver to get values for feature 0F deterministic spritegroups.

Reimplemented from ScopeResolver.

Definition at line 249 of file newgrf_object.cpp.

References _current_company, _date, Object::build_date, ClosestTownFromTile(), Object::colour, DEBUG, DistanceManhattan(), DistanceSquare(), GetAnimationFrame(), Object::GetByTile(), GetCountAndDistanceOfClosestInstance(), GetNearbyObjectTileInformation(), GetNearbyTile(), GetObjectIDAtOffset(), GetObjectRandomBits(), GetTerrainType(), GetTileOwner(), GetTileSlope(), GetTownRadiusGroup(), ResolverObject::grffile, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_OBJECT, IsTileType(), IsValidTile(), Object::location, min(), MP_OBJECT, obj, ScopeResolver::ro, OrthogonalTileArea::tile, tile, TileX(), TileY(), Object::town, Object::view, view, and Town::xy.

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

- src/newgrf_object.h
- src/newgrf_object.cpp