OpenTTD
Public Member Functions | Data Fields
HouseScopeResolver Struct Reference

Scope resolver for houses. More...

#include <newgrf_house.h>

Inheritance diagram for HouseScopeResolver:
ScopeResolver

Public Member Functions

 HouseScopeResolver (ResolverObject &ro, HouseID house_id, TileIndex tile, Town *town, bool not_yet_constructed, uint8 initial_random_bits, uint32 watched_cargo_triggers)
 Constructor of a house scope resolver. More...
 
uint32 GetRandomBits () const
 Get a few random bits. More...
 
uint32 GetVariable (byte variable, uint32 parameter, bool *available) const
 
uint32 GetTriggers () const
 Get the triggers. More...
 
- Public Member Functions inherited from ScopeResolver
 ScopeResolver (ResolverObject &ro)
 
virtual void StorePSA (uint reg, int32 value)
 Store a value into the persistent storage area (PSA). More...
 

Data Fields

HouseID house_id
 Type of house being queried.
 
TileIndex tile
 Tile of this house.
 
Towntown
 Town of this house.
 
bool not_yet_constructed
 True for construction check.
 
uint16 initial_random_bits
 Random bits during construction checks.
 
uint32 watched_cargo_triggers
 Cargo types that triggered the watched cargo callback.
 
- Data Fields inherited from ScopeResolver
ResolverObjectro
 Surrounding resolver object.
 

Detailed Description

Scope resolver for houses.

Definition at line 22 of file newgrf_house.h.

Constructor & Destructor Documentation

◆ HouseScopeResolver()

HouseScopeResolver::HouseScopeResolver ( ResolverObject ro,
HouseID  house_id,
TileIndex  tile,
Town town,
bool  not_yet_constructed,
uint8  initial_random_bits,
uint32  watched_cargo_triggers 
)
inline

Constructor of a house scope resolver.

Parameters
roSurrounding resolver.
house_idHouse type being queried.
tileTile containing the house.
townTown containing the house.
not_yet_constructedHouse is still under construction.
initial_random_bitsRandom bits during construction checks.
watched_cargo_triggersCargo types that triggered the watched cargo callback.

Definition at line 40 of file newgrf_house.h.

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

Member Function Documentation

◆ GetRandomBits()

uint32 HouseScopeResolver::GetRandomBits ( ) const
virtual

Get a few random bits.

Default implementation has no random bits.

Returns
Random bits.

Reimplemented from ScopeResolver.

Definition at line 136 of file newgrf_house.cpp.

Referenced by HouseScopeResolver().

◆ GetTriggers()

uint32 HouseScopeResolver::GetTriggers ( ) const
virtual

Get the triggers.

Base class returns 0 to prevent trouble.

Returns
The triggers.

Reimplemented from ScopeResolver.

Definition at line 143 of file newgrf_house.cpp.

Referenced by HouseScopeResolver().

◆ GetVariable()

uint32 HouseScopeResolver::GetVariable ( byte  variable,
uint32  parameter,
bool *  available 
) const
virtual
Note
Used by the resolver to get values for feature 07 deterministic spritegroups.

Reimplemented from ScopeResolver.

Definition at line 290 of file newgrf_house.cpp.

References GetHouseAge(), GetHouseBuildingStage(), GetTerrainType(), GetTownRadiusGroup(), IsTileType(), MP_HOUSE, TileHash2Bit(), TileX(), and TileY().

Referenced by HouseScopeResolver().


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