12 #ifndef NEWGRF_STATION_H 13 #define NEWGRF_STATION_H 48 uint32
GetVariable(byte variable, uint32 parameter,
bool *available)
const;
66 return &this->station_scope;
70 if (tsr != NULL)
return tsr;
114 typedef byte *StationLayout;
170 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.
RailType
Enumeration for all possible railtypes.
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...
uint32 cargo_triggers
Bitmask of cargo types which cause trigger re-randomizing.
Set when using the callback resolve system, but not to resolve a callback.
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.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Get a variable value.
Callbacks that NewGRFs could implement.
SpriteID GetCustomStationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint32 var10=0)
Resolve sprites for drawing a station tile.
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.
uint32 GetRandomBits() const
Get a few random bits.
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.
Template of struct holding enum types (on most archs, enums are stored in an int32).
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.
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.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
Related object of the resolved one.
Trigger platform when train loads/unloads.
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.
Maximum number of classes.
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.
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.
#define DECLARE_POSTFIX_INCREMENT(type)
Some enums need to have allowed incrementing (i.e.
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.
Base class for all station-ish types.
Axis
Allow incrementing of DiagDirDiff variables.
uint32 GetTriggers() const
Get the triggers.
byte blocked
Bitmask of base tiles (0 - 7) which are blocked to trains.
The different types of rail.