OpenTTD
Public Member Functions | Data Fields
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 random_bits=0)
 Scope resolver for industries. More...
 
uint32 GetRandomBits () const
 Get a few random bits. More...
 
uint32 GetVariable (byte variable, uint32 parameter, bool *available) const
 Get a variable value. More...
 
uint32 GetTriggers () const
 Get the triggers. More...
 
void StorePSA (uint pos, int32 value)
 Store a value into the persistent storage area (PSA). More...
 
- 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 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 18 of file newgrf_industries.h.

Constructor & Destructor Documentation

◆ IndustriesScopeResolver()

IndustriesScopeResolver::IndustriesScopeResolver ( ResolverObject ro,
TileIndex  tile,
Industry industry,
IndustryType  type,
uint32  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 32 of file newgrf_industries.h.

References GetRandomBits(), GetTriggers(), GetVariable(), and StorePSA().

Member Function Documentation

◆ GetRandomBits()

uint32 IndustriesScopeResolver::GetRandomBits ( ) const
virtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 376 of file newgrf_industries.cpp.

References industry, and Industry::random.

Referenced by IndustriesScopeResolver().

◆ GetTriggers()

uint32 IndustriesScopeResolver::GetTriggers ( ) const
virtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented from ScopeResolver.

Definition at line 381 of file newgrf_industries.cpp.

Referenced by IndustriesScopeResolver().

◆ GetVariable()

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

◆ StorePSA()

void IndustriesScopeResolver::StorePSA ( uint  reg,
int32  value 
)
virtual

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

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

Parameters
posPosition to store into.
valueValue to store.

Reimplemented from ScopeResolver.

Definition at line 386 of file newgrf_industries.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, and industry.

Referenced by IndustriesScopeResolver().


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