OpenTTD Source 20260505-master-g275ba48eea
InvokeGrfChangeInfoHandler Struct Reference

Helper class to invoke a GrfChangeInfoHandler. More...

Public Types

using Invoker = ChangeInfoResult(*)(uint first, uint last, int prop, ByteReader &buf, GrfLoadingStage stage)
 The function prototype for a change info handler.

Static Public Member Functions

template<GrfSpecFeature TFeature>
static ChangeInfoResult Invoke (uint first, uint last, int prop, ByteReader &buf, GrfLoadingStage stage)
 Invoke the change info handler for a specific feature.
static ChangeInfoResult Invoke (GrfSpecFeature feature, uint first, uint last, int prop, ByteReader &buf, GrfLoadingStage stage)
 Invoke the change info handler for a specific feature.

Static Public Attributes

static constexpr EnumIndexArray< Invoker, GrfSpecFeature, GrfSpecFeature::Endfuncs
 List of invoke handlers for each feature.

Detailed Description

Helper class to invoke a GrfChangeInfoHandler.

Definition at line 142 of file newgrf_act0.cpp.

Member Typedef Documentation

◆ Invoker

using InvokeGrfChangeInfoHandler::Invoker = ChangeInfoResult(*)(uint first, uint last, int prop, ByteReader &buf, GrfLoadingStage stage)

The function prototype for a change info handler.

Definition at line 164 of file newgrf_act0.cpp.

Member Function Documentation

◆ Invoke() [1/2]

ChangeInfoResult InvokeGrfChangeInfoHandler::Invoke ( GrfSpecFeature feature,
uint first,
uint last,
int prop,
ByteReader & buf,
GrfLoadingStage stage )
inlinestatic

Invoke the change info handler for a specific feature.

Parameters
featureThe feature.
firstThe first id of the feature instance (engine, station, ...) to activate for.
lastThe id to stop iterating at (exclusive).
propThe property to activate for.
bufThe buffer containing the sprite data.
stageThe current loading stage.
Returns
Whether it was successful, or why it wasn't.

Definition at line 186 of file newgrf_act0.cpp.

References funcs, to_underlying(), and Unknown.

◆ Invoke() [2/2]

template<GrfSpecFeature TFeature>
ChangeInfoResult InvokeGrfChangeInfoHandler::Invoke ( uint first,
uint last,
int prop,
ByteReader & buf,
GrfLoadingStage stage )
inlinestatic

Invoke the change info handler for a specific feature.

Template Parameters
TFeatureThe feature.
Parameters
firstThe first id of the feature instance (engine, station, ...) to activate for.
lastThe id to stop iterating at (exclusive).
propThe property to activate for.
bufThe buffer containing the sprite data.
stageThe current loading stage.
Returns
Whether it was successful, or why it wasn't.

Definition at line 154 of file newgrf_act0.cpp.

References GrfChangeInfoHandler< TFeature >::Activation(), Activation, GrfChangeInfoHandler< TFeature >::Reserve(), and Reserve.

Field Documentation

◆ funcs


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