OpenTTD Source 20260917-master-gec444f7315
IndustryTileScopeResolver Struct Reference

Resolver for the industry tiles scope. More...

#include <newgrf_industrytiles.h>

Inheritance diagram for IndustryTileScopeResolver:
ScopeResolver

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 ~ScopeResolver ()=default
 Ensure the destructor of the sub classes are called as well.
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
roSurrounding resolver.
industryIndustry owning the tile.
tileTile of the industry.

Definition at line 27 of file newgrf_industrytiles.h.

References industry, ScopeResolver::ro, and tile.

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

References GetIndustryRandomBits(), Industry, industry, IsTileType(), IsValidTile(), 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 114 of file newgrf_industrytiles.cpp.

References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), GetIndustryRandomTriggers(), Industry, industry, IsTileType(), IsValidTile(), 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
variableVariable to read
parameterParameter for 60+x variables
[out]availableSet to false, in case the variable does not exist.
Returns
Value

Reimplemented from ScopeResolver.

Definition at line 63 of file newgrf_industrytiles.cpp.

References ClosestTownFromTile(), Debug, Error, GetAnimationFrame(), GetBadgeVariableResult(), Industry::GetByTile(), GetIndustryConstructionStage(), GetIndustryGfx(), GetIndustryIDAtOffset(), GetIndustryTileSpec(), GetNearbyIndustryTileInformation(), GetNearbyTile(), GetRelativePosition(), GetTerrainType(), GetTownRadiusGroup(), Grf, Industry, industry, IsTileType(), ScopeResolver::ro, 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(), GetVariable(), and IndustryTileScopeResolver().

◆ tile

TileIndex IndustryTileScopeResolver::tile

Tile being resolved.

Definition at line 19 of file newgrf_industrytiles.h.

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


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