OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
10 #ifndef NEWGRF_STATION_H
11 #define NEWGRF_STATION_H
46 uint32
GetVariable(
byte variable, uint32 parameter,
bool *available)
const override;
68 if (tsr !=
nullptr)
return tsr;
114 typedef byte *StationLayout;
170 StationLayout **layouts;
180 uint32
GetPlatformInfo(
Axis axis,
byte tile,
int platforms,
int length,
int x,
int y,
bool centred);
uint32 TileIndex
The index/ID of a Tile.
CargoID cargo_type
Type of cargo of the station.
uint32 callback_param1
First parameter (var 10) of the callback.
void StationUpdateCachedTriggers(BaseStation *st)
Update the cached animation trigger bitmask for a station.
byte flags
Bitmask of flags, bit 0: use different sprite set; bit 1: divide cargo about by station size.
SpriteID GetCustomStationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint32 var10=0)
Resolve sprites for drawing a station tile.
NewGRFClass< StationSpec, StationClassID, STAT_CLASS_MAX > StationClass
Struct containing information relating to station classes.
@ SSF_EXTENDED_FOUNDATIONS
Extended foundation block instead of simple.
StationRandomTrigger
Randomisation triggers for stations.
uint32 GetTriggers() const override
Get the triggers.
@ SSF_DIV_BY_STATION_SIZE
Divide cargo amount by station size.
Interface for SpriteGroup-s to access the gamestate.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Information about animation.
const struct StationSpec * statspec
Station (type) specification.
CallbackID
List of implemented NewGRF callbacks.
@ VSG_SCOPE_PARENT
Related object of the resolved one.
@ STAT_CLASS_BEGIN
the lowest valid value
StationScopeResolver station_scope
The station scope resolver.
TownScopeResolver * GetTown()
Get the town scope associated with a station, if it exists.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
@ VSG_SCOPE_SELF
Resolved object itself.
NewGRFSpriteLayout * renderdata
Array of tile layouts.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
@ SSF_SEPARATE_GROUND
Use different sprite set for ground sprites.
@ SSF_CB141_RANDOM_BITS
Callback 141 needs random bits.
void DeallocateSpecFromStation(BaseStation *st, byte specindex)
Deallocate a StationSpec from a Station.
StationScopeResolver(ResolverObject &ro, const StationSpec *statspec, BaseStation *st, TileIndex tile)
Constructor for station scopes.
uint tiles
Number of tile layouts.
StationClassID cls_id
The class to which this spec belongs.
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
uint32 callback_param2
Second parameter (var 18) of the callback.
Informative template class exposing basic enumeration properties used by several other templates belo...
RailType
Enumeration for all possible railtypes.
@ STAT_CLASS_WAYP
Waypoint class.
Common return value for all commands.
Scope resolver for stations.
TownScopeResolver * town_scope
The town scope resolver (created on the first call).
byte pylons
Bitmask of base tiles (0 - 7) which should contain elrail pylons.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
Struct containing information relating to NewGRF classes for stations and airports.
@ SRT_NEW_CARGO
Trigger station on new cargo arrival.
NewGRF supplied spritelayout.
StringID name
Name of this station.
StationSpecFlags
Allow incrementing of StationClassID variables.
@ STAT_CLASS_MAX
Maximum number of classes.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
@ SRT_TRAIN_DEPARTS
Trigger platform when train leaves.
Scope resolver for a town.
byte disallowed_platforms
Bitmask of number of platforms available for the station.
uint32 GetDebugID() const override
Get an identifier for the item being resolved.
const SpriteGroup * ResolveReal(const RealSpriteGroup *group) const override
Get the real sprites of the grf.
int AllocateSpecToStation(const StationSpec *statspec, BaseStation *st, bool exec)
Allocate a StationSpec to a Station.
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.
Axis axis
Station axis, used only for the slope check callback.
@ SSF_CUSTOM_FOUNDATIONS
Draw custom foundations.
@ SRT_CARGO_TAKEN
Trigger station when cargo is completely taken.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
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.
StationAnimationTrigger
Animation triggers for station.
bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station)
Draw representation of a station tile for GUI purposes.
struct BaseStation * st
Instance of the station.
CallbackID callback
Callback being resolved.
uint32 GetRandomBits() const override
Get a few random bits.
Base class for all station-ish types.
Helper template class that makes basic properties of given enumeration type visible from outsize.
uint16 cargo_threshold
Cargo threshold for choosing between little and lots of cargo.
@ SRT_PATH_RESERVATION
Trigger platform when train reserves path.
GRFFilePropsBase< NUM_CARGO+3 > grf_prop
Properties related the the grf file.
byte CargoID
Cargo slots to indicate a cargo type within a game.
Axis
Allow incrementing of DiagDirDiff variables.
byte callback_mask
Bitmask of station callbacks that have to be called.
ResolverObject & ro
Surrounding resolver object.
byte disallowed_lengths
Bitmask of platform lengths available for the station.
@ INVALID_AXIS
Flag for an invalid Axis.
@ CT_INVALID
Invalid cargo type.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override
Get a variable value.
@ STAT_CLASS_DFLT
Default station class.
SpriteID GetCustomStationFoundationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint layout, uint edge_info)
Resolve the sprites for custom station foundations.
StationResolverObject(const StationSpec *statspec, BaseStation *st, TileIndex tile, CallbackID callback=CBID_NO_CALLBACK, uint32 callback_param1=0, uint32 callback_param2=0)
Resolver for stations.
@ SRT_TRAIN_ARRIVES
Trigger platform when train arrives.
CargoTypes cargo_triggers
Bitmask of cargo types which cause trigger re-randomizing.
TileIndex tile
Tile of the station.
byte wires
Bitmask of base tiles (0 - 7) which should contain elrail wires.
byte blocked
Bitmask of base tiles (0 - 7) which are blocked to trains.
void TriggerStationRandomisation(Station *st, TileIndex tile, StationRandomTrigger trigger, CargoID cargo_type=CT_INVALID)
Trigger station randomisation.
@ SRT_TRAIN_LOADS
Trigger platform when train loads/unloads.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.