34 |
32 |
35 void ShowDepotWindow(TileIndex tile, VehicleType type); |
33 void ShowDepotWindow(TileIndex tile, VehicleType type); |
36 |
34 |
37 #define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) if (d->IsValid()) |
35 #define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) if (d->IsValid()) |
38 #define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0) |
36 #define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0) |
39 |
|
40 #define MIN_SERVINT_PERCENT 5 |
|
41 #define MAX_SERVINT_PERCENT 90 |
|
42 #define MIN_SERVINT_DAYS 30 |
|
43 #define MAX_SERVINT_DAYS 800 |
|
44 |
|
45 /** |
|
46 * Get the service interval domain. |
|
47 * Get the new proposed service interval for the vehicle is indeed, clamped |
|
48 * within the given bounds. @see MIN_SERVINT_PERCENT ,etc. |
|
49 * @param index proposed service interval |
|
50 * @return service interval |
|
51 */ |
|
52 static inline Date GetServiceIntervalClamped(uint index) |
|
53 { |
|
54 return (_patches.servint_ispercent) ? Clamp(index, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : Clamp(index, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS); |
|
55 } |
|
56 |
37 |
57 /** |
38 /** |
58 * Check if a tile is a depot of the given type. |
39 * Check if a tile is a depot of the given type. |
59 */ |
40 */ |
60 static inline bool IsTileDepotType(TileIndex tile, TransportType type) |
41 static inline bool IsTileDepotType(TileIndex tile, TransportType type) |