OpenTTD Source: src/station_type.h File Reference

OpenTTD Source 15.0-beta1

Data Structures | Typedefs | Enumerations | Variables
station_type.h File Reference

Types related to stations. More...

`#include "core/smallstack_type.hpp"`
`#include "tilearea_type.h"`

Go to the source code of this file.

## Data Structures
struct | StationCompare
class | StationFinder
| Structure contains cached list of stations nearby. More...

## Typedefs
typedef uint16_t | StationID
typedef uint16_t | RoadStopID
typedef SmallStack< StationID, StationID, INVALID_STATION, 8, 0xFFFD > | StationIDStack
typedef std::set< Station *, StationCompare > | StationList
| List of stations.

## Enumerations
enum | StationType : uint8_t { STATION_RAIL , STATION_AIRPORT , STATION_TRUCK , STATION_BUS , STATION_OILRIG , STATION_DOCK , STATION_BUOY , STATION_WAYPOINT , STATION_ROADWAYPOINT , STATION_END }
| Station types. More...
enum | RoadStopType : uint8_t { ROADSTOP_BUS , ROADSTOP_TRUCK , ROADSTOP_END }
| Types of RoadStops. More...
enum | StationFacility : uint8_t { FACIL_NONE = 0 , FACIL_TRAIN = 1 << 0 , FACIL_TRUCK_STOP = 1 << 1 , FACIL_BUS_STOP = 1 << 2 , FACIL_AIRPORT = 1 << 3 , FACIL_DOCK = 1 << 4 , FACIL_WAYPOINT = 1 << 7 }
| The facilities a station might be having. More...
enum | StationHadVehicleOfType : uint8_t { HVOT_NONE = 0 , HVOT_TRAIN = 1 << 1 , HVOT_BUS = 1 << 2 , HVOT_TRUCK = 1 << 3 , HVOT_AIRCRAFT = 1 << 4 , HVOT_SHIP = 1 << 5 , HVOT_WAYPOINT = 1 << 6 }
| The vehicles that may have visited a station. More...

## Variables
static const StationID | NEW_STATION = 0xFFFE
static const StationID | INVALID_STATION = 0xFFFF
static constexpr uint | CA_NONE = 0
| Catchment when the station has no facilities.
static constexpr uint | CA_BUS = 3
| Catchment for bus stops with "modified catchment" enabled.
static constexpr uint | CA_TRUCK = 3
| Catchment for truck stops with "modified catchment" enabled.
static constexpr uint | CA_TRAIN = 4
| Catchment for train stations with "modified catchment" enabled.
static constexpr uint | CA_DOCK = 5
| Catchment for docks with "modified catchment" enabled.
static constexpr uint | CA_UNMODIFIED = 4
| Catchment for all stations with "modified catchment" disabled.
static constexpr uint | MAX_CATCHMENT = 10
| Maximum catchment for airports with "modified catchment" enabled.
static const uint | MAX_LENGTH_STATION_NAME_CHARS = 32
| The maximum length of a station name in characters including '\0'.

## Detailed Description

Types related to stations.

Definition in file station_type.h.

## Typedef Documentation

## ◆ RoadStopID

typedef uint16_t RoadStopID

Definition at line 17 of file station_type.h.

## ◆ StationID

typedef uint16_t StationID

Definition at line 16 of file station_type.h.

## ◆ StationIDStack

typedef SmallStack<StationID, StationID, INVALID_STATION, 8, 0xFFFD> StationIDStack

Definition at line 28 of file station_type.h.

## ◆ StationList

typedef std::set<Station *, StationCompare> StationList

List of stations.

Definition at line 94 of file station_type.h.

## Enumeration Type Documentation

## ◆ RoadStopType

enum RoadStopType : uint8_t

Types of RoadStops.

Enumerator
ROADSTOP_BUS | A standard stop for buses.
ROADSTOP_TRUCK | A standard stop for trucks.
ROADSTOP_END | End of valid types.

Definition at line 45 of file station_type.h.

## ◆ StationFacility

enum StationFacility : uint8_t

The facilities a station might be having.

