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;
|
|
31 |
|
|
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;
|
|
40 |
byte blocked_months;
|
|
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 |
|
|
76 |
void ShowStationViewWindow(int station);
|
|
77 |
void UpdateAllStationVirtCoord();
|
|
78 |
|
|
79 |
VARDEF Station _stations[250];
|
|
80 |
VARDEF bool _station_sort_dirty;
|
|
81 |
|
|
82 |
#define DEREF_STATION(i) (&_stations[i])
|
|
83 |
#define FOR_ALL_STATIONS(st) for(st=_stations; st != endof(_stations); st++)
|
|
84 |
|
|
85 |
|
|
86 |
void GetProductionAroundTiles(uint *produced, uint tile, int w, int h);
|
|
87 |
void GetAcceptanceAroundTiles(uint *accepts, uint tile, int w, int h);
|
|
88 |
uint GetStationPlatforms(Station *st, uint tile);
|
|
89 |
#endif /* STATION_H */
|