|
OpenTTD Source 20260531-master-g0e951f3528
|
Different types to 'show' directions. More...
#include "core/enum_type.hpp"Go to the source code of this file.
Typedefs | |
| using | Directions = EnumBitSet<Direction, uint8_t> |
| Allow incrementing of Direction variables. | |
| template<typename T> | |
| using | DirectionIndexArray = EnumIndexArray<T, Direction, Direction::End> |
Array with Direction as index. | |
| using | DiagDirections = EnumBitSet<DiagDirection, uint8_t> |
Bitset of DiagDirection elements. | |
| template<typename T> | |
| using | DiagDirectionIndexArray = EnumIndexArray<T, DiagDirection, DiagDirection::End> |
Array with DiagDirection as index. | |
| template<typename T> | |
| using | AxisIndexArray = EnumIndexArray<T, Axis, Axis::End> |
Array with Axis as index. | |
Enumerations | |
| enum class | Direction : uint8_t { Begin = 0 , N = 0 , NE = 1 , E = 2 , SE = 3 , S = 4 , SW = 5 , W = 6 , NW = 7 , End , Invalid = 0xFF } |
| Defines the 8 directions on the map. More... | |
| enum class | DirDiff : uint8_t { Same = 0 , Right45 = 1 , Right90 = 2 , Reverse = 4 , Left90 = 6 , Left45 = 7 } |
| Enumeration for the difference between two directions. More... | |
| enum class | DiagDirection : uint8_t { Begin = 0 , NE = 0 , SE = 1 , SW = 2 , NW = 3 , End , Invalid = 0xFF } |
| Enumeration for diagonal directions. More... | |
| enum class | DiagDirDiff : uint8_t { Same = 0 , Right90 = 1 , Reverse = 2 , Left90 = 3 } |
| Enumeration for the difference between to DiagDirection. More... | |
| enum class | Axis : uint8_t { X = 0 , Y = 1 , End , Invalid = 0xFF } |
| Enumeration for the two axis X and Y. More... | |
Variables | |
| static constexpr Directions | DIRECTIONS_ALL {Direction::N, Direction::NE, Direction::E, Direction::SE, Direction::S, Direction::SW, Direction::W, Direction::NW} |
| All possible directions. | |
| static constexpr DiagDirections | DIAGDIRECTIONS_ALL {DiagDirection::NE, DiagDirection::SE, DiagDirection::SW, DiagDirection::NW} |
| All possible diagonal directions. | |
Different types to 'show' directions.
Definition in file direction_type.h.
| using AxisIndexArray = EnumIndexArray<T, Axis, Axis::End> |
| T | the type contained within the array. |
Definition at line 148 of file direction_type.h.
| using DiagDirectionIndexArray = EnumIndexArray<T, DiagDirection, DiagDirection::End> |
Array with DiagDirection as index.
| T | the type contained within the array. |
Definition at line 108 of file direction_type.h.
| using DiagDirections = EnumBitSet<DiagDirection, uint8_t> |
Bitset of DiagDirection elements.
Definition at line 98 of file direction_type.h.
| using DirectionIndexArray = EnumIndexArray<T, Direction, Direction::End> |
Array with Direction as index.
| T | the type contained within the array. |
Definition at line 51 of file direction_type.h.
| using Directions = EnumBitSet<Direction, uint8_t> |
Allow incrementing of Direction variables.
Definition at line 41 of file direction_type.h.
|
strong |
Enumeration for the two axis X and Y.
This enumeration represents the two axis X and Y in the game. The X axis is the one which goes align the north-west edge (and south-east edge). The Y axis must be so the one which goes align the north-east edge (and south-west) edge.
| Enumerator | |
|---|---|
| X | The X axis. |
| Y | The y axis. |
| End | End marker. |
| Invalid | Flag for an invalid Axis. |
Definition at line 135 of file direction_type.h.
|
strong |
Enumeration for the difference between to DiagDirection.
As the DiagDirection only contains 4 possible directions the difference between two of these directions can only be in 4 ways. As the DirDiff enumeration the values can be added together and you will get the resulting difference (use modulo DiagDirection::End).
| Enumerator | |
|---|---|
| Same | Same directions. |
| Right90 | 90 degrees right |
| Reverse | Reverse directions. |
| Left90 | 90 degrees left |
Definition at line 120 of file direction_type.h.
|
strong |
Enumeration for diagonal directions.
This enumeration is used for the 4 direction of the tile-edges.
| Enumerator | |
|---|---|
| Begin | Used for iterations. |
| NE | Northeast, upper right on your monitor. |
| SE | Southeast. |
| SW | Southwest. |
| NW | Northwest. |
| End | Used for iterations. |
| Invalid | Flag for an invalid DiagDirection. |
Definition at line 85 of file direction_type.h.
|
strong |
Enumeration for the difference between two directions.
This enumeration is used to mark differences between two directions. If you get one direction you can align a second direction in 8 different ways. This enumeration only contains 6 of these 8 differences, but the remaining two can be calculated by adding to differences together. This also means you can add two differences together and get the difference you really want to get. The difference of 45 degrees left + the difference of 45 degrees right results in the difference of 0 degrees.
Definition at line 70 of file direction_type.h.
|
strong |
Defines the 8 directions on the map.
This enum defines 8 possible directions which are used for the vehicles in the game. The directions are aligned straight to the viewport, not to the map. So north points to the top of your viewport and not rotated by 45 degrees left or right to get a "north" used in you games.
| Enumerator | |
|---|---|
| Begin | Used to iterate. |
| N | North. |
| NE | Northeast. |
| E | East. |
| SE | Southeast. |
| S | South. |
| SW | Southwest. |
| W | West. |
| NW | Northwest. |
| End | Used to iterate. |
| Invalid | Flag for an invalid direction. |
Definition at line 24 of file direction_type.h.
|
staticconstexpr |
All possible diagonal directions.
Definition at line 101 of file direction_type.h.
Referenced by InvalidateWaterRegion(), and VisitWaterRegionPatchNeighbours().
|
staticconstexpr |
All possible directions.
Definition at line 44 of file direction_type.h.
Referenced by DrawRailCatenaryRailway().