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 
44 template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR, 3> {};
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 
94 template <> struct EnumPropsT<DiagDirection> : MakeEnumPropsT<DiagDirection, byte, DIAGDIR_BEGIN, DIAGDIR_END, INVALID_DIAGDIR, 2> {};
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 */