author | tron |
Sat, 08 Apr 2006 13:50:01 +0000 | |
changeset 3479 | a4d992b5d24d |
parent 3442 | c494e7246d7b |
child 3554 | c16eadc2d060 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#ifndef STATION_H |
4 |
#define STATION_H |
|
5 |
||
2154
63a6b880b4c0
(svn r2664) Remove depedency on player.h from variables.h
tron
parents:
2049
diff
changeset
|
6 |
#include "player.h" |
1272
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
7 |
#include "pool.h" |
405
6830ae7a0d5d
(svn r602) -newgrf: Move DrawTileSeqStruct & co and struct SpriteGroup to sprite.h (pasky)
darkvater
parents:
403
diff
changeset
|
8 |
#include "sprite.h" |
1247 | 9 |
#include "tile.h" |
0 | 10 |
#include "vehicle.h" |
2963
6645da0a5b4a
(svn r3525) - Rename station_newgrf.[ch] to newgrf_station.[ch], and update project files.
peter1138
parents:
2817
diff
changeset
|
11 |
#include "newgrf_station.h" |
0 | 12 |
|
13 |
typedef struct GoodsEntry { |
|
14 |
uint16 waiting_acceptance; |
|
15 |
byte days_since_pickup; |
|
16 |
byte rating; |
|
3347
d5d8ace1bb13
(svn r4131) - CodeChange: Add proper semantics for StationID for such variables instead of using the general uint16-type. StationID was added for depots, waypoints and stations where necessary. We probably need to change GetDepot(), IsDepotIndex(), IsStationIndex(), GetWaypoint() and IsWaypointIndex() as well to use StationID.
Darkvater
parents:
3333
diff
changeset
|
17 |
StationID enroute_from; |
0 | 18 |
byte enroute_time; |
19 |
byte last_speed; |
|
20 |
byte last_age; |
|
1935
f43f062c9498
(svn r2441) -Feature: You can now give transfer order to set up feeder systems
celestar
parents:
1802
diff
changeset
|
21 |
int32 feeder_profit; |
0 | 22 |
} GoodsEntry; |
23 |
||
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
24 |
typedef enum RoadStopType { |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
25 |
RS_BUS, |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
26 |
RS_TRUCK |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
27 |
} RoadStopType; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
28 |
|
1266
9dc5638fe8cc
(svn r1770) -Fix: Hopefully last pieces of code that are containing a station-id
truelight
parents:
1247
diff
changeset
|
29 |
enum { |
9dc5638fe8cc
(svn r1770) -Fix: Hopefully last pieces of code that are containing a station-id
truelight
parents:
1247
diff
changeset
|
30 |
INVALID_STATION = 0xFFFF, |
3123 | 31 |
ROAD_STOP_LIMIT = 16, |
1266
9dc5638fe8cc
(svn r1770) -Fix: Hopefully last pieces of code that are containing a station-id
truelight
parents:
1247
diff
changeset
|
32 |
}; |
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
33 |
|
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
34 |
typedef struct RoadStop { |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
35 |
TileIndex xy; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
36 |
bool used; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
37 |
byte status; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
38 |
uint32 index; |
3431 | 39 |
byte num_vehicles; |
1551
eb05e6a90e67
(svn r2055) -CodeChange: Begun introducting StationID
celestar
parents:
1550
diff
changeset
|
40 |
StationID station; |
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
41 |
struct RoadStop *next; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
42 |
struct RoadStop *prev; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
43 |
} RoadStop; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
44 |
|
0 | 45 |
struct Station { |
46 |
TileIndex xy; |
|
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
47 |
RoadStop *bus_stops; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
48 |
RoadStop *truck_stops; |
0 | 49 |
TileIndex train_tile; |
50 |
TileIndex airport_tile; |
|
51 |
TileIndex dock_tile; |
|
52 |
Town *town; |
|
53 |
uint16 string_id; |
|
54 |
||
55 |
ViewportSign sign; |
|
56 |
||
57 |
uint16 had_vehicle_of_type; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
123
diff
changeset
|
58 |
|
0 | 59 |
byte time_since_load; |
60 |
byte time_since_unload; |
|
61 |
byte delete_ctr; |
|
2475 | 62 |
PlayerID owner; |
0 | 63 |
byte facilities; |
64 |
byte airport_type; |
|
65 |
||
66 |
// trainstation width/height |
|
67 |
byte trainst_w, trainst_h; |
|
68 |
||
393
82c2bf635cd9
(svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents:
389
diff
changeset
|
69 |
byte class_id; // custom graphics station class |
82c2bf635cd9
(svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents:
389
diff
changeset
|
70 |
byte stat_id; // custom graphics station id in the @class_id class |
0 | 71 |
uint16 build_date; |
72 |
||
73 |
//uint16 airport_flags; |
|
393
82c2bf635cd9
(svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents:
389
diff
changeset
|
74 |
uint32 airport_flags; |
1551
eb05e6a90e67
(svn r2055) -CodeChange: Begun introducting StationID
celestar
parents:
1550
diff
changeset
|
75 |
StationID index; |
0 | 76 |
|
77 |
VehicleID last_vehicle; |
|
78 |
GoodsEntry goods[NUM_CARGO]; |
|
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
79 |
|
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
80 |
/* Stuff that is no longer used, but needed for conversion */ |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
81 |
TileIndex bus_tile_obsolete; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
82 |
TileIndex lorry_tile_obsolete; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
83 |
|
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
84 |
byte truck_stop_status_obsolete; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
85 |
byte bus_stop_status_obsolete; |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
86 |
byte blocked_months_obsolete; |
0 | 87 |
}; |
88 |
||
89 |
enum { |
|
90 |
FACIL_TRAIN = 1, |
|
91 |
FACIL_TRUCK_STOP = 2, |
|
92 |
FACIL_BUS_STOP = 4, |
|
93 |
FACIL_AIRPORT = 8, |
|
94 |
FACIL_DOCK = 0x10, |
|
95 |
}; |
|
96 |
||
97 |
enum { |
|
98 |
// HVOT_PENDING_DELETE = 1<<0, // not needed anymore |
|
99 |
HVOT_TRAIN = 1<<1, |
|
100 |
HVOT_BUS = 1 << 2, |
|
101 |
HVOT_TRUCK = 1 << 3, |
|
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
102 |
HVOT_AIRCRAFT = 1 << 4, |
0 | 103 |
HVOT_SHIP = 1 << 5, |
1751
954dd2900ac9
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1742
diff
changeset
|
104 |
/* This bit is used to mark stations. No, it does not belong here, but what |
954dd2900ac9
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1742
diff
changeset
|
105 |
* can we do? ;-) */ |
0 | 106 |
HVOT_BUOY = 1 << 6 |
107 |
}; |
|
108 |
||
568
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
109 |
enum { |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
110 |
CA_BUS = 3, |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
111 |
CA_TRUCK = 3, |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
112 |
CA_AIR_OILPAD = 3, |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
113 |
CA_TRAIN = 4, |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
114 |
CA_AIR_HELIPORT = 4, |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
115 |
CA_AIR_SMALL = 4, |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
116 |
CA_AIR_LARGE = 5, |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
117 |
CA_DOCK = 5, |
915 | 118 |
CA_AIR_METRO = 6, |
568
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
119 |
CA_AIR_INTER = 8, |
915 | 120 |
}; |
568
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
449
diff
changeset
|
121 |
|
2498
befad2fe53d2
(svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
tron
parents:
2488
diff
changeset
|
122 |
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius); |
0 | 123 |
|
1024
9b06b01490a4
(svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic.
truelight
parents:
919
diff
changeset
|
124 |
TileIndex GetStationTileForVehicle(const Vehicle *v, const Station *st); |
55
73fae6c6568e
(svn r56) Improved order checker + patch setting for it (celestar)
dominik
parents:
0
diff
changeset
|
125 |
|
2498
befad2fe53d2
(svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
tron
parents:
2488
diff
changeset
|
126 |
void ShowStationViewWindow(StationID station); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1024
diff
changeset
|
127 |
void UpdateAllStationVirtCoord(void); |
0 | 128 |
|
919
b0d6c7642f99
(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents:
915
diff
changeset
|
129 |
VARDEF SortStruct *_station_sort; |
b0d6c7642f99
(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents:
915
diff
changeset
|
130 |
|
1272
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
131 |
extern MemoryPool _station_pool; |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
132 |
|
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
133 |
/** |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
134 |
* Get the pointer to the station with index 'index' |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
135 |
*/ |
1551
eb05e6a90e67
(svn r2055) -CodeChange: Begun introducting StationID
celestar
parents:
1550
diff
changeset
|
136 |
static inline Station *GetStation(StationID index) |
919
b0d6c7642f99
(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents:
915
diff
changeset
|
137 |
{ |
1272
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
138 |
return (Station*)GetItemFromPool(&_station_pool, index); |
919
b0d6c7642f99
(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents:
915
diff
changeset
|
139 |
} |
b0d6c7642f99
(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents:
915
diff
changeset
|
140 |
|
1272
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
141 |
/** |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
142 |
* Get the current size of the StationPool |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
143 |
*/ |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
144 |
static inline uint16 GetStationPoolSize(void) |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
145 |
{ |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
146 |
return _station_pool.total_items; |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
147 |
} |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
148 |
|
3347
d5d8ace1bb13
(svn r4131) - CodeChange: Add proper semantics for StationID for such variables instead of using the general uint16-type. StationID was added for depots, waypoints and stations where necessary. We probably need to change GetDepot(), IsDepotIndex(), IsStationIndex(), GetWaypoint() and IsWaypointIndex() as well to use StationID.
Darkvater
parents:
3333
diff
changeset
|
149 |
static inline bool IsStationIndex(StationID index) |
1718
cef0773365eb
(svn r2222) Check the parameters of Cmd{Insert,Delete,Modify,Skip}Order() and CmdRestoreOrderIndex():
tron
parents:
1685
diff
changeset
|
150 |
{ |
cef0773365eb
(svn r2222) Check the parameters of Cmd{Insert,Delete,Modify,Skip}Order() and CmdRestoreOrderIndex():
tron
parents:
1685
diff
changeset
|
151 |
return index < GetStationPoolSize(); |
cef0773365eb
(svn r2222) Check the parameters of Cmd{Insert,Delete,Modify,Skip}Order() and CmdRestoreOrderIndex():
tron
parents:
1685
diff
changeset
|
152 |
} |
cef0773365eb
(svn r2222) Check the parameters of Cmd{Insert,Delete,Modify,Skip}Order() and CmdRestoreOrderIndex():
tron
parents:
1685
diff
changeset
|
153 |
|
1272
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
154 |
#define FOR_ALL_STATIONS_FROM(st, start) for (st = GetStation(start); st != NULL; st = (st->index + 1 < GetStationPoolSize()) ? GetStation(st->index + 1) : NULL) |
d3e09adb7736
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
truelight
parents:
1266
diff
changeset
|
155 |
#define FOR_ALL_STATIONS(st) FOR_ALL_STATIONS_FROM(st, 0) |
919
b0d6c7642f99
(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents:
915
diff
changeset
|
156 |
|
1284
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
157 |
|
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
158 |
/* Stuff for ROADSTOPS */ |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
159 |
|
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
160 |
extern MemoryPool _roadstop_pool; |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
161 |
|
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
162 |
/** |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
163 |
* Get the pointer to the roadstop with index 'index' |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
164 |
*/ |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
165 |
static inline RoadStop *GetRoadStop(uint index) |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
166 |
{ |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
167 |
return (RoadStop*)GetItemFromPool(&_roadstop_pool, index); |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
168 |
} |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
169 |
|
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
170 |
/** |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
171 |
* Get the current size of the RoadStoptPool |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
172 |
*/ |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
173 |
static inline uint16 GetRoadStopPoolSize(void) |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
174 |
{ |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
175 |
return _roadstop_pool.total_items; |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
176 |
} |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
177 |
|
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
178 |
#define FOR_ALL_ROADSTOPS_FROM(rs, start) for (rs = GetRoadStop(start); rs != NULL; rs = (rs->index + 1 < GetRoadStopPoolSize()) ? GetRoadStop(rs->index + 1) : NULL) |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
179 |
#define FOR_ALL_ROADSTOPS(rs) FOR_ALL_ROADSTOPS_FROM(rs, 0) |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
180 |
|
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
181 |
/* End of stuff for ROADSTOPS */ |
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
182 |
|
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
183 |
|
243
9a40daa560ae
(svn r244) -Fix: Stations were not sorted for non-player-0 players
darkvater
parents:
193
diff
changeset
|
184 |
VARDEF bool _station_sort_dirty[MAX_PLAYERS]; |
9a40daa560ae
(svn r244) -Fix: Stations were not sorted for non-player-0 players
darkvater
parents:
193
diff
changeset
|
185 |
VARDEF bool _global_station_sort_dirty; |
0 | 186 |
|
1424
c6d120592e98
(svn r1928) Miscellaneous cleanups (data types, whitespace, const correctness)
tron
parents:
1368
diff
changeset
|
187 |
void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, int w, int h, int rad); |
c6d120592e98
(svn r1928) Miscellaneous cleanups (data types, whitespace, const correctness)
tron
parents:
1368
diff
changeset
|
188 |
void GetAcceptanceAroundTiles(AcceptedCargo accepts, TileIndex tile, int w, int h, int rad); |
2436
177cb6a8339f
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2186
diff
changeset
|
189 |
uint GetStationPlatforms(const Station *st, TileIndex tile); |
384
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
190 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
191 |
|
2520
75eb66d6e371
(svn r3049) Replace byte/int/uint by RailType where appropriate
tron
parents:
2498
diff
changeset
|
192 |
void StationPickerDrawSprite(int x, int y, RailType railtype, int image); |
75eb66d6e371
(svn r3049) Replace byte/int/uint by RailType where appropriate
tron
parents:
2498
diff
changeset
|
193 |
|
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
194 |
RoadStop * GetRoadStopByTile(TileIndex tile, RoadStopType type); |
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
195 |
RoadStop * GetPrimaryRoadStop(const Station *st, RoadStopType type); |
3123 | 196 |
uint GetNumRoadStops(const Station* st, RoadStopType type); |
1284
06a52178bf46
(svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops.
truelight
parents:
1272
diff
changeset
|
197 |
RoadStop * AllocateRoadStop( void ); |
3123 | 198 |
void ClearSlot(Vehicle *v); |
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
199 |
|
1330
8a67d04016ce
(svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents:
1284
diff
changeset
|
200 |
/** |
8a67d04016ce
(svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents:
1284
diff
changeset
|
201 |
* Check if a station really exists. |
8a67d04016ce
(svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents:
1284
diff
changeset
|
202 |
*/ |
1742
ac65066ebfeb
(svn r2246) - CodeChange: Station is 'st' not 'station' - random commit of the day
Darkvater
parents:
1718
diff
changeset
|
203 |
static inline bool IsValidStation(const Station *st) |
1330
8a67d04016ce
(svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents:
1284
diff
changeset
|
204 |
{ |
1742
ac65066ebfeb
(svn r2246) - CodeChange: Station is 'st' not 'station' - random commit of the day
Darkvater
parents:
1718
diff
changeset
|
205 |
return st->xy != 0; /* XXX: Replace by INVALID_TILE someday */ |
1330
8a67d04016ce
(svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents:
1284
diff
changeset
|
206 |
} |
8a67d04016ce
(svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
matthijs
parents:
1284
diff
changeset
|
207 |
|
1751
954dd2900ac9
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1742
diff
changeset
|
208 |
static inline bool IsBuoy(const Station* st) |
954dd2900ac9
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1742
diff
changeset
|
209 |
{ |
954dd2900ac9
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1742
diff
changeset
|
210 |
return st->had_vehicle_of_type & HVOT_BUOY; /* XXX: We should really ditch this ugly coding and switch to something sane... */ |
954dd2900ac9
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1742
diff
changeset
|
211 |
} |
954dd2900ac9
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1742
diff
changeset
|
212 |
|
0 | 213 |
#endif /* STATION_H */ |