10#ifndef NEWGRF_RAILTYPE_H
11#define NEWGRF_RAILTYPE_H
35 uint32_t
GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter,
bool &available)
const override;
This struct contains all the info that is needed to draw and construct tracks.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
This file simplyfies and embeds a common mechanism of loading/saving and mapping of grf entities.
TileContext
Context for tile accesses.
@ TCX_NORMAL
Nothing special.
SpriteID GetCustomRailSprite(const RailTypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context=TCX_NORMAL, uint *num_results=nullptr)
Get the sprite to draw for the given tile.
uint8_t GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile)
Perform a reverse railtype lookup to get the GRF internal ID.
SpriteID GetCustomSignalSprite(const RailTypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, SignalState state, bool gui=false)
Get the sprite to draw for a given signal.
RailType GetRailTypeTranslation(uint8_t railtype, const GRFFile *grffile)
Translate an index to the GRF-local railtype-translation table into a RailType.
@ VSG_SCOPE_SELF
Resolved object itself.
RailTypeSpriteGroup
Sprite groups for a railtype.
RailType
Enumeration for all possible railtypes.
SignalType
Type of signal, i.e.
SignalState
These are states in which a signal can be.
SignalVariant
Variant of the signal, i.e.
Dynamic data of a loaded NewGRF.
Resolver object for rail types.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
uint32_t GetDebugID() const override
Get an identifier for the item being resolved.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
RailTypeScopeResolver railtype_scope
Resolver for the railtype scope.
Resolver for the railtype scope.
uint32_t GetVariable(uint8_t variable, uint32_t parameter, bool &available) const override
Get a variable value.
RailTypeScopeResolver(ResolverObject &ro, const RailTypeInfo *rti, TileIndex tile, TileContext context)
Constructor of the railtype scope resolvers.
TileContext context
Are we resolving sprites for the upper halftile, or on a bridge?
uint32_t GetRandomBits() const override
Get a few random bits.
TileIndex tile
Tracktile. For track on a bridge this is the southern bridgehead.
Interface for SpriteGroup-s to access the gamestate.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0)
Get a resolver for the scope.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
ResolverObject & ro
Surrounding resolver object.