station_type.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef STATION_TYPE_H
00013 #define STATION_TYPE_H
00014
00015 #include "core/enum_type.hpp"
00016 #include "core/smallvec_type.hpp"
00017 #include "tile_type.h"
00018 #include "tilearea_type.h"
00019
00020 typedef uint16 StationID;
00021 typedef uint16 RoadStopID;
00022
00023 struct BaseStation;
00024 struct Station;
00025 struct RoadStop;
00026 struct StationSpec;
00027 struct Waypoint;
00028
00029 static const StationID NEW_STATION = 0xFFFE;
00030 static const StationID INVALID_STATION = 0xFFFF;
00031
00033 enum StationType {
00034 STATION_RAIL,
00035 STATION_AIRPORT,
00036 STATION_TRUCK,
00037 STATION_BUS,
00038 STATION_OILRIG,
00039 STATION_DOCK,
00040 STATION_BUOY,
00041 STATION_WAYPOINT,
00042 };
00043
00045 enum RoadStopType {
00046 ROADSTOP_BUS,
00047 ROADSTOP_TRUCK
00048 };
00049
00051 enum StationFacility {
00052 FACIL_NONE = 0,
00053 FACIL_TRAIN = 1 << 0,
00054 FACIL_TRUCK_STOP = 1 << 1,
00055 FACIL_BUS_STOP = 1 << 2,
00056 FACIL_AIRPORT = 1 << 3,
00057 FACIL_DOCK = 1 << 4,
00058 FACIL_WAYPOINT = 1 << 7,
00059 };
00060 DECLARE_ENUM_AS_BIT_SET(StationFacility);
00061 typedef SimpleTinyEnumT<StationFacility, byte> StationFacilityByte;
00062
00064 enum StationHadVehicleOfType {
00065 HVOT_NONE = 0,
00066 HVOT_TRAIN = 1 << 1,
00067 HVOT_BUS = 1 << 2,
00068 HVOT_TRUCK = 1 << 3,
00069 HVOT_AIRCRAFT = 1 << 4,
00070 HVOT_SHIP = 1 << 5,
00071
00072 HVOT_WAYPOINT = 1 << 6,
00073 };
00074 DECLARE_ENUM_AS_BIT_SET(StationHadVehicleOfType);
00075 typedef SimpleTinyEnumT<StationHadVehicleOfType, byte> StationHadVehicleOfTypeByte;
00076
00078 enum CatchmentArea {
00079 CA_NONE = 0,
00080 CA_BUS = 3,
00081 CA_TRUCK = 3,
00082 CA_TRAIN = 4,
00083 CA_DOCK = 5,
00084
00085 CA_UNMODIFIED = 4,
00086
00087 MAX_CATCHMENT = 10,
00088 };
00089
00090 enum {
00091 MAX_LENGTH_STATION_NAME_BYTES = 31,
00092 MAX_LENGTH_STATION_NAME_PIXELS = 180,
00093 };
00094
00096 typedef SmallVector<Station *, 2> StationList;
00097
00102 class StationFinder : TileArea {
00103 StationList stations;
00104 public:
00109 StationFinder(const TileArea &area) : TileArea(area) {}
00110 const StationList *GetStations();
00111 };
00112
00113 #endif