1
0
Fork 0

Add: Add two "tracks": depot and wormhole.

pull/8480/head
Juanjo 2013-12-27 18:30:36 +00:00 committed by J0anJosep
parent d5306c9e55
commit 037d8c6149
1 changed files with 7 additions and 4 deletions

View File

@ -14,7 +14,8 @@
/** /**
* These are used to specify a single track. * These are used to specify a single track.
* Can be translated to a trackbit with TrackToTrackbit * Can be translated to a trackbit with TrackToTrackbit.
* TRACK_WORMHOLE and TRACK_DEPOT do not represent single tracks but states; they cannot be translated to trackbits.
*/ */
enum Track : uint8_t { enum Track : uint8_t {
TRACK_BEGIN = 0, ///< Used for iterations TRACK_BEGIN = 0, ///< Used for iterations
@ -24,7 +25,9 @@ enum Track : uint8_t {
TRACK_LOWER = 3, ///< Track in the lower corner of the tile (south) TRACK_LOWER = 3, ///< Track in the lower corner of the tile (south)
TRACK_LEFT = 4, ///< Track in the left corner of the tile (west) TRACK_LEFT = 4, ///< Track in the left corner of the tile (west)
TRACK_RIGHT = 5, ///< Track in the right corner of the tile (east) TRACK_RIGHT = 5, ///< Track in the right corner of the tile (east)
TRACK_END, ///< Used for iterations TRACK_END = 6, ///< Used for iterations
TRACK_WORMHOLE = TRACK_END,
TRACK_DEPOT = 7,
INVALID_TRACK = 0xFF, ///< Flag for an invalid track INVALID_TRACK = 0xFF, ///< Flag for an invalid track
}; };
@ -49,8 +52,8 @@ enum TrackBits : uint8_t {
TRACK_BIT_3WAY_NW = TRACK_BIT_Y | TRACK_BIT_UPPER | TRACK_BIT_LEFT, ///< "Arrow" to the north-west TRACK_BIT_3WAY_NW = TRACK_BIT_Y | TRACK_BIT_UPPER | TRACK_BIT_LEFT, ///< "Arrow" to the north-west
TRACK_BIT_ALL = TRACK_BIT_CROSS | TRACK_BIT_HORZ | TRACK_BIT_VERT, ///< All possible tracks TRACK_BIT_ALL = TRACK_BIT_CROSS | TRACK_BIT_HORZ | TRACK_BIT_VERT, ///< All possible tracks
TRACK_BIT_MASK = 0x3FU, ///< Bitmask for the first 6 bits TRACK_BIT_MASK = 0x3FU, ///< Bitmask for the first 6 bits
TRACK_BIT_WORMHOLE = 0x40U, ///< Bitflag for a wormhole (used for tunnels) TRACK_BIT_WORMHOLE = 1U << TRACK_WORMHOLE, ///< Bitflag for a wormhole (used for tunnels)
TRACK_BIT_DEPOT = 0x80U, ///< Bitflag for a depot TRACK_BIT_DEPOT = 1U << TRACK_DEPOT, ///< Bitflag for a depot
INVALID_TRACK_BIT = 0xFF, ///< Flag for an invalid trackbits value INVALID_TRACK_BIT = 0xFF, ///< Flag for an invalid trackbits value
}; };
DECLARE_ENUM_AS_BIT_SET(TrackBits) DECLARE_ENUM_AS_BIT_SET(TrackBits)