10 #ifndef BASE_STATION_BASE_H 11 #define BASE_STATION_BASE_H 39 bool PtInExtendedRect(
int x,
int y,
int distance = 0)
const;
46 static bool ScanForStationTiles(StationID st_id,
int left_a,
int top_a,
int right_a,
int bottom_a);
94 virtual bool TileBelongsToRailStation(
TileIndex tile)
const = 0;
104 virtual uint32 GetNewGRFVariable(
const struct ResolverObject &
object, byte variable, byte parameter,
bool *available)
const = 0;
109 virtual void UpdateVirtCoord() = 0;
114 this->UpdateVirtCoord();
131 virtual uint GetPlatformLength(
TileIndex tile)
const = 0;
163 static void PostDestructor(
size_t index);
170 template <
class T,
bool Tis_waypo
int>
181 this->facilities = EXPECTED_FACIL;
208 static inline T *Get(
size_t index)
217 static inline T *GetIfValid(
size_t index)
219 return IsValidID(index) ? Get(index) :
nullptr;
239 assert(IsExpected(st));
250 assert(IsExpected(st));
251 return (
const T *)st;
Owner
Enum for all companies/owners.
StationFacility facilities
The facilities that this station has.
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...
The station has no facilities at all.
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.
BaseStation(TileIndex tile)
Initialize the base station.
StationPool _station_pool
The pool of stations.
static Pool::IterateWrapper< T > Iterate(size_t from=0)
Returns an iterable ensemble of all valid stations of type T.
Common return value for all commands.
Town * town
The town this station is associated with.
Definition 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 ...
Specialised ViewportSign that tracks whether it is valid for entering into a Kdtree.
Types related to viewports.
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...
uint8 cached_anim_triggers
NOSAVE: Combined animation trigger bitmask, used to determine if trigger processing should happen...
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Base class for all PoolItems.
Base class for all pools.
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.
StationFacility
The facilities a station might be having.
uint32 TileIndex
The index/ID of a Tile.
CargoTypes cached_cargo_triggers
NOSAVE: Combined cargo trigger bitmask.
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.
Owner owner
The owner of this station.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
uint16 random_bits
Random bits assigned to this station.
int32 Date
The type to store our dates in.
DiagDirection
Enumeration for diagonal directions.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
Specification of a rectangle with absolute coordinates of all edges.
TrackedViewportSign sign
NOSAVE: Dimensions of sign.
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.
Class defining several overloaded accessors so we don't have to cast base stations that often...
Date build_date
Date of construction.