#include <station_base.h>
Public Member Functions | |
RoadStop (TileIndex tile=INVALID_TILE) | |
Initializes a RoadStop. | |
virtual | ~RoadStop () |
De-Initializes a RoadStops. | |
bool | IsValid () const |
Determines whether a road stop exists. | |
bool | HasFreeBay () const |
Checks whether there is a free bay in this road stop. | |
bool | IsFreeBay (uint nr) const |
Checks whether the given bay is free in this road stop. | |
uint | AllocateBay () |
Allocates a bay. | |
void | AllocateDriveThroughBay (uint nr) |
Allocates a bay in a drive-through road stop. | |
void | FreeBay (uint nr) |
Frees the given bay. | |
bool | IsEntranceBusy () const |
Checks whether the entrance of the road stop is occupied by a vehicle. | |
void | SetEntranceBusy (bool busy) |
Makes an entrance occupied or free. | |
RoadStop * | GetNextRoadStop (const Vehicle *v) const |
Get the next road stop accessible by this vehicle. | |
Data Fields | |
TileIndex | xy |
Position on the map. | |
byte | status |
Current status of the Stop. Like which spot is taken. Access using *Bay and *Busy functions. | |
byte | num_vehicles |
Number of vehicles currently slotted to this stop. | |
struct RoadStop * | next |
Next stop of the given type at this station. | |
Static Public Attributes | |
static const int | cDebugCtorLevel = 5 |
Debug level on which Contructor / Destructor messages are printed. | |
static const uint | LIMIT = 16 |
The maximum amount of roadstops that are allowed at a single station. | |
static const uint | MAX_BAY_COUNT = 2 |
The maximum number of loading bays. |
Definition at line 51 of file station_base.h.
RoadStop::~RoadStop | ( | ) | [virtual] |
De-Initializes a RoadStops.
This includes clearing all slots that vehicles might have and unlinks it from the linked list of road stops at the given station
Definition at line 448 of file station.cpp.
References cDebugCtorLevel, PoolItem< T, Tid, Tpool >::CleaningPool(), INVALID_TILE, num_vehicles, and xy.
bool RoadStop::IsValid | ( | ) | const [inline] |
Determines whether a road stop exists.
Definition at line 68 of file station_base.h.
References INVALID_TILE, and xy.
uint RoadStop::AllocateBay | ( | ) |
Allocates a bay.
Definition at line 485 of file station.cpp.
References ClrBit(), HasBit(), HasFreeBay(), and status.
void RoadStop::AllocateDriveThroughBay | ( | uint | nr | ) |
Allocates a bay in a drive-through road stop.
nr | the number of the bay to allocate |
Definition at line 501 of file station.cpp.
References ClrBit(), MAX_BAY_COUNT, and status.
void RoadStop::FreeBay | ( | uint | nr | ) |
Frees the given bay.
nr | the number of the bay to free |
Definition at line 511 of file station.cpp.
References MAX_BAY_COUNT, SetBit(), and status.
RoadStop * RoadStop::GetNextRoadStop | ( | const Vehicle * | v | ) | const |
Get the next road stop accessible by this vehicle.
v | the vehicle to get the next road stop for. |
Definition at line 535 of file station.cpp.
References next, and ROADTYPES_NONE.