29 |
29 |
30 /** Road vehicle states */ |
30 /** Road vehicle states */ |
31 enum RoadVehicleStates { |
31 enum RoadVehicleStates { |
32 /* |
32 /* |
33 * Lower 4 bits are used for vehicle track direction. (Trackdirs) |
33 * Lower 4 bits are used for vehicle track direction. (Trackdirs) |
34 * When in a road stop (bit 5 set) these bits give the |
34 * When in a road stop (bit 5 or bit 6 set) these bits give the |
35 * track direction of the entry to the road stop. |
35 * track direction of the entry to the road stop. |
36 * As the entry direction will always be a diagonal |
36 * As the entry direction will always be a diagonal |
37 * direction (X_NE, Y_SE, X_SW or Y_NW) only bits 0 and 3 |
37 * direction (X_NE, Y_SE, X_SW or Y_NW) only bits 0 and 3 |
38 * are needed to hold this direction. Bit 1 is then used to show |
38 * are needed to hold this direction. Bit 1 is then used to show |
39 * that the vehicle is using the second road stop bay. |
39 * that the vehicle is using the second road stop bay. |
|
40 * Bit 2 is then used for drive-through stops to show the vehicle |
|
41 * is stopping at this road stop. |
40 */ |
42 */ |
41 |
43 |
42 /* Numeric values */ |
44 /* Numeric values */ |
43 RVSB_IN_DEPOT = 0xFE, ///< The vehicle is in a depot |
45 RVSB_IN_DEPOT = 0xFE, ///< The vehicle is in a depot |
44 RVSB_WORMHOLE = 0xFF, ///< The vehicle is in a tunnel and/or bridge |
46 RVSB_WORMHOLE = 0xFF, ///< The vehicle is in a tunnel and/or bridge |
45 |
47 |
46 /* Bit numbers */ |
48 /* Bit numbers */ |
47 RVS_USING_SECOND_BAY = 1, ///< Only used while in a road stop |
49 RVS_USING_SECOND_BAY = 1, ///< Only used while in a road stop |
48 RVS_IS_STOPPING = 2, ///< Only used for drive-through stops. Vehicle will stop here |
50 RVS_IS_STOPPING = 2, ///< Only used for drive-through stops. Vehicle will stop here |
49 RVS_DRIVE_SIDE = 4, ///< Only used when retrieving move data and for turning vehicles |
51 RVS_DRIVE_SIDE = 4, ///< Only used when retrieving move data |
50 RVS_IN_ROAD_STOP = 5, ///< The vehicle is in a road stop |
52 RVS_IN_ROAD_STOP = 5, ///< The vehicle is in a road stop |
51 RVS_IN_DT_ROAD_STOP = 6, ///< The vehicle is in a drive-through road stop |
53 RVS_IN_DT_ROAD_STOP = 6, ///< The vehicle is in a drive-through road stop |
52 |
54 |
53 /* Bit sets of the above specified bits */ |
55 /* Bit sets of the above specified bits */ |
54 RVSB_USING_SECOND_BAY = 1 << RVS_USING_SECOND_BAY, ///< Only used while in a road stop |
|
55 RVSB_DRIVE_SIDE = 1 << RVS_DRIVE_SIDE, ///< Only used when retrieving move data and for turning vehicles |
|
56 RVSB_IN_ROAD_STOP = 1 << RVS_IN_ROAD_STOP, ///< The vehicle is in a road stop |
56 RVSB_IN_ROAD_STOP = 1 << RVS_IN_ROAD_STOP, ///< The vehicle is in a road stop |
57 RVSB_IN_ROAD_STOP_END = RVSB_IN_ROAD_STOP + TRACKDIR_END, |
57 RVSB_IN_ROAD_STOP_END = RVSB_IN_ROAD_STOP + TRACKDIR_END, |
58 RVSB_IN_DT_ROAD_STOP = 1 << RVS_IN_DT_ROAD_STOP, ///< The vehicle is in a drive-through road stop |
58 RVSB_IN_DT_ROAD_STOP = 1 << RVS_IN_DT_ROAD_STOP, ///< The vehicle is in a drive-through road stop |
59 RVSB_IN_DT_ROAD_STOP_END = RVSB_IN_DT_ROAD_STOP + TRACKDIR_END, |
59 RVSB_IN_DT_ROAD_STOP_END = RVSB_IN_DT_ROAD_STOP + TRACKDIR_END, |
60 |
60 |