OpenTTD Source: RoadStop::Entry Struct Reference

OpenTTD Source 15.3

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
int | GetLength () const
| Get the length of this drive through stop.
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
uint16_t | length = 0
| The length of the stop in tile 'units'.
uint16_t | occupied = 0
| 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 31 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

  rs | the roadstop this entry is part of

Definition at line 358 of file roadstop.cpp.

References RoadStop::BaseEntry, RoadStop::Entries::east, RoadStop::entries, GetDriveThroughStopAxis(), RoadStop::IsDriveThroughRoadStopContinuation(), IsDriveThroughStopTile(), length, occupied, Rebuild(), RoadStop::status, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileOffsByAxis(), and RoadStop::xy.

## ◆ Enter()

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

Enter the road stop.

Parameters

  rv | the vehicle that enters the stop

Definition at line 277 of file roadstop.cpp.

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

Referenced by RoadStop::Enter().

## ◆ GetLength()

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

Get the length of this drive through stop.

Returns
  the length in tile units.

Definition at line 43 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 52 of file roadstop_base.h.

References occupied.

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

## ◆ Leave()

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

Leave the road stop.

Parameters

  rv | the vehicle that leaves the stop

Definition at line 267 of file roadstop.cpp.

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

Referenced by 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

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

Definition at line 321 of file roadstop.cpp.

References RoadStop::BaseEntry, Crashed, DirToDiagDir(), RoadStop::Entries::east, RoadStop::entries, SpecializedVehicle< T, Type >::From(), GetDriveThroughStopAxis(), GetEntryDirection(), include(), RoadStop::IsDriveThroughRoadStopContinuation(), RVSB_IN_ROAD_STOP, RoadVehicle::state, RoadStop::status, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TILE_SIZE, TileOffsByAxis(), VEH_ROAD, and RoadStop::xy.

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

## Friends And Related Symbol Documentation

## ◆ RoadStop

friend struct RoadStop
| friend

Oh yeah, the road stop may play with me.

Definition at line 37 of file roadstop_base.h.

## Field Documentation

## ◆ length

uint16_t RoadStop::Entry::length = 0
| private

The length of the stop in tile 'units'.

Definition at line 33 of file roadstop_base.h.

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

## ◆ occupied

uint16_t RoadStop::Entry::occupied = 0
| private

The amount of occupied stop in tile 'units'.

Definition at line 34 of file roadstop_base.h.

Referenced by CheckIntegrity(), GetOccupied(), Leave(), and RoadStop::MakeDriveThrough().

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

- src/roadstop_base.h
- src/roadstop.cpp