OpenTTD Source 20260311-master-g511d3794ce
SpriteGroup Struct Referenceabstract

Common wrapper for all the different sprite group types. More...

#include <newgrf_spritegroup.h>

Inheritance diagram for SpriteGroup:
SpecializedSpriteGroup< CallbackResultSpriteGroup > SpecializedSpriteGroup< DeterministicSpriteGroup > SpecializedSpriteGroup< IndustryProductionSpriteGroup > SpecializedSpriteGroup< RandomizedSpriteGroup > SpecializedSpriteGroup< RealSpriteGroup > SpecializedSpriteGroup< ResultSpriteGroup > SpecializedSpriteGroup< TileLayoutSpriteGroup > SpecializedSpriteGroup< T >

Public Member Functions

virtual ~SpriteGroup ()=default
 Ensure the destructor of the sub classes are called as well.

Static Public Member Functions

static ResolverResult Resolve (const SpriteGroup *group, ResolverObject &object, bool top_level=true)
 ResolverObject (re)entry point.

Data Fields

uint32_t nfo_line = 0

Protected Member Functions

 SpriteGroup (SpriteGroupID index)
virtual ResolverResult Resolve (ResolverObject &object) const =0
 Resolves a callback or rerandomisation callback to a NewGRF.

Detailed Description

Common wrapper for all the different sprite group types.

Definition at line 47 of file newgrf_spritegroup.h.

Constructor & Destructor Documentation

◆ SpriteGroup()

SpriteGroup::SpriteGroup ( SpriteGroupID index)
inlineprotected

Definition at line 49 of file newgrf_spritegroup.h.

Member Function Documentation

◆ Resolve() [1/2]

ResolverResult SpriteGroup::Resolve ( const SpriteGroup * group,
ResolverObject & object,
bool top_level = true )
static

ResolverObject (re)entry point.

This cannot be made a call to a virtual function because virtual functions do not like nullptr and checking for nullptr everywhere is more cumbersome than this little helper function.

Parameters
groupthe group to resolve for
objectinformation needed to resolve the group
top_leveltrue if this is a top-level SpriteGroup, false if used nested in another SpriteGroup.
Returns
the resolved group

Definition at line 34 of file newgrf_spritegroup.cpp.

References NewGRFProfiler::grffile, and Resolve().

◆ Resolve() [2/2]

virtual ResolverResult SpriteGroup::Resolve ( ResolverObject & object) const
protectedpure virtual

Resolves a callback or rerandomisation callback to a NewGRF.

Parameters
objectInformation needed to resolve the group.
Returns
The result of resolving this SpriteGroup.

Implemented in CallbackResultSpriteGroup, DeterministicSpriteGroup, IndustryProductionSpriteGroup, RandomizedSpriteGroup, RealSpriteGroup, ResultSpriteGroup, and TileLayoutSpriteGroup.

Referenced by DeterministicSpriteGroup::Resolve(), RandomizedSpriteGroup::Resolve(), RealSpriteGroup::Resolve(), Resolve(), and ResolverObject::~ResolverObject().

Field Documentation

◆ nfo_line

uint32_t SpriteGroup::nfo_line = 0

Definition at line 61 of file newgrf_spritegroup.h.


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