OpenTTD
|
Resolver for industry scopes. More...
#include <newgrf_industries.h>
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... | |
![]() | |
ScopeResolver (ResolverObject &ro) | |
Data Fields | |
TileIndex | tile |
Tile owned by the industry. | |
Industry * | industry |
Industry being resolved. | |
IndustryType | type |
Type of the industry. | |
uint32 | random_bits |
Random bits of the new industry. | |
![]() | |
ResolverObject & | ro |
Surrounding resolver object. | |
Resolver for industry scopes.
Definition at line 18 of file newgrf_industries.h.
|
inline |
Scope resolver for industries.
ro | Surrounding resolver. |
tile | Tile owned by the industry. |
industry | Industry being resolved. |
type | Type of the industry. |
random_bits | Random bits of the new industry. |
Definition at line 32 of file newgrf_industries.h.
References GetRandomBits(), GetTriggers(), GetVariable(), and StorePSA().
|
virtual |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 376 of file newgrf_industries.cpp.
References industry, and Industry::random.
Referenced by IndustriesScopeResolver().
|
virtual |
Get the triggers.
Base class returns 0
to prevent trouble.
Reimplemented from ScopeResolver.
Definition at line 381 of file newgrf_industries.cpp.
Referenced by IndustriesScopeResolver().
|
virtual |
Get a variable value.
Default implementation has no available variables.
variable | Variable to read | |
parameter | Parameter for 60+x variables | |
[out] | available | Set to false, in case the variable does not exist. |
Reimplemented from ScopeResolver.
Definition at line 162 of file newgrf_industries.cpp.
References IndustrySpec::behaviour, ResolverObject::callback, IndustrySpec::callback_mask, CBID_INDUSTRY_LOCATION, CBM_IND_PRODUCTION_256_TICKS, CBM_IND_PRODUCTION_CARGO_ARRIVAL, Clamp(), DEBUG, DistanceManhattan(), DistanceSquare(), Industry::founder, GB(), GetClosestWaterDistance(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), GetIndustrySpec(), GetTerrainType(), GetTileZ(), GetTownRadiusGroup(), ResolverObject::grffile, HasBit(), Industry::incoming_cargo_waiting, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, industry, INDUSTRYBEH_BUILT_ONWATER, INDUSTRYBEH_PROD_MULTI_HNDLING, INVALID_TILE, min(), Industry::prod_level, random_bits, ScopeResolver::ro, Industry::selected_layout, tile, TILE_HEIGHT, Industry::town, type, Industry::type, and Town::xy.
Referenced by IndustriesScopeResolver().
|
virtual |
Store a value into the persistent storage area (PSA).
Default implementation does nothing (for newgrf classes without storage).
pos | Position to store into. |
value | Value 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().