34 return this->cargospec->
label.base();
45 :
ResolverObject(cs->grffile, callback, callback_param1, callback_param2), cargospec(cs)
59 if (group ==
nullptr)
return 0;
61 return group->GetResult();
65uint16_t GetCargoCallback(
CallbackID callback, uint32_t param1, uint32_t param2,
const CargoSpec *cs)
68 return object.ResolveCallback();
84 std::span<const CargoLabel> cargo_list;
85 if (grffile->grf_version < 7 && !usebit) {
93 if (cargo < cargo_list.size())
return GetCargoTypeByLabel(cargo_list[cargo]);
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
std::span< const CargoLabel > GetClimateDependentCargoTranslationTable()
Get default climate-dependent cargo translation table for a NewGRF, used if the NewGRF does not provi...
std::span< const CargoLabel > GetClimateIndependentCargoTranslationTable()
Get default climate-independent cargo translation table for a NewGRF, used if the NewGRF does not pro...
Functions related to debugging.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
CallbackID
List of implemented NewGRF callbacks.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
CargoType GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit)
Translate a GRF-local cargo slot/bitnum into a CargoType.
SpriteID GetCustomCargoSprite(const CargoSpec *cs)
Get the custom sprite for the given cargo type.
Cargo support for NewGRFs.
A number of safeguards to prevent using unsafe methods.
Definition of base types and functions in a cross-platform compatible way.
uint32_t GetDebugID() const override
Get an identifier for the item being resolved.
CargoResolverObject(const CargoSpec *cs, CallbackID callback=CBID_NO_CALLBACK, uint32_t callback_param1=0, uint32_t callback_param2=0)
Constructor of the cargo resolver.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
Specification of a cargo type.
CargoLabel label
Unique label of the cargo type.
Dynamic data of a loaded NewGRF.
std::vector< CargoLabel > cargo_list
Cargo translation table (local ID -> label)
Interface for SpriteGroup-s to access the gamestate.
uint32_t callback_param2
Second parameter (var 18) of the callback.
CallbackID callback
Callback being resolved.
uint32_t callback_param1
First parameter (var 10) of the callback.
const SpriteGroup * root_spritegroup
Root SpriteGroup to use for resolving.
virtual const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.