10 #ifndef NEWGRF_STATION_H 11 #define NEWGRF_STATION_H 46 uint32
GetVariable(byte variable, uint32 parameter,
bool *available)
const override;
64 return &this->station_scope;
68 if (tsr !=
nullptr)
return tsr;
111 typedef byte *StationLayout;
167 StationLayout **layouts;
Helper template class that makes basic properties of given enumeration type visible from outsize...
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope)...
Callback 141 needs random bits.
Trigger station when cargo is completely taken.
int AllocateSpecToStation(const StationSpec *statspec, BaseStation *st, bool exec)
Allocate a StationSpec to a Station.
ResolverObject & ro
Surrounding resolver object.
StationScopeResolver station_scope
The station scope resolver.
Interface for SpriteGroup-s to access the gamestate.
Definitions related to NewGRF animation.
Trigger platform when train leaves.
uint32 GetPlatformInfo(Axis axis, byte tile, int platforms, int length, int x, int y, bool centred)
Evaluate a tile's position within a station, and return the result in a bit-stuffed format...
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Set when using the callback resolve system, but not to resolve a callback.
uint32 GetRandomBits() const override
Get a few random bits.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
Common return value for all commands.
Types related to cargoes...
uint tiles
Number of tile layouts.
Callbacks that NewGRFs could implement.
CargoTypes cargo_triggers
Bitmask of cargo types which cause trigger re-randomizing.
SpriteID GetCustomStationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint32 var10=0)
Resolve sprites for drawing a station tile.
uint32 GetTriggers() const override
Get the triggers.
Scope resolver for stations.
Struct containing information relating to NewGRF classes for stations and airports.
byte pylons
Bitmask of base tiles (0 - 7) which should contain elrail pylons.
Types related to stations.
Axis axis
Station axis, used only for the slope check callback.
NewGRFClass< StationSpec, StationClassID, STAT_CLASS_MAX > StationClass
Struct containing information relating to station classes.
GRFFilePropsBase< NUM_CARGO+3 > grf_prop
Properties related the the grf file.
StationSpecFlags
Allow incrementing of StationClassID variables.
Trigger platform when train reserves path.
Scope resolver for a town.
Informative template class exposing basic enumeration properties used by several other templates belo...
void TriggerStationRandomisation(Station *st, TileIndex tile, StationRandomTrigger trigger, CargoID cargo_type=CT_INVALID)
Trigger station randomisation.
byte wires
Bitmask of base tiles (0 - 7) which should contain elrail wires.
TownScopeResolver * town_scope
The town scope resolver (created on the first call).
NewGRF supplied spritelayout.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
TileIndex tile
Tile of the station.
byte flags
Bitmask of flags, bit 0: use different sprite set; bit 1: divide cargo about by station size...
StationAnimationTrigger
Animation triggers for station.
Header file for classes to be used by e.g.
CargoID cargo_type
Type of cargo of the station.
const struct StationSpec * statspec
Station (type) specification.
Trigger platform when train arrives.
RailType
Enumeration for all possible railtypes.
struct BaseStation * st
Instance of the station.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32 TileIndex
The index/ID of a Tile.
Use different sprite set for ground sprites.
Extended foundation block instead of simple.
CommandCost PerformStationTileSlopeCheck(TileIndex north_tile, TileIndex cur_tile, const StationSpec *statspec, Axis axis, byte plat_len, byte numtracks)
Check the slope of a tile of a new station.
Trigger station on new cargo arrival.
Related object of the resolved one.
Trigger platform when train loads/unloads.
Maximum number of classes.
uint16 cargo_threshold
Cargo threshold for choosing between little and lots of cargo.
void StationUpdateCachedTriggers(BaseStation *st)
Update the cached animation trigger bitmask for a station.
StationScopeResolver(ResolverObject &ro, const StationSpec *statspec, BaseStation *st, TileIndex tile)
Constructor for station scopes.
This file simplyfies and embeds a common mechanism of loading/saving and mapping of grf entities...
Information about animation.
void DeallocateSpecFromStation(BaseStation *st, byte specindex)
Deallocate a StationSpec from a Station.
StationRandomTrigger
Randomisation triggers for stations.
CallbackID
List of implemented NewGRF callbacks.
byte callback_mask
Bitmask of station callbacks that have to be called.
byte disallowed_lengths
Bitmask of platform lengths available for the station.
SpriteID GetCustomStationFoundationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint layout, uint edge_info)
Resolve the sprites for custom station foundations.
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Functions to handle the town part of NewGRF towns.
byte CargoID
Cargo slots to indicate a cargo type within a game.
NewGRFSpriteLayout * renderdata
Array of tile layouts.
Divide cargo amount by station size.
StringID name
Name of this station.
Flag for an invalid Axis.
byte disallowed_platforms
Bitmask of number of platforms available for the station.
StationClassID cls_id
The class to which this spec belongs.
bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station)
Draw representation of a station tile for GUI purposes.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override
Get a variable value.
Base class for all station-ish types.
Axis
Allow incrementing of DiagDirDiff variables.
byte blocked
Bitmask of base tiles (0 - 7) which are blocked to trains.
The different types of rail.