OpenTTD Source 20260208-master-g43af8e94d0
IndustriesScopeResolver Struct Reference

Resolver for industry scopes. More...

#include <newgrf_industries.h>

Inheritance diagram for IndustriesScopeResolver:
ScopeResolver

Public Member Functions

 IndustriesScopeResolver (ResolverObject &ro, TileIndex tile, Industry *industry, IndustryType type, uint32_t random_bits=0)
 Scope resolver for industries.
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.
void StorePSA (uint pos, int32_t value) override
 Store a value into the persistent storage area (PSA).
Public Member Functions inherited from ScopeResolver
 ScopeResolver (ResolverObject &ro)

Data Fields

TileIndex tile
 Tile owned by the industry.
Industryindustry
 Industry being resolved.
IndustryType type
 Type of the industry.
uint32_t random_bits
 Random bits of the new industry.
Data Fields inherited from ScopeResolver
ResolverObjectro
 Surrounding resolver object.

Detailed Description

Resolver for industry scopes.

Definition at line 16 of file newgrf_industries.h.

Constructor & Destructor Documentation

◆ IndustriesScopeResolver()

IndustriesScopeResolver::IndustriesScopeResolver ( ResolverObject & ro,
TileIndex tile,
Industry * industry,
IndustryType type,
uint32_t random_bits = 0 )
inline

Scope resolver for industries.

Parameters
roSurrounding resolver.
tileTile owned by the industry.
industryIndustry being resolved.
typeType of the industry.
random_bitsRandom bits of the new industry.

Definition at line 30 of file newgrf_industries.h.

References industry, random_bits, ScopeResolver::ro, tile, and type.

Member Function Documentation

◆ GetRandomBits()

uint32_t IndustriesScopeResolver::GetRandomBits ( ) const
overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 430 of file newgrf_industries.cpp.

References industry.

◆ GetRandomTriggers()

uint32_t IndustriesScopeResolver::GetRandomTriggers ( ) const
overridevirtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented from ScopeResolver.

Definition at line 435 of file newgrf_industries.cpp.

◆ GetVariable()

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

◆ StorePSA()

void IndustriesScopeResolver::StorePSA ( uint pos,
int32_t value )
overridevirtual

Store a value into the persistent storage area (PSA).

Default implementation does nothing (for newgrf classes without storage).

Parameters
posThe position into the storage area.
valueThe new value to store.

Reimplemented from ScopeResolver.

Definition at line 440 of file newgrf_industries.cpp.

References GetIndustrySpec(), IndustrySpec::grf_prop, GRFFilePropsBase::grfid, and industry.

Field Documentation

◆ industry

Industry* IndustriesScopeResolver::industry

Industry being resolved.

Definition at line 18 of file newgrf_industries.h.

Referenced by GetRandomBits(), GetVariable(), IndustriesScopeResolver(), and StorePSA().

◆ random_bits

uint32_t IndustriesScopeResolver::random_bits

Random bits of the new industry.

Definition at line 20 of file newgrf_industries.h.

Referenced by GetVariable(), and IndustriesScopeResolver().

◆ tile

TileIndex IndustriesScopeResolver::tile

Tile owned by the industry.

Definition at line 17 of file newgrf_industries.h.

Referenced by GetVariable(), and IndustriesScopeResolver().

◆ type

IndustryType IndustriesScopeResolver::type

Type of the industry.

Definition at line 19 of file newgrf_industries.h.

Referenced by GetVariable(), and IndustriesScopeResolver().


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