Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
CellTypes.h
1/*
2 * Gamedev Framework (gf)
3 * Copyright (C) 2016-2022 Julien Bernard
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21#ifndef GF_CELL_TYPES_H
22#define GF_CELL_TYPES_H
23
24#include <cstdint>
25
26namespace gf {
27#ifndef DOXYGEN_SHOULD_SKIP_THIS
28inline namespace v1 {
29#endif
30
37 enum class CellIndex {
38 Odd,
39 Even,
40 };
41
48 enum class CellAxis {
49 X,
50 Y,
51 };
52
59 enum class CellOrientation : uint8_t {
60 Unknown = 0x00,
61 Orthogonal = 0x01,
62 Isometric = 0x02,
63 Staggered = 0x03,
64 Hexagonal = 0x04,
65 };
66
73 enum class Flip : uint8_t {
74 Horizontally = 0x01,
75 Vertically = 0x02,
76 Diagonally = 0x04,
77 Rotation60 = 0x04,
78 Rotation120 = 0x08,
79 };
80
81
82#ifndef DOXYGEN_SHOULD_SKIP_THIS
83}
84#endif
85}
86
87#endif // GF_CELL_TYPES_H
CellAxis
Cell axis for staggered or hexagonal maps.
Definition: CellTypes.h:48
CellIndex
Cell index for staggered or hexagonal maps.
Definition: CellTypes.h:37
Flip
A flag to indicate how to flip a tile.
Definition: CellTypes.h:73
CellOrientation
The orientation of the cells.
Definition: CellTypes.h:59
@ X
The x cell axis.
@ Y
The y cell axis.
@ Even
An even cell index.
@ Odd
A odd cell index.
@ Rotation60
The tile is rotated 60° clockwise.
@ Vertically
The tile is flipped vertically.
@ Horizontally
The tile is flipped horizontally.
@ Rotation120
The tile is rotated 120° clockwise.
@ Diagonally
The tile is flipped anti-diagonally.
@ Hexagonal
A hexagonal orientation.
@ Orthogonal
An orthogonal orientation.
@ Unknown
An unknown orientation.
@ Isometric
An isometric orientation.
@ Staggered
A staggered orientation.
The namespace for gf classes.