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.
uint32 GetRandomBits () const
 Get a few random bits.
uint32 GetVariable (byte variable, uint32 parameter, bool *available) const
uint32 GetTriggers () const
 Get the triggers.
void SetTriggers (int triggers) const
 Set the triggers.

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.

Detailed Description

Scope resolver for houses.

Definition at line 22 of file newgrf_house.h.


Constructor & Destructor Documentation

HouseScopeResolver::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.

Parameters:
ro Surrounding resolver.
house_id Houe type being queried.
tile Tile containing the house.
town Town containing the house.
not_yet_constructed House is still under construction.
initial_random_bits Random bits during construction checks.
watched_cargo_triggers Cargo types that triggered the watched cargo callback.

Definition at line 42 of file newgrf_house.cpp.


Member Function Documentation

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 155 of file newgrf_house.cpp.

References GetHouseRandomBits(), initial_random_bits, IsTileType(), IsValidTile(), MP_HOUSE, not_yet_constructed, and tile.

uint32 HouseScopeResolver::GetTriggers (  )  const [virtual]

Get the triggers.

Base class returns 0 to prevent trouble.

Returns:
The triggers.

Reimplemented from ScopeResolver.

Definition at line 162 of file newgrf_house.cpp.

References GetHouseTriggers(), IsTileType(), IsValidTile(), MP_HOUSE, not_yet_constructed, and tile.

void HouseScopeResolver::SetTriggers ( int  triggers  )  const [virtual]

Set the triggers.

Base class implementation does nothing.

Parameters:
triggers Triggers to set.

Reimplemented from ScopeResolver.

Definition at line 169 of file newgrf_house.cpp.

References IsTileType(), IsValidTile(), MP_HOUSE, not_yet_constructed, SetHouseTriggers(), and tile.


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