10#ifndef ROADSTOP_BASE_H
11#define ROADSTOP_BASE_H
98 default: NOT_REACHED();
166 while (!this->
IsFreeBay(bay_nr)) ++bay_nr;
181 default: NOT_REACHED();
194 default: NOT_REACHED();
Functions related to bit mathematics.
constexpr bool Test(Tvalue_type value) const
Test if the value-th bit is set.
constexpr Timpl & Reset()
Reset all bits.
constexpr Timpl & Set()
Set all bits.
constexpr bool Any(const Timpl &other) const
Test if any of the given values are set.
DiagDirection
Enumeration for diagonal directions.
Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle,...
RoadStopPool _roadstop_pool("RoadStop")
The pool of roadstops.
@ Enter
signal entering the block found
@ Rebuild
rebuild the sort list
Types related to stations.
RoadStopType
Types of RoadStops.
Base class for all PoolItems.
Base class for all pools.
Container for both east and west entry points.
Entry west
Information for vehicles that entered from the west.
Entry east
Information for vehicles that entered from the east.
Container for each entry point of a drive through road stop.
uint16_t occupied
The amount of occupied stop in tile 'units'.
void Leave(const RoadVehicle *rv)
Leave the road stop.
void CheckIntegrity(const RoadStop *rs) const
Check the integrity of the data in this struct.
int GetOccupied() const
Get the amount of occupied space in this drive through stop.
int GetLength() const
Get the length of this drive through stop.
uint16_t length
The length of the stop in tile 'units'.
A Stop for a Road Vehicle.
void SetEntranceBusy(bool busy)
Makes an entrance occupied or free.
RoadStop(TileIndex tile=INVALID_TILE)
Initializes a RoadStop.
@ BaseEntry
Non-zero when the entries on this road stop are the primary, i.e. the ones to delete.
@ EntryBusy
Non-zero when roadstop entry is busy.
@ Bay0Free
Non-zero when bay 0 is free.
@ Bay1Free
Non-zero when bay 1 is free.
bool IsFreeBay(uint nr) const
Checks whether the given bay is free in this road stop.
void Leave(RoadVehicle *rv)
Leave the road stop.
RoadStop * next
Next stop of the given type at this station.
Entries * entries
Information about available and allocated bays.
uint AllocateBay()
Allocates a bay.
RoadStop * GetNextRoadStop(const struct RoadVehicle *v) const
Get the next road stop accessible by this vehicle.
~RoadStop()
De-Initializes RoadStops.
bool HasFreeBay() const
Checks whether there is a free bay in this road stop.
void AllocateDriveThroughBay(uint nr)
Allocates a bay in a drive-through road stop.
void FreeBay(uint nr)
Frees the given bay.
Entry & GetEntry(DiagDirection dir)
Get the drive through road stop entry struct for the given direction.
TileIndex xy
Position on the map.
bool IsEntranceBusy() const
Checks whether the entrance of the road stop is occupied by a vehicle.
RoadStopStatusFlags status
Current status of the Stop. Access using *Bay and *Busy functions.
const Entry & GetEntry(DiagDirection dir) const
Get the drive through road stop entry struct for the given direction.
static bool IsDriveThroughRoadStopContinuation(TileIndex rs, TileIndex next)
Checks whether the 'next' tile is still part of the road same drive through stop 'rs' in the same dir...
static RoadStop * GetByTile(TileIndex tile, RoadStopType type)
Find a roadstop at given tile.
void MakeDriveThrough()
Join this road stop to another 'base' road stop if possible; fill all necessary data to become an act...
void ClearDriveThrough()
Prepare for removal of this stop; update other neighbouring stops if needed.
Buses, trucks and trams belong to this class.
constexpr TileIndex INVALID_TILE
The very nice invalid tile marker.
Types related to vehicles.