OpenTTD Source: GRFFilePropsBase Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
GRFFilePropsBase Struct Reference

Base data related to the handling of grf files. More...

`#include <newgrf_commons.h>`

Inheritance diagram for GRFFilePropsBase:

## Public Member Functions
void | SetGRFFile (const struct GRFFile *grffile)
| Set the NewGRF file, and its grfid, associated with grf props.
bool | HasGrfFile () const
| Test if this entity was introduced by NewGRF.

## Data Fields
uint16_t | local_id = 0
| id defined by the grf file for this entity
uint32_t | grfid = 0
| grfid that introduced this entity.
const struct GRFFile * | grffile = nullptr
| grf file that introduced this entity

## Detailed Description

Base data related to the handling of grf files.

Definition at line 315 of file newgrf_commons.h.

## Member Function Documentation

## ◆ HasGrfFile()

bool GRFFilePropsBase::HasGrfFile | ( |  | ) | const
| inline

Test if this entity was introduced by NewGRF.

Returns
  true iff the grfid property is set.

Definition at line 326 of file newgrf_commons.h.

Referenced by IndustryOverrideManager::AddEntityID(), BuildObjectWindow::DrawWidget(), GetDistanceFromNearbyHouse(), GetNewEngine(), GetObjectIDAtOffset(), HouseScopeResolver::GetVariable(), NIHHouse::IsInspectable(), NIHIndustryTile::IsInspectable(), NIHIndustry::IsInspectable(), NIHAirportTile::IsInspectable(), NIHAirport::IsInspectable(), and BuildIndustryWindow::UpdateWidgetSize().

## ◆ SetGRFFile()

void GRFFilePropsBase::SetGRFFile | ( | const struct GRFFile * | grffile | ) |

Set the NewGRF file, and its grfid, associated with grf props.

Parameters

  grffile | GRFFile to set.

Definition at line 735 of file newgrf_commons.cpp.

References grffile, and grfid.

Referenced by GetNewEngine(), and SetEngineGRF().

## Field Documentation

## ◆ grffile

const struct GRFFile* GRFFilePropsBase::grffile = nullptr

grf file that introduced this entity

Definition at line 318 of file newgrf_commons.h.

Referenced by AddAcceptedCargoOfHouse(), CheckIfCallBackAllowsCreation(), CmdBuildObject(), CmdBuildRailStation(), CmdBuildRoadStop(), DoCreateNewIndustry(), IndustryViewWindow::DrawInfo(), BuildIndustryWindow::DrawWidget(), BuildObjectWindow::DrawWidget(), GetAllCargoSuffixes(), ObjectSpec::GetBuildCost(), RoadStopSpec::GetBuildCost(), GetCargoSuffix(), GetCargoSuffix(), ObjectSpec::GetClearCost(), RoadStopSpec::GetClearCost(), GetFoundation_Town(), Engine::GetGRF(), GetGrffile(), GetHouseName(), GetHouseSpecGrf(), GetIndTileGrffile(), GetIndustryProbabilityCallback(), GetProducedCargoOfHouse(), HouseScopeResolver::GetVariable(), RoadStopScopeResolver::GetVariable(), StationScopeResolver::GetVariable(), IndustryProductionCallback(), IndustryTemporarilyRefusesCargo(), IsRoadStopAvailable(), IsStationAvailable(), PerformIndustryTileSlopeCheck(), PerformStationTileSlopeCheck(), SetGRFFile(), TileLoop_Town(), and TryBuildTownHouse().

## ◆ grfid

uint32_t GRFFilePropsBase::grfid = 0

grfid that introduced this entity.

Definition at line 317 of file newgrf_commons.h.

Referenced by AssignSpecToRoadStop(), AssignSpecToStation(), BuildObject(), ChangeIndustryProduction(), CmdBuildRailStation(), CommitVehicleListOrderChanges(), DoCreateNewIndustry(), IndustryViewWindow::DrawInfo(), BuildIndustryWindow::DrawWidget(), BuildObjectWindow::DrawWidget(), EnginePreSort(), GetAirportTextCallback(), GetAirportTileIDAtOffset(), GetCargoSuffix(), GetCountAndDistanceOfClosestInstance(), GetDistanceFromNearbyHouse(), NIHHouse::GetGRFID(), NIHIndustryTile::GetGRFID(), NIHIndustry::GetGRFID(), NIHAirportTile::GetGRFID(), NIHAirport::GetGRFID(), GetIndustryIDAtOffset(), GetIndustryProbabilityCallback(), GetObjectIDAtOffset(), HouseScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), MoveWaypointsToBaseStations(), SetGRFFile(), IndustriesScopeResolver::StorePSA(), HousePickerCallbacks::UpdateSavedItems(), and VehicleLengthChanged().

## ◆ local_id

uint16_t GRFFilePropsBase::local_id = 0

id defined by the grf file for this entity

Definition at line 316 of file newgrf_commons.h.

Referenced by AssignSpecToRoadStop(), AssignSpecToStation(), CommitVehicleListOrderChanges(), BuildObjectWindow::DrawWidget(), EnginePreSort(), GetAirportTileIDAtOffset(), AirportResolverObject::GetDebugID(), AirportTileResolverObject::GetDebugID(), HouseResolverObject::GetDebugID(), IndustriesResolverObject::GetDebugID(), IndustryTileResolverObject::GetDebugID(), ObjectResolverObject::GetDebugID(), StationResolverObject::GetDebugID(), GetDistanceFromNearbyHouse(), GetIndustryIDAtOffset(), GetObjectIDAtOffset(), HouseScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), IsHouseSpecValid(), MoveWaypointsToBaseStations(), ResetObjects(), HousePickerCallbacks::UpdateSavedItems(), and VehicleLengthChanged().

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

- src/newgrf_commons.h
- src/newgrf_commons.cpp