OpenTTD
station_type.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * 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.
4  * 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.
5  * 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/>.
6  */
7 
10 #ifndef STATION_TYPE_H
11 #define STATION_TYPE_H
12 
13 #include "core/smallstack_type.hpp"
14 #include "tilearea_type.h"
15 #include <set>
16 
17 typedef uint16 StationID;
18 typedef uint16 RoadStopID;
19 
20 struct BaseStation;
21 struct Station;
22 struct RoadStop;
23 struct StationSpec;
24 struct Waypoint;
25 
26 static const StationID NEW_STATION = 0xFFFE;
27 static const StationID INVALID_STATION = 0xFFFF;
28 
30 
33  STATION_RAIL,
34  STATION_AIRPORT,
35  STATION_TRUCK,
36  STATION_BUS,
37  STATION_OILRIG,
38  STATION_DOCK,
39  STATION_BUOY,
40  STATION_WAYPOINT,
41 };
42 
47 };
48 
50 enum StationFacility : byte {
51  FACIL_NONE = 0,
52  FACIL_TRAIN = 1 << 0,
53  FACIL_TRUCK_STOP = 1 << 1,
54  FACIL_BUS_STOP = 1 << 2,
55  FACIL_AIRPORT = 1 << 3,
56  FACIL_DOCK = 1 << 4,
57  FACIL_WAYPOINT = 1 << 7,
58 };
60 
61 
63  HVOT_NONE = 0,
64  HVOT_TRAIN = 1 << 1,
65  HVOT_BUS = 1 << 2,
66  HVOT_TRUCK = 1 << 3,
67  HVOT_AIRCRAFT = 1 << 4,
68  HVOT_SHIP = 1 << 5,
69 
70  HVOT_WAYPOINT = 1 << 6,
71 };
73 
74 
76  CA_NONE = 0,
77  CA_BUS = 3,
78  CA_TRUCK = 3,
79  CA_TRAIN = 4,
80  CA_DOCK = 5,
81 
83 
85 };
86 
87 static const uint MAX_LENGTH_STATION_NAME_CHARS = 32;
88 
90  bool operator() (const Station *lhs, const Station *rhs) const;
91 };
92 
94 typedef std::set<Station *, StationCompare> StationList;
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:46
Minimal stack that uses a pool to avoid pointers.
StationList stations
List of stations nearby.
Definition: station_type.h:101
Station has seen a ship.
Definition: station_type.h:68
StationFinder(const TileArea &area)
Constructs StationFinder.
Definition: station_type.h:107
Station has seen no vehicles.
Definition: station_type.h:63
Station specification.
Minimal stack that uses a pool to avoid pointers and doesn&#39;t allocate any heap memory if there is onl...
The station has no facilities at all.
Definition: station_type.h:51
A standard stop for buses.
Definition: station_type.h:45
Station has seen a train.
Definition: station_type.h:64
CatchmentArea
The different catchment areas used.
Definition: station_type.h:75
Representation of a waypoint.
Definition: waypoint_base.h:16
Catchment for bus stops with "modified catchment" enabled.
Definition: station_type.h:77
std::set< Station *, StationCompare > StationList
List of stations.
Definition: station_type.h:94
RoadStopType
Types of RoadStops.
Definition: station_type.h:44
Station is a waypoint (NewGRF only!)
Definition: station_type.h:70
Station has seen a truck.
Definition: station_type.h:66
Represents the covered area of e.g.
Definition: tilearea_type.h:16
Catchment for truck stops with "modified catchment" enabled.
Definition: station_type.h:78
Catchment for all stations with "modified catchment" disabled.
Definition: station_type.h:82
Station with an airport.
Definition: station_type.h:55
Catchment for docks with "modified catchment" enabled.
Definition: station_type.h:80
Catchment when the station has no facilities.
Definition: station_type.h:76
Station with a dock.
Definition: station_type.h:56
StationType
Station types.
Definition: station_type.h:32
Station has seen a bus.
Definition: station_type.h:65
StationFacility
The facilities a station might be having.
Definition: station_type.h:50
Station has seen an aircraft.
Definition: station_type.h:67
Catchment for train stations with "modified catchment" enabled.
Definition: station_type.h:79
Station is a waypoint.
Definition: station_type.h:57
Type for storing the &#39;area&#39; of something uses on the map.
A Stop for a Road Vehicle.
Definition: roadstop_base.h:22
Station with bus stops.
Definition: station_type.h:54
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:87
Station with truck stops.
Definition: station_type.h:53
Station with train station.
Definition: station_type.h:52
Maximum catchment for airports with "modified catchment" enabled.
Definition: station_type.h:84
StationHadVehicleOfType
The vehicles that may have visited a station.
Definition: station_type.h:62
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:450