OpenTTD Source: NIHStation Class Reference

OpenTTD Source 15.0-RC2

Private Member Functions
NIHStation Class Reference
Inheritance diagram for NIHStation:

## Private Member Functions
bool | IsInspectable (uint index) const override
| Is the item with the given index inspectable?
uint | GetParent (uint index) const override
| Get the parent "window_number" of a given instance.
const void * | GetInstance (uint) const override
| Get the instance given an index.
const void * | GetSpec (uint index) const override
| Get (NewGRF) specs given an index.
std::string | GetName (uint index) const override
| Get the name of this item.
uint32_t | GetGRFID (uint index) const override
| Get the GRFID of the file that includes this item.
std::span< const BadgeID > | GetBadges (uint index) const override
| Get the list of badges of this item.
uint | Resolve (uint index, uint var, uint param, bool &avail) const override
| Resolve (action2) variable for a given index.

## Additional Inherited Members
Public Member Functions inherited from NIHelper
virtual | ~NIHelper ()=default
| Silence a warning.
virtual bool | PSAWithParameter () const
| Used to decide if the PSA needs a parameter or not.
virtual const std::span< int32_t > | GetPSA (uint index, uint32_t grfid) const
| Gets the span containing the persistent storage.

## Detailed Description

Definition at line 132 of file newgrf_debug_data.h.

## Member Function Documentation

## ◆ GetBadges()

std::span< const BadgeID > NIHStation::GetBadges | ( | uint | index | ) | const
| inlineoverrideprivatevirtual

Get the list of badges of this item.

Parameters

  index | index to check.

Returns
  List of badges of the item.

Implements NIHelper.

Definition at line 139 of file newgrf_debug_data.h.

References IsInspectable().

## ◆ GetGRFID()

uint32_t NIHStation::GetGRFID | ( | uint | index | ) | const
| inlineoverrideprivatevirtual

Get the GRFID of the file that includes this item.

Parameters

  index | index to check.

Returns
  GRFID of the item. 0 means that the item is not inspectable.

Implements NIHelper.

Definition at line 138 of file newgrf_debug_data.h.

References IsInspectable().

## ◆ GetInstance()

const void * NIHStation::GetInstance | ( | uint | index | ) | const
| inlineoverrideprivatevirtual

Get the instance given an index.

Parameters

  index | the index to get the instance for.

Returns
  the instance.

Implements NIHelper.

Definition at line 135 of file newgrf_debug_data.h.

## ◆ GetName()

std::string NIHStation::GetName | ( | uint | index | ) | const
| inlineoverrideprivatevirtual

Get the name of this item.

Parameters

  index | the index to get the name for.

Implements NIHelper.

Definition at line 137 of file newgrf_debug_data.h.

References GetStationIndex(), and GetString().

## ◆ GetParent()

uint NIHStation::GetParent | ( | uint | index | ) | const
| inlineoverrideprivatevirtual

Get the parent "window_number" of a given instance.

Parameters

  index | the instance to get the parent for.

Returns
  the parent's window_number or UINT32_MAX if there is none.

Implements NIHelper.

Definition at line 134 of file newgrf_debug_data.h.

References BaseStation::GetByTile(), GetInspectWindowNumber(), GSF_FAKE_TOWNS, and Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index.

## ◆ GetSpec()

const void * NIHStation::GetSpec | ( | uint | index | ) | const
| inlineoverrideprivatevirtual

Get (NewGRF) specs given an index.

Parameters

  index | the index to get the specs for for.

Returns
  the specs.

Implements NIHelper.

Definition at line 136 of file newgrf_debug_data.h.

## ◆ IsInspectable()

bool NIHStation::IsInspectable | ( | uint | index | ) | const
| inlineoverrideprivatevirtual

Is the item with the given index inspectable?

Parameters

  index | the index to check.

Returns
  true iff the index is inspectable.

Implements NIHelper.

Definition at line 133 of file newgrf_debug_data.h.

Referenced by GetBadges(), and GetGRFID().

## ◆ Resolve()

uint NIHStation::Resolve | ( | uint | index,
|  | uint | var,
|  | uint | param,
|  | bool & | avail
| ) |  | const
| inlineoverrideprivatevirtual

Resolve (action2) variable for a given index.

Parameters

  index | The (instance) index to resolve the variable for.
  var | The variable to actually resolve.
  param | The varaction2 0x60+x parameter to pass.
  avail | Return whether the variable is available.

Returns
  The resolved variable's value.

Implements NIHelper.

Definition at line 141 of file newgrf_debug_data.h.

References BaseStation::GetByTile(), StationResolverObject::GetScope(), ScopeResolver::GetVariable(), and VSG_SCOPE_SELF.

The documentation for this class was generated from the following file:

- src/table/newgrf_debug_data.h