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/smallvec_type.hpp"
00016 #include "tilearea_type.h"
00017
00018 typedef uint16 StationID;
00019 typedef uint16 RoadStopID;
00020
00021 struct BaseStation;
00022 struct Station;
00023 struct RoadStop;
00024 struct StationSpec;
00025 struct Waypoint;
00026
00027 static const StationID NEW_STATION = 0xFFFE;
00028 static const StationID INVALID_STATION = 0xFFFF;
00029
00031 enum StationType {
00032 STATION_RAIL,
00033 STATION_AIRPORT,
00034 STATION_TRUCK,
00035 STATION_BUS,
00036 STATION_OILRIG,
00037 STATION_DOCK,
00038 STATION_BUOY,
00039 STATION_WAYPOINT,
00040 };
00041
00043 enum RoadStopType {
00044 ROADSTOP_BUS,
00045 ROADSTOP_TRUCK
00046 };
00047
00049 enum StationFacility {
00050 FACIL_NONE = 0,
00051 FACIL_TRAIN = 1 << 0,
00052 FACIL_TRUCK_STOP = 1 << 1,
00053 FACIL_BUS_STOP = 1 << 2,
00054 FACIL_AIRPORT = 1 << 3,
00055 FACIL_DOCK = 1 << 4,
00056 FACIL_WAYPOINT = 1 << 7,
00057 };
00058 DECLARE_ENUM_AS_BIT_SET(StationFacility)
00059 typedef SimpleTinyEnumT<StationFacility, byte> StationFacilityByte;
00060
00062 enum StationHadVehicleOfType {
00063 HVOT_NONE = 0,
00064 HVOT_TRAIN = 1 << 1,
00065 HVOT_BUS = 1 << 2,
00066 HVOT_TRUCK = 1 << 3,
00067 HVOT_AIRCRAFT = 1 << 4,
00068 HVOT_SHIP = 1 << 5,
00069
00070 HVOT_WAYPOINT = 1 << 6,
00071 };
00072 DECLARE_ENUM_AS_BIT_SET(StationHadVehicleOfType)
00073 typedef SimpleTinyEnumT<StationHadVehicleOfType, byte> StationHadVehicleOfTypeByte;
00074
00076 enum CatchmentArea {
00077 CA_NONE = 0,
00078 CA_BUS = 3,
00079 CA_TRUCK = 3,
00080 CA_TRAIN = 4,
00081 CA_DOCK = 5,
00082
00083 CA_UNMODIFIED = 4,
00084
00085 MAX_CATCHMENT = 10,
00086 };
00087
00088 static const uint MAX_LENGTH_STATION_NAME_CHARS = 32;
00089 static const uint MAX_LENGTH_STATION_NAME_PIXELS = 180;
00090
00092 typedef SmallVector<Station *, 2> StationList;
00093
00098 class StationFinder : TileArea {
00099 StationList stations;
00100 public:
00105 StationFinder(const TileArea &area) : TileArea(area) {}
00106 const StationList *GetStations();
00107 };
00108
00109 #endif