OpenTTD
Public Member Functions | Private Attributes | Friends
RoadStop::Entry Struct Reference

Container for each entry point of a drive through road stop. More...

#include <roadstop_base.h>

Public Member Functions

 Entry ()
 Create an entry.
 
int GetLength () const
 Get the length of this drive through stop. More...
 
int GetOccupied () const
 Get the amount of occupied space in this drive through stop. More...
 
void Leave (const RoadVehicle *rv)
 Leave the road stop. More...
 
void Enter (const RoadVehicle *rv)
 Enter the road stop. More...
 
void CheckIntegrity (const RoadStop *rs) const
 Check the integrity of the data in this struct. More...
 
void Rebuild (const RoadStop *rs, int side=-1)
 Rebuild, from scratch, the vehicles and other metadata on this stop. More...
 

Private Attributes

int length
 The length of the stop in tile 'units'.
 
int occupied
 The amount of occupied stop in tile 'units'.
 

Friends

struct RoadStop
 Oh yeah, the road stop may play with me.
 

Detailed Description

Container for each entry point of a drive through road stop.

Definition at line 34 of file roadstop_base.h.

Member Function Documentation

◆ CheckIntegrity()

void RoadStop::Entry::CheckIntegrity ( const RoadStop rs) const

Check the integrity of the data in this struct.

Parameters
rsthe roadstop this entry is part of

Definition at line 382 of file roadstop.cpp.

References HasBit(), RoadStop::RSSFB_BASE_ENTRY, and RoadStop::status.

Referenced by GetOccupied().

◆ Enter()

void RoadStop::Entry::Enter ( const RoadVehicle rv)

Enter the road stop.

Parameters
rvthe vehicle that enters the stop

Definition at line 292 of file roadstop.cpp.

References GroundVehicleCache::cached_total_length, and GroundVehicle< T, Type >::gcache.

Referenced by RoadStop::Enter(), RoadStop::GetEntry(), and GetOccupied().

◆ GetLength()

int RoadStop::Entry::GetLength ( ) const
inline

Get the length of this drive through stop.

Returns
the length in tile units.

Definition at line 49 of file roadstop_base.h.

References length.

Referenced by CYapfCostRoadT< Types >::OneTileCost().

◆ GetOccupied()

int RoadStop::Entry::GetOccupied ( ) const
inline

Get the amount of occupied space in this drive through stop.

Returns
the occupied space in tile units.

Definition at line 58 of file roadstop_base.h.

References CheckIntegrity(), Enter(), Leave(), occupied, and Rebuild().

Referenced by CYapfCostRoadT< Types >::OneTileCost().

◆ Leave()

void RoadStop::Entry::Leave ( const RoadVehicle rv)

Leave the road stop.

Parameters
rvthe vehicle that leaves the stop

Definition at line 282 of file roadstop.cpp.

References GroundVehicleCache::cached_total_length, and GroundVehicle< T, Type >::gcache.

Referenced by RoadStop::GetEntry(), GetOccupied(), and RoadStop::Leave().

◆ Rebuild()

void RoadStop::Entry::Rebuild ( const RoadStop rs,
int  side = -1 
)

Rebuild, from scratch, the vehicles and other metadata on this stop.

Parameters
rsthe roadstop this entry is part of
sidethe side of the road stop to look at

Definition at line 354 of file roadstop.cpp.

Referenced by GetOccupied().


The documentation for this struct was generated from the following files: