OpenTTD Source: HouseScopeResolver Struct Reference

OpenTTD Source 15.3

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, int view)
| Constructor of a house scope resolver.
uint32_t | GetRandomBits () const override
| Get a few random bits.
uint32_t | GetVariable (uint8_t variable, uint32_t parameter, bool &available) const override
uint32_t | GetRandomTriggers () const override
| Get the triggers.
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).

## 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.
int | view
| View when house does yet exist.
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,
|  | int | view
| ) |  |
| 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 39 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 223 of file newgrf_house.cpp.

References GetHouseRandomBits(), initial_random_bits, not_yet_constructed, and tile.

## ◆ GetRandomTriggers()

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

Get the triggers.

Base class returns `0` to prevent trouble.

Returns
  The triggers.

Reimplemented from ScopeResolver.

Definition at line 229 of file newgrf_house.cpp.

References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), GetHouseRandomTriggers(), not_yet_constructed, and tile.

## ◆ GetVariable()

uint32_t HouseScopeResolver::GetVariable | ( | uint8_t | variable,
|  | 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 310 of file newgrf_house.cpp.

References _generating_world, HouseSpec::class_id, Debug, GB(), HouseSpec::Get(), GetAnimationFrame(), GetBadgeVariableResult(), GetCargoTranslation(), GetDistanceFromNearbyHouse(), OverrideManagerBase::GetGRFID(), GetHouseAge(), GetHouseBuildingStage(), GetHouseType(), OverrideManagerBase::GetID(), GetNearbyTile(), GetNearbyTileInformation(), ResolverObject::GetRegister(), StationFinder::GetStations(), GetTerrainType(), GetTownRadiusGroup(), HouseSpec::grf_prop, GRFFilePropsBase::grffile, ResolverObject::grffile, GRFFilePropsBase::grfid, HasBit(), GRFFilePropsBase::HasGrfFile(), house_id, INVALID_TILE, IsTileType(), IsValidCargoType(), GRFFilePropsBase::local_id, MP_HOUSE, NEW_HOUSE_OFFSET, ScopeResolver::ro, SetBit(), tile, TileDiffXY(), TileHash2Bit(), TileX(), TileY(), to_underlying(), town, TOWN_HOUSE_COMPLETED, view, watched_cargo_triggers, and Map::WrapToMap().

## Field Documentation

## ◆ house_id

HouseID HouseScopeResolver::house_id

Type of house being queried.

Definition at line 21 of file newgrf_house.h.

Referenced by HouseResolverObject::GetDebugID(), and GetVariable().

## ◆ initial_random_bits

uint16_t HouseScopeResolver::initial_random_bits

Random bits during construction checks.

Definition at line 25 of file newgrf_house.h.

Referenced by GetRandomBits().

## ◆ not_yet_constructed

bool HouseScopeResolver::not_yet_constructed

True for construction check.

Definition at line 24 of file newgrf_house.h.

Referenced by GetRandomBits(), and GetRandomTriggers().

## ◆ tile

TileIndex HouseScopeResolver::tile

Tile of this house.

Definition at line 22 of file newgrf_house.h.

Referenced by GetRandomBits(), GetRandomTriggers(), and GetVariable().

## ◆ town

Town* HouseScopeResolver::town

Town of this house.

Definition at line 23 of file newgrf_house.h.

Referenced by GetVariable().

## ◆ view

int HouseScopeResolver::view

View when house does yet exist.

Definition at line 27 of file newgrf_house.h.

Referenced by GetVariable().

## ◆ watched_cargo_triggers

CargoTypes HouseScopeResolver::watched_cargo_triggers

Cargo types that triggered the watched cargo callback.

Definition at line 26 of file newgrf_house.h.

Referenced by GetVariable().

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

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