OpenTTD Source: HouseScopeResolver Struct Reference

OpenTTD Source 14.0-beta3

Public Member Functions | Data Fields
HouseScopeResolver Struct Reference

Scope resolver for houses. More...

`#include <newgrf_house.h>`

Inheritance diagram for HouseScopeResolver:

## Public Member Functions
| HouseScopeResolver (ResolverObject &ro, HouseID house_id, TileIndex tile, Town *town, bool not_yet_constructed, uint8_t initial_random_bits, CargoTypes watched_cargo_triggers)
| Constructor of a house scope resolver. More...
uint32_t | GetRandomBits () const override
| Get a few random bits. More...
uint32_t | GetVariable (byte variable, [[maybe_unused]] uint32_t parameter, bool *available) const override
uint32_t | GetTriggers () const override
| Get the triggers. More...
Public Member Functions inherited from ScopeResolver
| ScopeResolver (ResolverObject &ro)
virtual void | StorePSA (uint reg, int32_t 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.
Town * | town
| Town of this house.
bool | not_yet_constructed
| True for construction check.
uint16_t | initial_random_bits
| Random bits during construction checks.
CargoTypes | watched_cargo_triggers
| Cargo types that triggered the watched cargo callback.
Data Fields inherited from ScopeResolver
ResolverObject & | ro
| Surrounding resolver object.

## Detailed Description

Scope resolver for houses.

Definition at line 20 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_t | initial_random_bits,
|  | CargoTypes | watched_cargo_triggers
| ) |  |
| inline

Constructor of a house scope resolver.

Parameters

  ro | Surrounding resolver.
  house_id | House 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 38 of file newgrf_house.h.

## Member Function Documentation

## ◆ GetRandomBits()

uint32_t HouseScopeResolver::GetRandomBits | ( |  | ) | const
| overridevirtual

Get a few random bits.

Default implementation has no random bits.

Returns
  Random bits.

Reimplemented from ScopeResolver.

Definition at line 144 of file newgrf_house.cpp.

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

## ◆ GetTriggers()

uint32_t HouseScopeResolver::GetTriggers | ( |  | ) | const
| overridevirtual

Get the triggers.

Base class returns `0` to prevent trouble.

Returns
  The triggers.

Reimplemented from ScopeResolver.

Definition at line 151 of file newgrf_house.cpp.

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

## ◆ GetVariable()

uint32_t HouseScopeResolver::GetVariable | ( | byte | variable,
|  | [[maybe_unused] ] uint32_t | parameter,
|  | bool * | available
| ) |  | const
| overridevirtual

Note
  Used by the resolver to get values for feature 07 deterministic spritegroups.

Reimplemented from ScopeResolver.

Definition at line 297 of file newgrf_house.cpp.

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

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

- src/newgrf_house.h
- src/newgrf_house.cpp