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.
FORCEINLINE int GetLength () const
 Get the length of this drive through stop.
FORCEINLINE int GetOccupied () const
 Get the amount of occupied space in this drive through stop.
void Leave (const RoadVehicle *rv)
 Leave the road stop.
void Enter (const RoadVehicle *rv)
 Enter the road stop.
void CheckIntegrity (const RoadStop *rs) const
 Check the integrity of the data in this struct.
void Rebuild (const RoadStop *rs, int side=-1)
 Rebuild, from scratch, the vehicles and other metadata on this stop.

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

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

Check the integrity of the data in this struct.

Parameters:
rs the roadstop this entry is part of

Definition at line 379 of file roadstop.cpp.

References abs(), RoadStop::east, GetRoadStopDir(), HasBit(), RoadStop::IsDriveThroughRoadStopContinuation(), length, occupied, Rebuild(), RoadStop::RSSFB_BASE_ENTRY, RoadStop::status, TileOffsByDiagDir(), and RoadStop::xy.

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

Enter the road stop.

Parameters:
rv the vehicle that enters the stop

Definition at line 289 of file roadstop.cpp.

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

Referenced by RoadStop::Enter().

FORCEINLINE 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().

FORCEINLINE 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 occupied.

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

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

Leave the road stop.

Parameters:
rv the vehicle that leaves the stop

Definition at line 279 of file roadstop.cpp.

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

Referenced by RoadStop::Leave().

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

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

Parameters:
rs the roadstop this entry is part of
side the side of the road stop to look at

Definition at line 351 of file roadstop.cpp.

References abs(), RoadStopEntryRebuilderHelper::dir, RoadStop::east, FindVehicleOnPos(), FindVehiclesInRoadStop(), GetRoadStopDir(), HasBit(), RoadStop::IsDriveThroughRoadStopContinuation(), length, occupied, ReverseDiagDir(), RoadStop::RSSFB_BASE_ENTRY, RoadStop::status, TILE_SIZE, TileOffsByDiagDir(), RoadStopEntryRebuilderHelper::vehicles, and RoadStop::xy.

Referenced by CheckIntegrity(), and RoadStop::ClearDriveThrough().


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

Generated on Fri Mar 4 21:38:16 2011 for OpenTTD by  doxygen 1.6.1