OpenTTD Source 20260206-master-g4d4e37dbf1
RandomizedSpriteGroup Struct Reference
Inheritance diagram for RandomizedSpriteGroup:
SpecializedSpriteGroup< RandomizedSpriteGroup > SpriteGroup

Public Member Functions

 RandomizedSpriteGroup (SpriteGroupID index)
Public Member Functions inherited from SpecializedSpriteGroup< RandomizedSpriteGroup >
 SpecializedSpriteGroup (SpriteGroupID index)

Data Fields

VarSpriteGroupScope var_scope {}
 Take this object:
RandomizedSpriteGroupCompareMode cmp_mode {}
 Check for these triggers:
uint8_t triggers = 0
uint8_t count = 0
uint8_t lowest_randbit = 0
 Look for this in the per-object randomized bitmask:
std::vector< const SpriteGroup * > groups {}
 Take the group with appropriate index:
Data Fields inherited from SpriteGroup
uint32_t nfo_line = 0

Protected Member Functions

ResolverResult Resolve (ResolverObject &object) const override
 Resolves a callback or rerandomisation callback to a NewGRF.
Protected Member Functions inherited from SpriteGroup
 SpriteGroup (SpriteGroupID index)

Additional Inherited Members

Static Public Member Functions inherited from SpecializedSpriteGroup< RandomizedSpriteGroup >
static RandomizedSpriteGroupCreate (Targs &&... args)
 Creates a new T-object in the SpriteGroup pool.
Static Public Member Functions inherited from SpriteGroup
static ResolverResult Resolve (const SpriteGroup *group, ResolverObject &object, bool top_level=true)
 ResolverObject (re)entry point.

Detailed Description

Definition at line 205 of file newgrf_spritegroup.h.

Constructor & Destructor Documentation

◆ RandomizedSpriteGroup()

RandomizedSpriteGroup::RandomizedSpriteGroup ( SpriteGroupID index)
inline

Definition at line 206 of file newgrf_spritegroup.h.

Member Function Documentation

◆ Resolve()

ResolverResult RandomizedSpriteGroup::Resolve ( ResolverObject & object) const
overrideprotectedvirtual

Resolves a callback or rerandomisation callback to a NewGRF.

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

Implements SpriteGroup.

Definition at line 253 of file newgrf_spritegroup.cpp.

References CBID_RANDOM_TRIGGER, cmp_mode, ScopeResolver::GetRandomBits(), groups, lowest_randbit, SpriteGroup::Resolve(), and var_scope.

Field Documentation

◆ cmp_mode

RandomizedSpriteGroupCompareMode RandomizedSpriteGroup::cmp_mode {}

Check for these triggers:

Definition at line 210 of file newgrf_spritegroup.h.

Referenced by Resolve().

◆ count

uint8_t RandomizedSpriteGroup::count = 0

Definition at line 212 of file newgrf_spritegroup.h.

◆ groups

std::vector<const SpriteGroup *> RandomizedSpriteGroup::groups {}

Take the group with appropriate index:

Definition at line 216 of file newgrf_spritegroup.h.

Referenced by Resolve().

◆ lowest_randbit

uint8_t RandomizedSpriteGroup::lowest_randbit = 0

Look for this in the per-object randomized bitmask:

Definition at line 214 of file newgrf_spritegroup.h.

Referenced by Resolve().

◆ triggers

uint8_t RandomizedSpriteGroup::triggers = 0

Definition at line 211 of file newgrf_spritegroup.h.

◆ var_scope

VarSpriteGroupScope RandomizedSpriteGroup::var_scope {}

Take this object:

Definition at line 208 of file newgrf_spritegroup.h.

Referenced by Resolve().


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