OpenTTD Source: NIHIndustry Class Reference

OpenTTD Source 13.2.1

Private Member Functions
NIHIndustry Class Reference
Inheritance diagram for NIHIndustry:

## Private Member Functions
bool | IsInspectable (uint index) const override
| Is the item with the given index inspectable? More...
uint | GetParent (uint index) const override
| Get the parent "window_number" of a given instance. More...
const void * | GetInstance (uint index) const override
| Get the instance given an index. More...
const void * | GetSpec (uint index) const override
| Get (NewGRF) specs given an index. More...
void | SetStringParameters (uint index) const override
| Set the string parameters to write the right data for a STRINGn. More...
uint32 | GetGRFID (uint index) const override
| Get the GRFID of the file that includes this item. More...
uint | Resolve (uint index, uint var, uint param, bool *avail) const override
| Resolve (action2) variable for a given index. More...
uint | GetPSASize (uint index, uint32 grfid) const override
| Allows to know the size of the persistent storage. More...
const int32 * | GetPSAFirstPosition (uint index, uint32 grfid) const override
| Gets the first position of the array containing the persistent storage. More...

## Additional Inherited Members
Public Member Functions inherited from NIHelper
virtual | ~NIHelper ()
| Silence a warning.
virtual bool | PSAWithParameter () const
| Used to decide if the PSA needs a parameter or not. More...
Protected Member Functions inherited from NIHelper
void | SetSimpleStringParameters (StringID string, uint32 index) const
| Helper to make setting the strings easier. More...
void | SetObjectAtStringParameters (StringID string, uint32 index, TileIndex tile) const
| Helper to make setting the strings easier for objects at a specific tile. More...

## Detailed Description

Definition at line 359 of file newgrf_debug_data.h.

## Member Function Documentation

## ◆ GetGRFID()

uint32 NIHIndustry::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 365 of file newgrf_debug_data.h.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::Get(), GetIndustrySpec(), IndustrySpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, and IsInspectable().

## ◆ GetInstance()

const void* NIHIndustry::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 362 of file newgrf_debug_data.h.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::Get().

Referenced by GetPSAFirstPosition().

## ◆ GetParent()

uint NIHIndustry::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 361 of file newgrf_debug_data.h.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::Get(), GetInspectWindowNumber(), and GSF_FAKE_TOWNS.

## ◆ GetPSAFirstPosition()

const int32* NIHIndustry::GetPSAFirstPosition | ( | uint | index,
|  | uint32 | grfid
| ) |  | const
| inlineoverrideprivatevirtual

Gets the first position of the array containing the persistent storage.

Parameters

  index | Index of the item.
  grfid | Parameter for the PSA. Only required for items with parameters.

Returns
  Pointer to the first position of the storage array or nullptr if not present.

Reimplemented from NIHelper.

Definition at line 376 of file newgrf_debug_data.h.

References GetInstance(), Industry::psa, and PersistentStorageArray< TYPE, SIZE >::storage.

## ◆ GetPSASize()

uint NIHIndustry::GetPSASize | ( | uint | index,
|  | uint32 | grfid
| ) |  | const
| inlineoverrideprivatevirtual

Allows to know the size of the persistent storage.

Parameters

  index | Index of the item.
  grfid | Parameter for the PSA. Only required for items with parameters.

Returns
  Size of the persistent storage in indices.

Reimplemented from NIHelper.

Definition at line 374 of file newgrf_debug_data.h.

References cpp_lengthof.

## ◆ GetSpec()

const void* NIHIndustry::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 363 of file newgrf_debug_data.h.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::Get(), and GetIndustrySpec().

## ◆ IsInspectable()

bool NIHIndustry::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 360 of file newgrf_debug_data.h.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::Get(), GetIndustrySpec(), IndustrySpec::grf_prop, and GRFFilePropsBase< Tcnt >::grffile.

Referenced by GetGRFID().

## ◆ Resolve()

uint NIHIndustry::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 367 of file newgrf_debug_data.h.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::Get(), IndustriesResolverObject::GetScope(), ScopeResolver::GetVariable(), Industry::location, OrthogonalTileArea::tile, Industry::type, and VSG_SCOPE_SELF.

## ◆ SetStringParameters()

void NIHIndustry::SetStringParameters | ( | uint | index | ) | const
| inlineoverrideprivatevirtual

Set the string parameters to write the right data for a STRINGn.

Parameters

  index | the index to get the string parameters for.

Implements NIHelper.

Definition at line 364 of file newgrf_debug_data.h.

References NIHelper::SetSimpleStringParameters().

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

- src/table/newgrf_debug_data.h