OpenTTD Source: IndustryTileScopeResolver Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
IndustryTileScopeResolver Struct Reference

Resolver for the industry tiles scope. More...

`#include <newgrf_industrytiles.h>`

Inheritance diagram for IndustryTileScopeResolver:

## Public Member Functions
| IndustryTileScopeResolver (ResolverObject &ro, Industry *industry, TileIndex tile)
| Constructor of the scope resolver for the industry tile.
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.
uint32_t | GetRandomTriggers () const override
| Get the triggers.
Public Member Functions inherited from ScopeResolver
| ScopeResolver (ResolverObject &ro)
virtual void | StorePSA (uint reg, int32_t value)
| Store a value into the persistent storage area (PSA).

## Data Fields
Industry * | industry
| Industry owning the tiles.
TileIndex | tile
| Tile being resolved.
Data Fields inherited from ScopeResolver
ResolverObject & | ro
| Surrounding resolver object.

## Detailed Description

Resolver for the industry tiles scope.

Definition at line 17 of file newgrf_industrytiles.h.

## Constructor & Destructor Documentation

## ◆ IndustryTileScopeResolver()

IndustryTileScopeResolver::IndustryTileScopeResolver | ( | ResolverObject & | ro,
|  | Industry * | industry,
|  | TileIndex | tile
| ) |  |
| inline

Constructor of the scope resolver for the industry tile.

Parameters

  ro | Surrounding resolver.
  industry | Industry owning the tile.
  tile | Tile of the industry.

Definition at line 27 of file newgrf_industrytiles.h.

## Member Function Documentation

## ◆ GetRandomBits()

uint32_t IndustryTileScopeResolver::GetRandomBits | ( |  | ) | const
| overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
  Random bits.

Reimplemented from ScopeResolver.

Definition at line 105 of file newgrf_industrytiles.cpp.

References GetIndustryRandomBits(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, industry, IsTileType(), IsValidTile(), MP_INDUSTRY, and tile.

## ◆ GetRandomTriggers()

uint32_t IndustryTileScopeResolver::GetRandomTriggers | ( |  | ) | const
| overridevirtual

Get the triggers.

Base class returns `0` to prevent trouble.

Returns
  The triggers.

Reimplemented from ScopeResolver.

Definition at line 113 of file newgrf_industrytiles.cpp.

References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), GetIndustryRandomTriggers(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, industry, IsTileType(), IsValidTile(), MP_INDUSTRY, and tile.

## ◆ GetVariable()

uint32_t IndustryTileScopeResolver::GetVariable | ( | uint8_t | variable,
|  | uint32_t | parameter,
|  | bool & | available
| ) |  | const
| overridevirtual

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 62 of file newgrf_industrytiles.cpp.

References ClosestTownFromTile(), Debug, GetAnimationFrame(), GetBadgeVariableResult(), Industry::GetByTile(), GetIndustryConstructionStage(), GetIndustryGfx(), GetIndustryIDAtOffset(), GetIndustryTileSpec(), GetNearbyIndustryTileInformation(), GetNearbyTile(), GetRelativePosition(), GetTerrainType(), GetTownRadiusGroup(), ResolverObject::grffile, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, industry, IsTileType(), Industry::location, MP_INDUSTRY, ScopeResolver::ro, tile, OrthogonalTileArea::tile, and to_underlying().

## Field Documentation

## ◆ industry

Industry* IndustryTileScopeResolver::industry

Industry owning the tiles.

Definition at line 18 of file newgrf_industrytiles.h.

Referenced by GetRandomBits(), GetRandomTriggers(), and GetVariable().

## ◆ tile

TileIndex IndustryTileScopeResolver::tile

Tile being resolved.

Definition at line 19 of file newgrf_industrytiles.h.

Referenced by GetRandomBits(), GetRandomTriggers(), and GetVariable().

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

- src/newgrf_industrytiles.h
- src/newgrf_industrytiles.cpp