author | peter1138 |
Sun, 03 Aug 2008 17:35:08 +0000 | |
changeset 9834 | 7474149531c1 |
parent 9127 | 14f21c5954ee |
child 10207 | c291a21b304e |
permissions | -rw-r--r-- |
8785
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
1 |
/* $Id$ */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
2 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
3 |
/** @file station_base.h Base classes/functions for stations. */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
4 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
5 |
#ifndef STATION_BASE_H |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
6 |
#define STATION_BASE_H |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
7 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
8 |
#include "station_type.h" |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
9 |
#include "airport.h" |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
10 |
#include "oldpool.h" |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
11 |
#include "cargopacket.h" |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
12 |
#include "cargo_type.h" |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
13 |
#include "town_type.h" |
8787
41d9d5adbe87
(svn r12495) -Codechange: reduce the dependency on newgrf_station.h (especially because newgrf_station.h includes a lot of stuff).
rubidium
parents:
8785
diff
changeset
|
14 |
#include "strings_type.h" |
41d9d5adbe87
(svn r12495) -Codechange: reduce the dependency on newgrf_station.h (especially because newgrf_station.h includes a lot of stuff).
rubidium
parents:
8785
diff
changeset
|
15 |
#include "date_type.h" |
41d9d5adbe87
(svn r12495) -Codechange: reduce the dependency on newgrf_station.h (especially because newgrf_station.h includes a lot of stuff).
rubidium
parents:
8785
diff
changeset
|
16 |
#include "vehicle_type.h" |
41d9d5adbe87
(svn r12495) -Codechange: reduce the dependency on newgrf_station.h (especially because newgrf_station.h includes a lot of stuff).
rubidium
parents:
8785
diff
changeset
|
17 |
#include "player_type.h" |
41d9d5adbe87
(svn r12495) -Codechange: reduce the dependency on newgrf_station.h (especially because newgrf_station.h includes a lot of stuff).
rubidium
parents:
8785
diff
changeset
|
18 |
#include "core/geometry_type.hpp" |
9127
14f21c5954ee
(svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents:
9003
diff
changeset
|
19 |
#include "viewport_type.h" |
8785
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
20 |
#include <list> |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
21 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
22 |
DECLARE_OLD_POOL(Station, Station, 6, 1000) |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
23 |
DECLARE_OLD_POOL(RoadStop, RoadStop, 5, 2000) |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
24 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
25 |
static const byte INITIAL_STATION_RATING = 175; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
26 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
27 |
struct GoodsEntry { |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
28 |
enum AcceptancePickup { |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
29 |
ACCEPTANCE, |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
30 |
PICKUP |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
31 |
}; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
32 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
33 |
GoodsEntry() : |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
34 |
acceptance_pickup(0), |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
35 |
days_since_pickup(255), |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
36 |
rating(INITIAL_STATION_RATING), |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
37 |
last_speed(0), |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
38 |
last_age(255) |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
39 |
{} |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
40 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
41 |
byte acceptance_pickup; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
42 |
byte days_since_pickup; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
43 |
byte rating; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
44 |
byte last_speed; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
45 |
byte last_age; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
46 |
CargoList cargo; ///< The cargo packets of cargo waiting in this station |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
47 |
}; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
48 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
49 |
/** A Stop for a Road Vehicle */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
50 |
struct RoadStop : PoolItem<RoadStop, RoadStopID, &_RoadStop_pool> { |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
51 |
static const int cDebugCtorLevel = 5; ///< Debug level on which Contructor / Destructor messages are printed |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
52 |
static const uint LIMIT = 16; ///< The maximum amount of roadstops that are allowed at a single station |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
53 |
static const uint MAX_BAY_COUNT = 2; ///< The maximum number of loading bays |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
54 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
55 |
TileIndex xy; ///< Position on the map |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
56 |
byte status; ///< Current status of the Stop. Like which spot is taken. Access using *Bay and *Busy functions. |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
57 |
byte num_vehicles; ///< Number of vehicles currently slotted to this stop |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
58 |
struct RoadStop *next; ///< Next stop of the given type at this station |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
59 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
60 |
RoadStop(TileIndex tile = 0); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
61 |
virtual ~RoadStop(); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
62 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
63 |
/** |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
64 |
* Determines whether a road stop exists |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
65 |
* @return true if and only is the road stop exists |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
66 |
*/ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
67 |
inline bool IsValid() const { return this->xy != 0; } |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
68 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
69 |
/* For accessing status */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
70 |
bool HasFreeBay() const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
71 |
bool IsFreeBay(uint nr) const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
72 |
uint AllocateBay(); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
73 |
void AllocateDriveThroughBay(uint nr); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
74 |
void FreeBay(uint nr); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
75 |
bool IsEntranceBusy() const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
76 |
void SetEntranceBusy(bool busy); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
77 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
78 |
RoadStop *GetNextRoadStop(const Vehicle *v) const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
79 |
}; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
80 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
81 |
struct StationSpecList { |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
82 |
const StationSpec *spec; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
83 |
uint32 grfid; ///< GRF ID of this custom station |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
84 |
uint8 localidx; ///< Station ID within GRF of station |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
85 |
}; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
86 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
87 |
/** StationRect - used to track station spread out rectangle - cheaper than scanning whole map */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
88 |
struct StationRect : public Rect { |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
89 |
enum StationRectMode |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
90 |
{ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
91 |
ADD_TEST = 0, |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
92 |
ADD_TRY, |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
93 |
ADD_FORCE |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
94 |
}; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
95 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
96 |
StationRect(); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
97 |
void MakeEmpty(); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
98 |
bool PtInExtendedRect(int x, int y, int distance = 0) const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
99 |
bool IsEmpty() const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
100 |
bool BeforeAddTile(TileIndex tile, StationRectMode mode); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
101 |
bool BeforeAddRect(TileIndex tile, int w, int h, StationRectMode mode); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
102 |
bool AfterRemoveTile(Station *st, TileIndex tile); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
103 |
bool AfterRemoveRect(Station *st, TileIndex tile, int w, int h); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
104 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
105 |
static bool ScanForStationTiles(StationID st_id, int left_a, int top_a, int right_a, int bottom_a); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
106 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
107 |
StationRect& operator = (Rect src); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
108 |
}; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
109 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
110 |
struct Station : PoolItem<Station, StationID, &_Station_pool> { |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
111 |
public: |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
112 |
RoadStop *GetPrimaryRoadStop(RoadStopType type) const |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
113 |
{ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
114 |
return type == ROADSTOP_BUS ? bus_stops : truck_stops; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
115 |
} |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
116 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
117 |
RoadStop *GetPrimaryRoadStop(const Vehicle *v) const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
118 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
119 |
const AirportFTAClass *Airport() const |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
120 |
{ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
121 |
if (airport_tile == 0) return GetAirport(AT_DUMMY); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
122 |
return GetAirport(airport_type); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
123 |
} |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
124 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
125 |
TileIndex xy; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
126 |
RoadStop *bus_stops; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
127 |
RoadStop *truck_stops; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
128 |
TileIndex train_tile; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
129 |
TileIndex airport_tile; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
130 |
TileIndex dock_tile; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
131 |
Town *town; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
132 |
StringID string_id; ///< Default name (town area) of station |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
133 |
char *name; ///< Custom name |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
134 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
135 |
ViewportSign sign; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
136 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
137 |
uint16 had_vehicle_of_type; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
138 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
139 |
byte time_since_load; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
140 |
byte time_since_unload; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
141 |
byte delete_ctr; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
142 |
PlayerByte owner; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
143 |
byte facilities; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
144 |
byte airport_type; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
145 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
146 |
/* trainstation width/height */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
147 |
byte trainst_w, trainst_h; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
148 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
149 |
/** List of custom stations (StationSpecs) allocated to the station */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
150 |
uint8 num_specs; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
151 |
StationSpecList *speclist; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
152 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
153 |
Date build_date; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
154 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
155 |
uint64 airport_flags; ///< stores which blocks on the airport are taken. was 16 bit earlier on, then 32 |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
156 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
157 |
byte last_vehicle_type; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
158 |
std::list<Vehicle *> loading_vehicles; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
159 |
GoodsEntry goods[NUM_CARGO]; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
160 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
161 |
uint16 random_bits; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
162 |
byte waiting_triggers; |
9003
7972fa66d9c9
(svn r12798) -Feature: Add some support for NewGRF station animation. (Thanks to mart3p for samples and fixes)
peter1138
parents:
8787
diff
changeset
|
163 |
uint8 cached_anim_triggers; ///< Combined animation trigger bitmask, used to determine if trigger processing should happen. |
8785
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
164 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
165 |
StationRect rect; ///< Station spread out rectangle (not saved) maintained by StationRect_xxx() functions |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
166 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
167 |
static const int cDebugCtorLevel = 5; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
168 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
169 |
Station(TileIndex tile = 0); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
170 |
virtual ~Station(); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
171 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
172 |
void AddFacility(byte new_facility_bit, TileIndex facil_xy); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
173 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
174 |
/** |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
175 |
* Mark the sign of a station dirty for repaint. |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
176 |
* |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
177 |
* @ingroup dirty |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
178 |
*/ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
179 |
void MarkDirty() const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
180 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
181 |
/** |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
182 |
* Marks the tiles of the station as dirty. |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
183 |
* |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
184 |
* @ingroup dirty |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
185 |
*/ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
186 |
void MarkTilesDirty(bool cargo_change) const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
187 |
bool TileBelongsToRailStation(TileIndex tile) const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
188 |
uint GetPlatformLength(TileIndex tile, DiagDirection dir) const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
189 |
uint GetPlatformLength(TileIndex tile) const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
190 |
bool IsBuoy() const; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
191 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
192 |
/** |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
193 |
* Determines whether a station exists |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
194 |
* @return true if and only is the station exists |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
195 |
*/ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
196 |
inline bool IsValid() const { return this->xy != 0; } |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
197 |
}; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
198 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
199 |
static inline StationID GetMaxStationIndex() |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
200 |
{ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
201 |
/* TODO - This isn't the real content of the function, but |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
202 |
* with the new pool-system this will be replaced with one that |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
203 |
* _really_ returns the highest index. Now it just returns |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
204 |
* the next safe value we are sure about everything is below. |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
205 |
*/ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
206 |
return GetStationPoolSize() - 1; |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
207 |
} |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
208 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
209 |
static inline uint GetNumStations() |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
210 |
{ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
211 |
return GetStationPoolSize(); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
212 |
} |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
213 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
214 |
static inline bool IsValidStationID(StationID index) |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
215 |
{ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
216 |
return index < GetStationPoolSize() && GetStation(index)->IsValid(); |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
217 |
} |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
218 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
219 |
#define FOR_ALL_STATIONS_FROM(st, start) for (st = GetStation(start); st != NULL; st = (st->index + 1U < GetStationPoolSize()) ? GetStation(st->index + 1U) : NULL) if (st->IsValid()) |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
220 |
#define FOR_ALL_STATIONS(st) FOR_ALL_STATIONS_FROM(st, 0) |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
221 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
222 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
223 |
/* Stuff for ROADSTOPS */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
224 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
225 |
#define FOR_ALL_ROADSTOPS_FROM(rs, start) for (rs = GetRoadStop(start); rs != NULL; rs = (rs->index + 1U < GetRoadStopPoolSize()) ? GetRoadStop(rs->index + 1U) : NULL) if (rs->IsValid()) |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
226 |
#define FOR_ALL_ROADSTOPS(rs) FOR_ALL_ROADSTOPS_FROM(rs, 0) |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
227 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
228 |
/* End of stuff for ROADSTOPS */ |
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
229 |
|
871586967963
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium
parents:
diff
changeset
|
230 |
#endif /* STATION_BASE_H */ |