OpenTTD Source 20250531-master-g621c031307
CargoGRFFileProps Struct Reference

Sprite groups indexed by CargoType. More...

#include <newgrf_commons.h>

Inheritance diagram for CargoGRFFileProps:
VariableGRFFileProps< CargoType > GRFFilePropsBase

Static Public Attributes

static constexpr CargoType SG_DEFAULT = NUM_CARGO
 Default type used when no more-specific cargo matches.
 
static constexpr CargoType SG_PURCHASE = NUM_CARGO + 1
 Used in purchase lists before an item exists.
 
static constexpr CargoType SG_DEFAULT_NA = NUM_CARGO + 2
 Used only by stations and roads when no more-specific cargo matches.
 

Additional Inherited Members

- Public Types inherited from VariableGRFFileProps< CargoType >
using ValueType = std::pair< CargoType, const struct SpriteGroup * >
 
- Public Member Functions inherited from VariableGRFFileProps< CargoType >
const SpriteGroupGetSpriteGroup (CargoType index) const
 Get the SpriteGroup at the specified index.
 
const struct SpriteGroupGetFirstSpriteGroupOf (std::initializer_list< CargoType > indices) const
 Get the first existing SpriteGroup from a list of options.
 
void SetSpriteGroup (CargoType index, const 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 inherited from VariableGRFFileProps< CargoType >
std::vector< ValueType > 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

Sprite groups indexed by CargoType.

Definition at line 456 of file newgrf_commons.h.

Field Documentation

◆ SG_DEFAULT

constexpr CargoType CargoGRFFileProps::SG_DEFAULT = NUM_CARGO
staticconstexpr

Default type used when no more-specific cargo matches.

Definition at line 457 of file newgrf_commons.h.

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

◆ SG_DEFAULT_NA

constexpr CargoType CargoGRFFileProps::SG_DEFAULT_NA = NUM_CARGO + 2
staticconstexpr

Used only by stations and roads when no more-specific cargo matches.

Definition at line 459 of file newgrf_commons.h.

Referenced by StationResolverObject::ResolveReal(), and StationResolverObject::StationResolverObject().

◆ SG_PURCHASE

constexpr CargoType CargoGRFFileProps::SG_PURCHASE = NUM_CARGO + 1
staticconstexpr

Used in purchase lists before an item exists.

Definition at line 458 of file newgrf_commons.h.

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


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