OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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 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.
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).

## 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 | 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
ResolverObject & | ro
| Surrounding resolver object.

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

References house_id, initial_random_bits, not_yet_constructed, tile, town, and watched_cargo_triggers.

## 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 158 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 165 of file newgrf_house.cpp.

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

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

References _generating_world, SmallVector< T, S >::Begin(), HouseClassMapping::class_id, HouseSpec::class_id, CT_INVALID, DEBUG, SmallVector< T, S >::End(), GB(), GoodsEntry::GES_ACCEPTED_BIGTICK, GoodsEntry::GES_CURRENT_MONTH, GoodsEntry::GES_EVER_ACCEPTED, GoodsEntry::GES_LAST_MONTH, GetAnimationFrame(), GetCargoTranslation(), GetDistanceFromNearbyHouse(), OverrideManagerBase::GetGRFID(), GetHouseAge(), GetHouseBuildingStage(), GetHouseType(), OverrideManagerBase::GetID(), GetNearbyTile(), GetNearbyTileInformation(), GetRegister(), StationFinder::GetStations(), GetTerrainType(), GetTownRadiusGroup(), Station::goods, HouseSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, ResolverObject::grffile, HasBit(), house_id, IsTileType(), GRFFilePropsBase< Tcnt >::local_id, MP_HOUSE, NEW_HOUSE_OFFSET, ScopeResolver::ro, SetBit(), GoodsEntry::status, tile, TILE_MASK, TileDiffXY(), TileHash2Bit(), TileX(), TileY(), town, and watched_cargo_triggers.

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 172 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:

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