OpenTTD Source 20250517-master-g617169c1c9
|
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. | |
using | DiagDirections = EnumBitSet< DiagDirection, uint8_t > |
Enumerations | |
enum | Direction : uint8_t { DIR_BEGIN = 0 , DIR_N = 0 , DIR_NE = 1 , DIR_E = 2 , DIR_SE = 3 , DIR_S = 4 , DIR_SW = 5 , DIR_W = 6 , DIR_NW = 7 , DIR_END , INVALID_DIR = 0xFF } |
Defines the 8 directions on the map. More... | |
enum | DirDiff : uint8_t { DIRDIFF_SAME = 0 , DIRDIFF_45RIGHT = 1 , DIRDIFF_90RIGHT = 2 , DIRDIFF_REVERSE = 4 , DIRDIFF_90LEFT = 6 , DIRDIFF_45LEFT = 7 } |
Enumeration for the difference between two directions. More... | |
enum | DiagDirection : uint8_t { DIAGDIR_BEGIN = 0 , DIAGDIR_NE = 0 , DIAGDIR_SE = 1 , DIAGDIR_SW = 2 , DIAGDIR_NW = 3 , DIAGDIR_END , INVALID_DIAGDIR = 0xFF } |
Enumeration for diagonal directions. More... | |
enum | DiagDirDiff : uint8_t { DIAGDIRDIFF_BEGIN = 0 , DIAGDIRDIFF_SAME = 0 , DIAGDIRDIFF_90RIGHT = 1 , DIAGDIRDIFF_REVERSE = 2 , DIAGDIRDIFF_90LEFT = 3 , DIAGDIRDIFF_END } |
Enumeration for the difference between to DiagDirection. More... | |
enum | Axis : uint8_t { AXIS_X = 0 , AXIS_Y = 1 , AXIS_END , INVALID_AXIS = 0xFF } |
Allow incrementing of DiagDirDiff variables. More... | |
Variables | |
static constexpr Directions | DIRECTIONS_ALL {DIR_N, DIR_NE, DIR_E, DIR_SE, DIR_S, DIR_SW, DIR_W, DIR_NW} |
All possible directions. | |
Different types to 'show' directions.
Definition in file direction_type.h.
using DiagDirections = EnumBitSet<DiagDirection, uint8_t> |
Definition at line 90 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.
enum Axis : uint8_t |
Allow incrementing of DiagDirDiff variables.
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 | |
---|---|
AXIS_X | The X axis. |
AXIS_Y | The y axis. |
AXIS_END | Used for iterations. |
INVALID_AXIS | Flag for an invalid Axis. |
Definition at line 123 of file direction_type.h.
enum DiagDirDiff : uint8_t |
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 DIAGDIR_END).
Definition at line 102 of file direction_type.h.
enum DiagDirection : uint8_t |
Enumeration for diagonal directions.
This enumeration is used for the 4 direction of the tile-edges.
Definition at line 78 of file direction_type.h.
enum DirDiff : uint8_t |
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 63 of file direction_type.h.
enum Direction : uint8_t |
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.
Definition at line 24 of file direction_type.h.
|
staticconstexpr |
All possible directions.
Definition at line 44 of file direction_type.h.
Referenced by DrawRailCatenaryRailway().