OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
33 return this->cargospec->
label.base();
44 :
ResolverObject(cs->grffile, callback, callback_param1, callback_param2), cargospec(cs)
58 if (group ==
nullptr)
return 0;
60 return group->GetResult();
64 uint16_t GetCargoCallback(
CallbackID callback, uint32_t param1, uint32_t param2,
const CargoSpec *cs)
67 return object.ResolveCallback();
82 if (grffile->grf_version < 7 && !usebit) {
92 if (cargo < grffile->cargo_list.size())
return GetCargoIDByLabel(grffile->
cargo_list[cargo]);
CargoLabel label
Unique label of the cargo type.
CargoID GetCargoIDByBitnum(uint8_t bitnum)
Find the CargoID of a 'bitnum' value.
static CargoSpec * Get(size_t index)
Retrieve cargo details for the given cargo ID.
Interface for SpriteGroup-s to access the gamestate.
Specification of a cargo type.
CallbackID
List of implemented NewGRF callbacks.
static size_t GetArraySize()
Total number of cargospecs, both valid and invalid.
uint32_t GetDebugID() const override
Get an identifier for the item being resolved.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
const SpriteGroup * root_spritegroup
Root SpriteGroup to use for resolving.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
SpriteID GetCustomCargoSprite(const CargoSpec *cs)
Get the custom sprite for the given cargo type.
uint32_t callback_param2
Second parameter (var 18) of the callback.
CargoResolverObject(const CargoSpec *cs, CallbackID callback=CBID_NO_CALLBACK, uint32_t callback_param1=0, uint32_t callback_param2=0)
Constructor of the cargo resolver.
CallbackID callback
Callback being resolved.
uint32_t callback_param1
First parameter (var 10) of the callback.
uint8_t CargoID
Cargo slots to indicate a cargo type within a game.
std::vector< CargoLabel > cargo_list
Cargo translation table (local ID -> label)
virtual const SpriteGroup * Resolve([[maybe_unused]] ResolverObject &object) const
Base sprite group resolver.
CargoID GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit)
Translate a GRF-local cargo slot/bitnum into a CargoID.
Dynamic data of a loaded NewGRF.