OpenTTD Source 20250312-master-gcdcc6b491d
NIHRailType Class Reference
Inheritance diagram for NIHRailType:
NIHelper

Private Member Functions

bool IsInspectable (uint) const override
 Is the item with the given index inspectable?
 
uint GetParent (uint) 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) 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) const override
 Get the GRFID of the file that includes this item.
 
std::span< const BadgeIDGetBadges (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 456 of file newgrf_debug_data.h.

Member Function Documentation

◆ GetBadges()

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

Get the list of badges of this item.

Parameters
indexindex to check.
Returns
List of badges of the item.

Implements NIHelper.

Definition at line 463 of file newgrf_debug_data.h.

References GetRailType(), and GetRailTypeInfo().

◆ GetGRFID()

uint32_t NIHRailType::GetGRFID ( uint  index) const
inlineoverrideprivatevirtual

Get the GRFID of the file that includes this item.

Parameters
indexindex to check.
Returns
GRFID of the item. 0 means that the item is not inspectable.

Implements NIHelper.

Definition at line 462 of file newgrf_debug_data.h.

◆ GetInstance()

const void * NIHRailType::GetInstance ( uint  index) const
inlineoverrideprivatevirtual

Get the instance given an index.

Parameters
indexthe index to get the instance for.
Returns
the instance.

Implements NIHelper.

Definition at line 459 of file newgrf_debug_data.h.

◆ GetName()

std::string NIHRailType::GetName ( uint  index) const
inlineoverrideprivatevirtual

Get the name of this item.

Parameters
indexthe index to get the name for.

Implements NIHelper.

Definition at line 461 of file newgrf_debug_data.h.

References GetString(), and INVALID_STRING_ID.

◆ GetParent()

uint NIHRailType::GetParent ( uint  index) const
inlineoverrideprivatevirtual

Get the parent "window_number" of a given instance.

Parameters
indexthe instance to get the parent for.
Returns
the parent's window_number or UINT32_MAX if there is none.

Implements NIHelper.

Definition at line 458 of file newgrf_debug_data.h.

◆ GetSpec()

const void * NIHRailType::GetSpec ( uint  index) const
inlineoverrideprivatevirtual

Get (NewGRF) specs given an index.

Parameters
indexthe index to get the specs for for.
Returns
the specs.

Implements NIHelper.

Definition at line 460 of file newgrf_debug_data.h.

◆ IsInspectable()

bool NIHRailType::IsInspectable ( uint  index) const
inlineoverrideprivatevirtual

Is the item with the given index inspectable?

Parameters
indexthe index to check.
Returns
true iff the index is inspectable.

Implements NIHelper.

Definition at line 457 of file newgrf_debug_data.h.

◆ Resolve()

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

Resolve (action2) variable for a given index.

Parameters
indexThe (instance) index to resolve the variable for.
varThe variable to actually resolve.
paramThe varaction2 0x60+x parameter to pass.
availReturn whether the variable is available.
Returns
The resolved variable's value.

Implements NIHelper.

Definition at line 465 of file newgrf_debug_data.h.

References RailTypeResolverObject::GetScope(), ScopeResolver::GetVariable(), TCX_NORMAL, and VSG_SCOPE_SELF.


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