mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-01 19:09:09 +00:00
Codechange: Add Directions and DiagDirections EnumBitSets.
This commit is contained in:
@@ -38,6 +38,11 @@ enum Direction : uint8_t {
|
||||
/** Allow incrementing of Direction variables */
|
||||
DECLARE_INCREMENT_DECREMENT_OPERATORS(Direction)
|
||||
|
||||
using Directions = EnumBitSet<Direction, uint8_t>;
|
||||
|
||||
/** All possible directions. */
|
||||
static constexpr Directions DIRECTIONS_ALL{DIR_N, DIR_NE, DIR_E, DIR_SE, DIR_S, DIR_SW, DIR_W, DIR_NW};
|
||||
|
||||
/**
|
||||
* Enumeration for the difference between two directions.
|
||||
*
|
||||
@@ -82,6 +87,8 @@ enum DiagDirection : uint8_t {
|
||||
DECLARE_INCREMENT_DECREMENT_OPERATORS(DiagDirection)
|
||||
DECLARE_ENUM_AS_ADDABLE(DiagDirection)
|
||||
|
||||
using DiagDirections = EnumBitSet<DiagDirection, uint8_t>;
|
||||
|
||||
/**
|
||||
* Enumeration for the difference between to DiagDirection.
|
||||
*
|
||||
|
Reference in New Issue
Block a user