OpenTTD
direction_type.h
Go to the documentation of this file.
1 /* $Id: direction_type.h 24900 2013-01-08 22:46:42Z planetmaker $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef DIRECTION_TYPE_H
13 #define DIRECTION_TYPE_H
14 
15 #include "core/enum_type.hpp"
16 
26 enum Direction {
27  DIR_BEGIN = 0,
28  DIR_N = 0,
29  DIR_NE = 1,
30  DIR_E = 2,
31  DIR_SE = 3,
32  DIR_S = 4,
33  DIR_SW = 5,
34  DIR_W = 6,
35  DIR_NW = 7,
37  INVALID_DIR = 0xFF,
38 };
39 
42 
43 
46 
47 
65 enum DirDiff {
72 };
73 
74 
82  DIAGDIR_NE = 0,
83  DIAGDIR_SE = 1,
84  DIAGDIR_SW = 2,
85  DIAGDIR_NW = 3,
87  INVALID_DIAGDIR = 0xFF,
88 };
89 
92 
93 
96 
97 
113 };
114 
117 
118 
119 
127 enum Axis {
128  AXIS_X = 0,
129  AXIS_Y = 1,
131  INVALID_AXIS = 0xFF,
132 };
134 template <> struct EnumPropsT<Axis> : MakeEnumPropsT<Axis, byte, AXIS_X, AXIS_END, INVALID_AXIS, 1> {};
135 
136 #endif /* DIRECTION_TYPE_H */
Flag for an invalid direction.
Helper template class that makes basic properties of given enumeration type visible from outsize...
Definition: enum_type.hpp:66
TinyEnumT< DiagDirection > DiagDirectionByte
typedefing-enumification of DiagDirection
East.
Flag for an invalid DiagDirection.
Angle of 45 degrees left.
Angle of 90 degrees right.
Both directions faces to the same direction.
Northeast, upper right on your monitor.
Used for iterations.
Type (helpers) for enums.
Direction
Defines the 8 directions on the map.
Southeast.
Northeast.
Angle of 45 degrees right.
90 degrees right
Reverse directions.
The y axis.
West.
North.
Southeast.
Southwest.
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:52
DirDiff
Enumeration for the difference between two directions.
Used for iterations.
Used for iterations.
Northwest.
DiagDirDiff
Enumeration for the difference between to DiagDirection.
DiagDirection
Enumeration for diagonal directions.
Same directions.
Used to iterate.
The X axis.
Angle of 90 degrees left.
TinyEnumT< Direction > DirectionByte
typedefing-enumification of Direction
Northwest.
South.
Used to iterate.
One direction is the opposite of the other one.
#define DECLARE_POSTFIX_INCREMENT(type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:16
Flag for an invalid Axis.
90 degrees left
Southwest.
Axis
Allow incrementing of DiagDirDiff variables.