12 #ifndef BASE_STATION_BASE_H 13 #define BASE_STATION_BASE_H 41 bool PtInExtendedRect(
int x,
int y,
int distance = 0)
const;
48 static bool ScanForStationTiles(StationID st_id,
int left_a,
int top_a,
int right_a,
int bottom_a);
96 virtual bool TileBelongsToRailStation(
TileIndex tile)
const = 0;
106 virtual uint32 GetNewGRFVariable(
const struct ResolverObject &
object, byte variable, byte parameter,
bool *available)
const = 0;
111 virtual void UpdateVirtCoord() = 0;
127 virtual uint GetPlatformLength(
TileIndex tile)
const = 0;
159 static void PostDestructor(
size_t index);
162 #define FOR_ALL_BASE_STATIONS(var) FOR_ALL_ITEMS_FROM(BaseStation, station_index, var, 0) 168 template <
class T,
bool Tis_waypo
int>
179 this->facilities = EXPECTED_FACIL;
206 static inline T *Get(
size_t index)
215 static inline T *GetIfValid(
size_t index)
217 return IsValidID(index) ? Get(index) : NULL;
237 assert(IsExpected(st));
248 assert(IsExpected(st));
249 return (
const T *)st;
253 #define FOR_ALL_BASE_STATIONS_OF_TYPE(name, var) FOR_ALL_ITEMS_FROM(name, station_index, var, 0) if (name::IsExpected(var))
Maps accessors for stations.
uint8 num_specs
Number of specs in the speclist.
static Titem * Get(size_t index)
Returns Titem with given index.
Interface for SpriteGroup-s to access the gamestate.
bool IsInUse() const
Check whether the base station currently is in use; in use means that it is not scheduled for deletio...
TileArea train_station
Tile area the train 'station' part covers.
static bool IsExpected(const BaseStation *st)
Helper for checking whether the given station is of this type.
StationRect rect
NOSAVE: Station spread out rectangle maintained by StationRect::xxx() functions.
StationFacility
The facilities a station might be having.
BaseStation(TileIndex tile)
Initialize the base station.
StationPool _station_pool
The pool of stations.
Common return value for all commands.
Town * town
The town this station is associated with.
Defintion of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle...
Types related to commands.
byte delete_ctr
Delete counter. If greater than 0 then it is decremented until it reaches 0; the waypoint is then is ...
Types related to viewports.
ViewportSign sign
NOSAVE: Dimensions of sign.
Location information about a sign as seen on the viewport.
Represents the covered area of e.g.
StationSpecList * speclist
List of station specs of this station.
StationRect - used to track station spread out rectangle - cheaper than scanning whole map...
StationFacilityByte facilities
The facilities that this station has.
DiagDirection
Enumeration for diagonal directions.
uint8 cached_anim_triggers
NOSAVE: Combined animation trigger bitmask, used to determine if trigger processing should happen...
uint32 cached_cargo_triggers
NOSAVE: Combined cargo trigger bitmask.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Base class for all PoolItems.
Base class for all pools.
OwnerByte owner
The owner of this station.
static BaseStation * GetByTile(TileIndex tile)
Get the base station belonging to a specific tile.
static StationID GetStationIndex(TileIndex t)
Get StationID from a tile.
StationType
Station types.
uint32 TileIndex
The index/ID of a Tile.
TileIndex xy
Base tile of the station.
static bool IsValidID(size_t index)
Tests whether given index is a valid index for station of this type.
uint8 localidx
Station ID within GRF of station.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-NULL) Titem.
uint16 random_bits
Random bits assigned to this station.
int32 Date
The type to store our dates in.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
Specification of a rectangle with absolute coordinates of all edges.
byte waiting_triggers
Waiting triggers (NewGRF) for this station.
StringID string_id
Default name (town area) of station.
Base class for all station-ish types.
uint32 grfid
GRF ID of this custom station.
The station has no facilities at all.
Class defining several overloaded accessors so we don't have to cast base stations that often...
Date build_date
Date of construction.