OpenTTD Source 20250220-master-gf89924a727
VariableGRFFileProps Struct Reference

Variable-length list of sprite groups for an entity. More...

#include <newgrf_commons.h>

Inheritance diagram for VariableGRFFileProps:
GRFFilePropsBase

Public Types

using CargoSpriteGroup = std::pair< size_t, const struct SpriteGroup * >
 

Public Member Functions

const struct SpriteGroupGetSpriteGroup (size_t index) const
 Get the SpriteGroup at the specified index.
 
void SetSpriteGroup (size_t index, const struct SpriteGroup *spritegroup)
 Set the SpriteGroup at the specified index.
 
- Public Member Functions inherited from GRFFilePropsBase
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

std::vector< CargoSpriteGroup > spritegroups
 pointers to the different sprite groups of the entity
 
- Data Fields inherited from GRFFilePropsBase
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 GRFFilegrffile = nullptr
 grf file that introduced this entity
 

Detailed Description

Variable-length list of sprite groups for an entity.

Definition at line 332 of file newgrf_commons.h.

Member Typedef Documentation

◆ CargoSpriteGroup

using VariableGRFFileProps::CargoSpriteGroup = std::pair<size_t, const struct SpriteGroup *>

Definition at line 333 of file newgrf_commons.h.

Member Function Documentation

◆ GetSpriteGroup()

const SpriteGroup * VariableGRFFileProps::GetSpriteGroup ( size_t  index) const

Get the SpriteGroup at the specified index.

Parameters
indexIndex to get.
Returns
SpriteGroup at index, or nullptr if not present.

Definition at line 750 of file newgrf_commons.cpp.

References spritegroups.

Referenced by BadgeResolverObject::BadgeResolverObject(), StationResolverObject::StationResolverObject(), and VehicleResolverObject::VehicleResolverObject().

◆ SetSpriteGroup()

void VariableGRFFileProps::SetSpriteGroup ( size_t  index,
const struct SpriteGroup spritegroup 
)

Set the SpriteGroup at the specified index.

Parameters
indexIndex to set.
spritegroupSpriteGroup to set.

Definition at line 762 of file newgrf_commons.cpp.

References spritegroups.

Field Documentation

◆ spritegroups

std::vector<CargoSpriteGroup> VariableGRFFileProps::spritegroups

pointers to the different sprite groups of the entity

Definition at line 334 of file newgrf_commons.h.

Referenced by GetSpriteGroup(), SetSpriteGroup(), and StationResolverObject::StationResolverObject().


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