OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
33 return this->cargospec->
label;
44 :
ResolverObject(cs->grffile, callback, callback_param1, callback_param2), cargospec(cs)
58 if (group ==
nullptr)
return 0;
60 return group->GetResult();
64 uint16 GetCargoCallback(
CallbackID callback, uint32 param1, uint32 param2,
const CargoSpec *cs)
67 return object.ResolveCallback();
82 if (grffile->grf_version < 7 && !usebit) {
uint32 callback_param1
First parameter (var 10) of the callback.
CargoLabel label
Unique label of the cargo type.
CargoID GetCargoIDByBitnum(uint8 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.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32 callback_param2
Second parameter (var 18) of the callback.
@ 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.
CargoResolverObject(const CargoSpec *cs, CallbackID callback=CBID_NO_CALLBACK, uint32 callback_param1=0, uint32 callback_param2=0)
Constructor of the cargo resolver.
virtual const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
SpriteID GetCustomCargoSprite(const CargoSpec *cs)
Get the custom sprite for the given cargo type.
CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit)
Translate a GRF-local cargo slot/bitnum into a CargoID.
CallbackID callback
Callback being resolved.
std::vector< CargoLabel > cargo_list
Cargo translation table (local ID -> label)
uint32 GetDebugID() const override
Get an identifier for the item being resolved.
byte CargoID
Cargo slots to indicate a cargo type within a game.
@ CT_INVALID
Invalid cargo type.
CargoID GetCargoIDByLabel(CargoLabel cl)
Get the cargo ID by cargo label.
Dynamic data of a loaded NewGRF.