OpenTTD Source 20260311-master-g511d3794ce
StandardGRFFileProps Struct Reference

Container for standard sprite groups. More...

#include <newgrf_commons.h>

Inheritance diagram for StandardGRFFileProps:
FixedGRFFileProps< StandardSpriteGroup, static_cast< size_t >(StandardSpriteGroup::End)> GRFFilePropsBase SubstituteGRFFileProps

Public Member Functions

bool HasSpriteGroups () const
 Check whether the entity has sprite groups.
const struct SpriteGroupGetSpriteGroup (bool entity_exists) const
 Get the standard sprite group.
Public Member Functions inherited from FixedGRFFileProps< StandardSpriteGroup, static_cast< size_t >(StandardSpriteGroup::End)>
const struct SpriteGroupGetSpriteGroup (StandardSpriteGroup index) const
 Get the SpriteGroup at the specified index.
const struct SpriteGroupGetFirstSpriteGroupOf (std::initializer_list< StandardSpriteGroup > indices) const
 Get the first existing SpriteGroup from a list of options.
void SetSpriteGroup (StandardSpriteGroup 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.

Additional Inherited Members

Data Fields inherited from FixedGRFFileProps< StandardSpriteGroup, static_cast< size_t >(StandardSpriteGroup::End)>
std::array< const struct SpriteGroup *, Tcount > 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

Container for standard sprite groups.

Definition at line 386 of file newgrf_commons.h.

Member Function Documentation

◆ GetSpriteGroup()

const struct SpriteGroup * StandardGRFFileProps::GetSpriteGroup ( bool entity_exists) const
inline

Get the standard sprite group.

Parameters
entity_existsWhether the entity exists (true), or is being constructed or shown in the GUI (false).
Returns
The purchase sprite group if entity_exists is true and it exists, otherwise the default sprite group or nullptr.

Definition at line 403 of file newgrf_commons.h.

References Default, GetSpriteGroup(), and Purchase.

Referenced by AirportResolverObject::AirportResolverObject(), AirportTileResolverObject::AirportTileResolverObject(), GetSpriteGroup(), HasSpriteGroups(), HouseResolverObject::HouseResolverObject(), IndustriesResolverObject::IndustriesResolverObject(), IndustryTileResolverObject::IndustryTileResolverObject(), and ObjectResolverObject::ObjectResolverObject().

◆ HasSpriteGroups()

bool StandardGRFFileProps::HasSpriteGroups ( ) const
inline

Check whether the entity has sprite groups.

Returns
true iff this has a default sprite group.

Definition at line 393 of file newgrf_commons.h.

References Default, and GetSpriteGroup().

Referenced by DoTriggerIndustryTileRandomisation(), DrawHouseInGUI(), DrawTile_Industry(), DrawTile_Station(), GetAirportTileIDAtOffset(), and GetIndustryIDAtOffset().


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