author | darkvater |
Sun, 14 Nov 2004 01:25:05 +0000 | |
changeset 384 | bf1303e754ff |
parent 243 | 9a40daa560ae |
child 389 | 2d394eeba5e5 |
permissions | -rw-r--r-- |
0 | 1 |
#ifndef STATION_H |
2 |
#define STATION_H |
|
3 |
||
4 |
#include "vehicle.h" |
|
5 |
||
6 |
typedef struct GoodsEntry { |
|
7 |
uint16 waiting_acceptance; |
|
8 |
byte days_since_pickup; |
|
9 |
byte rating; |
|
10 |
byte enroute_from; |
|
11 |
byte enroute_time; |
|
12 |
byte last_speed; |
|
13 |
byte last_age; |
|
14 |
} GoodsEntry; |
|
15 |
||
16 |
struct Station { |
|
17 |
TileIndex xy; |
|
18 |
TileIndex bus_tile; |
|
19 |
TileIndex lorry_tile; |
|
20 |
TileIndex train_tile; |
|
21 |
TileIndex airport_tile; |
|
22 |
TileIndex dock_tile; |
|
23 |
Town *town; |
|
24 |
// alpha_order is obsolete since savegame format 4 |
|
25 |
byte alpha_order_obsolete; |
|
26 |
uint16 string_id; |
|
27 |
||
28 |
ViewportSign sign; |
|
29 |
||
30 |
uint16 had_vehicle_of_type; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
123
diff
changeset
|
31 |
|
0 | 32 |
byte time_since_load; |
33 |
byte time_since_unload; |
|
34 |
byte delete_ctr; |
|
35 |
byte owner; |
|
36 |
byte facilities; |
|
37 |
byte airport_type; |
|
38 |
byte truck_stop_status; |
|
39 |
byte bus_stop_status; |
|
123
d550772c61e6
(svn r124) Prepared code for removal of block_months variable in next major savegame version
dominik
parents:
55
diff
changeset
|
40 |
byte blocked_months_obsolete; |
0 | 41 |
|
42 |
// trainstation width/height |
|
43 |
byte trainst_w, trainst_h; |
|
44 |
||
45 |
byte stat_id, class_id; |
|
46 |
uint16 build_date; |
|
47 |
||
48 |
//uint16 airport_flags; |
|
49 |
uint32 airport_flags; |
|
50 |
uint16 index; |
|
51 |
||
52 |
VehicleID last_vehicle; |
|
53 |
GoodsEntry goods[NUM_CARGO]; |
|
54 |
}; |
|
55 |
||
56 |
enum { |
|
57 |
FACIL_TRAIN = 1, |
|
58 |
FACIL_TRUCK_STOP = 2, |
|
59 |
FACIL_BUS_STOP = 4, |
|
60 |
FACIL_AIRPORT = 8, |
|
61 |
FACIL_DOCK = 0x10, |
|
62 |
}; |
|
63 |
||
64 |
enum { |
|
65 |
// HVOT_PENDING_DELETE = 1<<0, // not needed anymore |
|
66 |
HVOT_TRAIN = 1<<1, |
|
67 |
HVOT_BUS = 1 << 2, |
|
68 |
HVOT_TRUCK = 1 << 3, |
|
69 |
HVOT_AIRCRAFT = 1<<4, |
|
70 |
HVOT_SHIP = 1 << 5, |
|
71 |
HVOT_BUOY = 1 << 6 |
|
72 |
}; |
|
73 |
||
74 |
void ModifyStationRatingAround(TileIndex tile, byte owner, int amount, uint radius); |
|
75 |
||
55
73fae6c6568e
(svn r56) Improved order checker + patch setting for it (celestar)
dominik
parents:
0
diff
changeset
|
76 |
TileIndex GetStationTileForVehicle(Vehicle *v, Station *st); |
73fae6c6568e
(svn r56) Improved order checker + patch setting for it (celestar)
dominik
parents:
0
diff
changeset
|
77 |
|
0 | 78 |
void ShowStationViewWindow(int station); |
79 |
void UpdateAllStationVirtCoord(); |
|
80 |
||
81 |
VARDEF Station _stations[250]; |
|
243
9a40daa560ae
(svn r244) -Fix: Stations were not sorted for non-player-0 players
darkvater
parents:
193
diff
changeset
|
82 |
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
|
83 |
VARDEF bool _global_station_sort_dirty; |
0 | 84 |
|
85 |
#define DEREF_STATION(i) (&_stations[i]) |
|
86 |
#define FOR_ALL_STATIONS(st) for(st=_stations; st != endof(_stations); st++) |
|
87 |
||
88 |
||
89 |
void GetProductionAroundTiles(uint *produced, uint tile, int w, int h); |
|
90 |
void GetAcceptanceAroundTiles(uint *accepts, uint tile, int w, int h); |
|
91 |
uint GetStationPlatforms(Station *st, uint 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
|
92 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
93 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
94 |
typedef struct DrawTileSeqStruct { |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
95 |
int8 delta_x; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
96 |
int8 delta_y; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
97 |
int8 delta_z; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
98 |
byte width,height; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
99 |
byte unk; // 'depth', just z-size; TODO: rename |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
100 |
uint32 image; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
101 |
} DrawTileSeqStruct; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
102 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
103 |
typedef struct DrawTileSprites { |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
104 |
SpriteID ground_sprite; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
105 |
DrawTileSeqStruct const *seq; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
106 |
} DrawTileSprites; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
107 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
108 |
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
109 |
|
0 | 110 |
#endif /* STATION_H */ |