mirror of https://github.com/OpenTTD/OpenTTD
(svn r12468) -Codechange: move some type related stuff from station.h (and openttd.h) to station_type.h.
parent
7f139373aa
commit
58e6e75320
|
@ -243,6 +243,7 @@ sprite.h
|
||||||
spritecache.h
|
spritecache.h
|
||||||
station.h
|
station.h
|
||||||
station_gui.h
|
station_gui.h
|
||||||
|
station_type.h
|
||||||
stdafx.h
|
stdafx.h
|
||||||
string_func.h
|
string_func.h
|
||||||
string_type.h
|
string_type.h
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "economy_type.h"
|
#include "economy_type.h"
|
||||||
#include "tile_type.h"
|
#include "tile_type.h"
|
||||||
|
#include "station_type.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
typedef uint32 CargoPacketID;
|
typedef uint32 CargoPacketID;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "town_type.h"
|
#include "town_type.h"
|
||||||
#include "industry_type.h"
|
#include "industry_type.h"
|
||||||
#include "player_type.h"
|
#include "player_type.h"
|
||||||
|
#include "station_type.h"
|
||||||
|
|
||||||
struct Player;
|
struct Player;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// Forward declarations of structs.
|
// Forward declarations of structs.
|
||||||
struct Waypoint;
|
struct Waypoint;
|
||||||
struct Station;
|
|
||||||
struct ViewPort;
|
struct ViewPort;
|
||||||
struct DrawPixelInfo;
|
struct DrawPixelInfo;
|
||||||
struct Group;
|
struct Group;
|
||||||
|
@ -22,9 +21,6 @@ typedef uint16 UnitID;
|
||||||
typedef EngineID *EngineList; ///< engine list type placeholder acceptable for C code (see helpers.cpp)
|
typedef EngineID *EngineList; ///< engine list type placeholder acceptable for C code (see helpers.cpp)
|
||||||
|
|
||||||
/* IDs used in Pools */
|
/* IDs used in Pools */
|
||||||
typedef uint16 StationID;
|
|
||||||
static const StationID INVALID_STATION = 0xFFFF;
|
|
||||||
typedef uint16 RoadStopID;
|
|
||||||
typedef uint16 WaypointID;
|
typedef uint16 WaypointID;
|
||||||
typedef uint16 OrderID;
|
typedef uint16 OrderID;
|
||||||
typedef uint16 SignID;
|
typedef uint16 SignID;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#ifndef STATION_H
|
#ifndef STATION_H
|
||||||
#define STATION_H
|
#define STATION_H
|
||||||
|
|
||||||
|
#include "station_type.h"
|
||||||
#include "airport.h"
|
#include "airport.h"
|
||||||
#include "oldpool.h"
|
#include "oldpool.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
|
@ -17,9 +18,6 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
struct Station;
|
|
||||||
struct RoadStop;
|
|
||||||
|
|
||||||
DECLARE_OLD_POOL(Station, Station, 6, 1000)
|
DECLARE_OLD_POOL(Station, Station, 6, 1000)
|
||||||
DECLARE_OLD_POOL(RoadStop, RoadStop, 5, 2000)
|
DECLARE_OLD_POOL(RoadStop, RoadStop, 5, 2000)
|
||||||
|
|
||||||
|
@ -202,48 +200,6 @@ public:
|
||||||
inline bool IsValid() const { return this->xy != 0; }
|
inline bool IsValid() const { return this->xy != 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
enum StationType {
|
|
||||||
STATION_RAIL,
|
|
||||||
STATION_AIRPORT,
|
|
||||||
STATION_TRUCK,
|
|
||||||
STATION_BUS,
|
|
||||||
STATION_OILRIG,
|
|
||||||
STATION_DOCK,
|
|
||||||
STATION_BUOY
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
FACIL_TRAIN = 0x01,
|
|
||||||
FACIL_TRUCK_STOP = 0x02,
|
|
||||||
FACIL_BUS_STOP = 0x04,
|
|
||||||
FACIL_AIRPORT = 0x08,
|
|
||||||
FACIL_DOCK = 0x10,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
// HVOT_PENDING_DELETE = 1 << 0, // not needed anymore
|
|
||||||
HVOT_TRAIN = 1 << 1,
|
|
||||||
HVOT_BUS = 1 << 2,
|
|
||||||
HVOT_TRUCK = 1 << 3,
|
|
||||||
HVOT_AIRCRAFT = 1 << 4,
|
|
||||||
HVOT_SHIP = 1 << 5,
|
|
||||||
/* This bit is used to mark stations. No, it does not belong here, but what
|
|
||||||
* can we do? ;-) */
|
|
||||||
HVOT_BUOY = 1 << 6
|
|
||||||
};
|
|
||||||
|
|
||||||
enum CatchmentArea {
|
|
||||||
CA_NONE = 0,
|
|
||||||
CA_BUS = 3,
|
|
||||||
CA_TRUCK = 3,
|
|
||||||
CA_TRAIN = 4,
|
|
||||||
CA_DOCK = 5,
|
|
||||||
|
|
||||||
CA_UNMODIFIED = 4, ///< Used when _patches.modified_catchment is false
|
|
||||||
|
|
||||||
MAX_CATCHMENT = 10, ///< Airports have a catchment up to this number.
|
|
||||||
};
|
|
||||||
|
|
||||||
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
|
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
|
||||||
|
|
||||||
/** A set of stations (\c const \c Station* ) */
|
/** A set of stations (\c const \c Station* ) */
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/** @file station_type.h Types related to stations. */
|
||||||
|
|
||||||
|
#ifndef STATION_TYPE_H
|
||||||
|
#define STATION_TYPE_H
|
||||||
|
|
||||||
|
typedef uint16 StationID;
|
||||||
|
typedef uint16 RoadStopID;
|
||||||
|
|
||||||
|
struct Station;
|
||||||
|
struct RoadStop;
|
||||||
|
|
||||||
|
static const StationID INVALID_STATION = 0xFFFF;
|
||||||
|
|
||||||
|
enum StationType {
|
||||||
|
STATION_RAIL,
|
||||||
|
STATION_AIRPORT,
|
||||||
|
STATION_TRUCK,
|
||||||
|
STATION_BUS,
|
||||||
|
STATION_OILRIG,
|
||||||
|
STATION_DOCK,
|
||||||
|
STATION_BUOY
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
FACIL_TRAIN = 0x01,
|
||||||
|
FACIL_TRUCK_STOP = 0x02,
|
||||||
|
FACIL_BUS_STOP = 0x04,
|
||||||
|
FACIL_AIRPORT = 0x08,
|
||||||
|
FACIL_DOCK = 0x10,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
// HVOT_PENDING_DELETE = 1 << 0, // not needed anymore
|
||||||
|
HVOT_TRAIN = 1 << 1,
|
||||||
|
HVOT_BUS = 1 << 2,
|
||||||
|
HVOT_TRUCK = 1 << 3,
|
||||||
|
HVOT_AIRCRAFT = 1 << 4,
|
||||||
|
HVOT_SHIP = 1 << 5,
|
||||||
|
/* This bit is used to mark stations. No, it does not belong here, but what
|
||||||
|
* can we do? ;-) */
|
||||||
|
HVOT_BUOY = 1 << 6
|
||||||
|
};
|
||||||
|
|
||||||
|
enum CatchmentArea {
|
||||||
|
CA_NONE = 0,
|
||||||
|
CA_BUS = 3,
|
||||||
|
CA_TRUCK = 3,
|
||||||
|
CA_TRAIN = 4,
|
||||||
|
CA_DOCK = 5,
|
||||||
|
|
||||||
|
CA_UNMODIFIED = 4, ///< Used when _patches.modified_catchment is false
|
||||||
|
|
||||||
|
MAX_CATCHMENT = 10, ///< Airports have a catchment up to this number.
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* STATION_TYPE_H */
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "window_gui.h"
|
#include "window_gui.h"
|
||||||
#include "vehicle_type.h"
|
#include "vehicle_type.h"
|
||||||
|
#include "station_type.h"
|
||||||
|
|
||||||
void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
|
void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
|
||||||
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order);
|
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "oldpool.h"
|
#include "oldpool.h"
|
||||||
#include "rail_map.h"
|
#include "rail_map.h"
|
||||||
#include "command_type.h"
|
#include "command_type.h"
|
||||||
|
#include "station_type.h"
|
||||||
|
|
||||||
struct Waypoint;
|
struct Waypoint;
|
||||||
DECLARE_OLD_POOL(Waypoint, Waypoint, 3, 8000)
|
DECLARE_OLD_POOL(Waypoint, Waypoint, 3, 8000)
|
||||||
|
|
Loading…
Reference in New Issue