Enumerator
FACIL_NONE | The station has no facilities at all.
FACIL_TRAIN | Station with train station.
FACIL_TRUCK_STOP | Station with truck stops.
FACIL_BUS_STOP | Station with bus stops.
FACIL_AIRPORT | Station with an airport.
FACIL_DOCK | Station with a dock.
FACIL_WAYPOINT | Station is a waypoint.

Definition at line 52 of file station_type.h.

## ◆ StationHadVehicleOfType

enum StationHadVehicleOfType : uint8_t

The vehicles that may have visited a station.

Enumerator
HVOT_NONE | Station has seen no vehicles.
HVOT_TRAIN | Station has seen a train.
HVOT_BUS | Station has seen a bus.
HVOT_TRUCK | Station has seen a truck.
HVOT_AIRCRAFT | Station has seen an aircraft.
HVOT_SHIP | Station has seen a ship.
HVOT_WAYPOINT | Station is a waypoint (NewGRF only!)

Definition at line 64 of file station_type.h.

## ◆ StationType

enum StationType : uint8_t

Station types.

Definition at line 31 of file station_type.h.

## Variable Documentation

## ◆ CA_BUS

constexpr uint CA_BUS = 3
| staticconstexpr

Catchment for bus stops with "modified catchment" enabled.

Definition at line 78 of file station_type.h.

Referenced by Station::GetCatchmentRadius(), GetTileCatchmentRadius(), and BuildRoadStationWindow::OnPaint().

## ◆ CA_DOCK

constexpr uint CA_DOCK = 5
| staticconstexpr

Catchment for docks with "modified catchment" enabled.

Definition at line 81 of file station_type.h.

Referenced by Station::GetCatchmentRadius(), GetTileCatchmentRadius(), and BuildDocksStationWindow::OnPaint().

## ◆ CA_NONE

constexpr uint CA_NONE = 0
| staticconstexpr

Catchment when the station has no facilities.

Definition at line 77 of file station_type.h.

Referenced by Station::GetCatchmentRadius(), GetTileCatchmentRadius(), and Station::RecomputeCatchment().

## ◆ CA_TRAIN

constexpr uint CA_TRAIN = 4
| staticconstexpr

Catchment for train stations with "modified catchment" enabled.

Definition at line 80 of file station_type.h.

Referenced by Station::GetCatchmentRadius(), GetTileCatchmentRadius(), and BuildRailStationWindow::OnPaint().

## ◆ CA_TRUCK

constexpr uint CA_TRUCK = 3
| staticconstexpr

Catchment for truck stops with "modified catchment" enabled.

Definition at line 79 of file station_type.h.

Referenced by Station::GetCatchmentRadius(), GetTileCatchmentRadius(), and BuildRoadStationWindow::OnPaint().

## ◆ CA_UNMODIFIED

constexpr uint CA_UNMODIFIED = 4
| staticconstexpr

Catchment for all stations with "modified catchment" disabled.

Definition at line 83 of file station_type.h.

Referenced by ForAllStationsAroundTiles(), Station::GetCatchmentRadius(), GetTileCatchmentRadius(), BuildAirportWindow::OnPaint(), BuildDocksStationWindow::OnPaint(), BuildRailStationWindow::OnPaint(), and BuildRoadStationWindow::OnPaint().

## ◆ INVALID_STATION

const StationID INVALID_STATION = 0xFFFF
| static

Definition at line 26 of file station_type.h.

## ◆ MAX_CATCHMENT

constexpr uint MAX_CATCHMENT = 10
| staticconstexpr

Maximum catchment for airports with "modified catchment" enabled.

Definition at line 85 of file station_type.h.

Referenced by AirportChangeInfo(), and ForAllStationsAroundTiles().

## ◆ MAX_LENGTH_STATION_NAME_CHARS

const uint MAX_LENGTH_STATION_NAME_CHARS = 32
| static

The maximum length of a station name in characters including '\0'.

Definition at line 87 of file station_type.h.

Referenced by CmdRenameStation(), CmdRenameWaypoint(), StationViewWindow::OnClick(), and WaypointWindow::OnClick().

## ◆ NEW_STATION

const StationID NEW_STATION = 0xFFFE
| static

Definition at line 25 of file station_type.h.