OpenTTD
station_type.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef STATION_TYPE_H
13 #define STATION_TYPE_H
14 
15 #include "core/smallvec_type.hpp"
16 #include "core/smallstack_type.hpp"
17 #include "tilearea_type.h"
18 
19 typedef uint16 StationID;
20 typedef uint16 RoadStopID;
21 
22 struct BaseStation;
23 struct Station;
24 struct RoadStop;
25 struct StationSpec;
26 struct Waypoint;
27 
28 static const StationID NEW_STATION = 0xFFFE;
29 static const StationID INVALID_STATION = 0xFFFF;
30 
32 
35  STATION_RAIL,
36  STATION_AIRPORT,
37  STATION_TRUCK,
38  STATION_BUS,
39  STATION_OILRIG,
40  STATION_DOCK,
41  STATION_BUOY,
42  STATION_WAYPOINT,
43 };
44 
49 };
50 
53  FACIL_NONE = 0,
54  FACIL_TRAIN = 1 << 0,
55  FACIL_TRUCK_STOP = 1 << 1,
56  FACIL_BUS_STOP = 1 << 2,
57  FACIL_AIRPORT = 1 << 3,
58  FACIL_DOCK = 1 << 4,
59  FACIL_WAYPOINT = 1 << 7,
60 };
63 
66  HVOT_NONE = 0,
67  HVOT_TRAIN = 1 << 1,
68  HVOT_BUS = 1 << 2,
69  HVOT_TRUCK = 1 << 3,
70  HVOT_AIRCRAFT = 1 << 4,
71  HVOT_SHIP = 1 << 5,
72 
73  HVOT_WAYPOINT = 1 << 6,
74 };
77 
80  CA_NONE = 0,
81  CA_BUS = 3,
82  CA_TRUCK = 3,
83  CA_TRAIN = 4,
84  CA_DOCK = 5,
85 
87 
89 };
90 
91 static const uint MAX_LENGTH_STATION_NAME_CHARS = 32;
92 
95 
102 public:
107  StationFinder(const TileArea &area) : TileArea(area) {}
108  const StationList *GetStations();
109 };
110 
111 #endif /* STATION_TYPE_H */
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
A standard stop for trucks.
Definition: station_type.h:48
Minimal stack that uses a pool to avoid pointers.
StationList stations
List of stations nearby.
Definition: station_type.h:101
Simple vector class that allows allocating an item without the need to copy this->data needlessly...
StationFinder(const TileArea &area)
Constructs StationFinder.
Definition: station_type.h:107
Station has seen a ship.
Definition: station_type.h:71
Station specification.
Minimal stack that uses a pool to avoid pointers and doesn&#39;t allocate any heap memory if there is onl...
Station has seen an aircraft.
Definition: station_type.h:70
A standard stop for buses.
Definition: station_type.h:47
StationFacility
The facilities a station might be having.
Definition: station_type.h:52
CatchmentArea
The different catchment areas used.
Definition: station_type.h:79
Representation of a waypoint.
Definition: waypoint_base.h:18
Catchment for bus stops with "modified catchment" enabled.
Definition: station_type.h:81
RoadStopType
Types of RoadStops.
Definition: station_type.h:46
Station is a waypoint (NewGRF only!)
Definition: station_type.h:73
Station is a waypoint.
Definition: station_type.h:59
const StationList * GetStations()
Run a tile loop to find stations around a tile, on demand.
Station with truck stops.
Definition: station_type.h:55
Represents the covered area of e.g.
Definition: tilearea_type.h:18
StationHadVehicleOfType
The vehicles that may have visited a station.
Definition: station_type.h:65
Station has seen a bus.
Definition: station_type.h:68
Station has seen a truck.
Definition: station_type.h:69
Catchment for truck stops with "modified catchment" enabled.
Definition: station_type.h:82
Catchment for all stations with "modified catchment" disabled.
Definition: station_type.h:86
Station with a dock.
Definition: station_type.h:58
Station has seen no vehicles.
Definition: station_type.h:66
Catchment for docks with "modified catchment" enabled.
Definition: station_type.h:84
Catchment when the station has no facilities.
Definition: station_type.h:80
StationType
Station types.
Definition: station_type.h:34
Station has seen a train.
Definition: station_type.h:67
Catchment for train stations with "modified catchment" enabled.
Definition: station_type.h:83
Station with train station.
Definition: station_type.h:54
Type for storing the &#39;area&#39; of something uses on the map.
A Stop for a Road Vehicle.
Definition: roadstop_base.h:24
Station with bus stops.
Definition: station_type.h:56
static const uint MAX_LENGTH_STATION_NAME_CHARS
The maximum length of a station name in characters including &#39;\0&#39;.
Definition: station_type.h:91
SmallVector< Station *, 2 > StationList
List of stations.
Definition: station_type.h:94
Maximum catchment for airports with "modified catchment" enabled.
Definition: station_type.h:88
Structure contains cached list of stations nearby.
Definition: station_type.h:100
Base class for all station-ish types.
Station data structure.
Definition: station_base.h:446
Station with an airport.
Definition: station_type.h:57
The station has no facilities at all.
Definition: station_type.h:53