OpenTTD Source: RoadTypeScopeResolver Struct Reference

OpenTTD Source 12.0-beta1

Public Member Functions | Data Fields
RoadTypeScopeResolver Struct Reference

Resolver for the railtype scope. More...

`#include <newgrf_roadtype.h>`

Inheritance diagram for RoadTypeScopeResolver:

## Public Member Functions
| RoadTypeScopeResolver (ResolverObject &ro, const RoadTypeInfo *rti, TileIndex tile, TileContext context)
| Constructor of the roadtype scope resolvers. More...
uint32 | GetRandomBits () const
| Get a few random bits. More...
uint32 | GetVariable (byte variable, uint32 parameter, bool *available) const
| Get a variable value. More...
Public Member Functions inherited from ScopeResolver
| ScopeResolver (ResolverObject &ro)
virtual uint32 | GetTriggers () const
| Get the triggers. More...
virtual void | StorePSA (uint reg, int32 value)
| Store a value into the persistent storage area (PSA). More...

## Data Fields
TileIndex | tile
| Tracktile. For track on a bridge this is the southern bridgehead.
TileContext | context
| Are we resolving sprites for the upper halftile, or on a bridge?
const RoadTypeInfo * | rti
Data Fields inherited from ScopeResolver
ResolverObject & | ro
| Surrounding resolver object.

## Detailed Description

Resolver for the railtype scope.

Definition at line 18 of file newgrf_roadtype.h.

## Constructor & Destructor Documentation

## ◆ RoadTypeScopeResolver()

RoadTypeScopeResolver::RoadTypeScopeResolver | ( | ResolverObject & | ro,
|  | const RoadTypeInfo * | rti,
|  | TileIndex | tile,
|  | TileContext | context
| ) |  |

Constructor of the roadtype scope resolvers.

Parameters

  ro | Surrounding resolver.
  tile | Tile containing the track. For track on a bridge this is the southern bridgehead.
  context | Are we resolving sprites for the upper halftile, or on a bridge?

Definition at line 82 of file newgrf_roadtype.cpp.

References context, and tile.

## Member Function Documentation

## ◆ GetRandomBits()

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

Get a few random bits.

Default implementation has no random bits.

Returns
  Random bits.

Reimplemented from ScopeResolver.

Definition at line 19 of file newgrf_roadtype.cpp.

References CountBits(), GB(), tile, TILE_SIZE, TileX(), and TileY().

## ◆ GetVariable()

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

Get a variable value.

Default implementation has no available variables.

Parameters

  | variable | Variable to read
  | parameter | Parameter for 60+x variables
  [out] | available | Set to false, in case the variable does not exist.

Returns
  Value

Reimplemented from ScopeResolver.

Definition at line 25 of file newgrf_roadtype.cpp.

References _date, INVALID_TILE, and tile.

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

- src/newgrf_roadtype.h
- src/newgrf_roadtype.cpp