OpenTTD Source 20250504-master-g7d7a6bd32c
|
Fixed-length list of sprite groups for an entity. More...
#include <newgrf_commons.h>
Public Member Functions | |
const struct SpriteGroup * | GetSpriteGroup (Tkey index) const |
Get the SpriteGroup at the specified index. | |
const struct SpriteGroup * | GetFirstSpriteGroupOf (std::initializer_list< Tkey > indices) const |
Get the first existing SpriteGroup from a list of options. | |
void | SetSpriteGroup (Tkey index, const struct SpriteGroup *spritegroup) |
Set the SpriteGroup at the specified index. | |
![]() | |
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::array< const struct SpriteGroup *, Tcount > | spritegroups {} |
pointers to the different sprite groups of the entity | |
![]() | |
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 | |
Fixed-length list of sprite groups for an entity.
Tkey | Key for indexing spritegroups |
Tcount | Number of spritegroups |
Definition at line 313 of file newgrf_commons.h.
|
inline |
Get the first existing SpriteGroup from a list of options.
indices | Valid options. |
Definition at line 328 of file newgrf_commons.h.
References FixedGRFFileProps< Tkey, Tcount >::GetSpriteGroup().
|
inline |
Get the SpriteGroup at the specified index.
index | Index to get. |
Definition at line 321 of file newgrf_commons.h.
References FixedGRFFileProps< Tkey, Tcount >::spritegroups.
Referenced by FixedGRFFileProps< Tkey, Tcount >::GetFirstSpriteGroupOf().
|
inline |
Set the SpriteGroup at the specified index.
index | Index to set. |
spritegroup | SpriteGroup to set. |
Definition at line 342 of file newgrf_commons.h.
References FixedGRFFileProps< Tkey, Tcount >::spritegroups.
std::array<const struct SpriteGroup *, Tcount> FixedGRFFileProps< Tkey, Tcount >::spritegroups {} |
pointers to the different sprite groups of the entity
Definition at line 314 of file newgrf_commons.h.
Referenced by FixedGRFFileProps< Tkey, Tcount >::GetSpriteGroup(), and FixedGRFFileProps< Tkey, Tcount >::SetSpriteGroup().