Tileson 1.4.0
A helpful json parser for Tiled maps
Loading...
Searching...
No Matches
Enums.hpp
Go to the documentation of this file.
1//
2// Created by robin on 22.03.2020.
3//
4
5#ifndef TILESON_ENUMS_HPP
6#define TILESON_ENUMS_HPP
7#include <cstdint>
8#include "EnumBitflags.hpp"
9
10namespace tson
11{
15 enum class Type : uint8_t
16 {
17 Undefined = 0,
18 Color = 1,
19 File = 2,
20 Int = 3,
21 Boolean = 4,
22 Float = 5,
23 String = 6,
24 Class = 7,
25 Enum = 8,
26 Object = 9
27 };
28
33 enum class LayerType : uint8_t
34 {
35 Undefined = 0,
36 TileLayer = 1,
37 ObjectGroup = 2,
38 ImageLayer = 3,
39 Group = 4
40 };
41
45 enum class ParseStatus : uint8_t
46 {
47 OK = 0, //OK unless otherwise stated
48 FileNotFound = 1,
49 ParseError = 2,
50 MissingData = 3,
52 };
53
57 enum class ObjectType : uint8_t
58 {
59 Undefined = 0,
60 Object = 1,
61 Ellipse = 2,
62 Rectangle = 3,
63 Point = 4,
64 Polygon = 5,
65 Polyline = 6,
66 Text = 7,
67 Template = 8
68 };
69
70 static constexpr uint32_t FLIPPED_HORIZONTALLY_FLAG = 0x80000000;
71 static constexpr uint32_t FLIPPED_VERTICALLY_FLAG = 0x40000000;
72 static constexpr uint32_t FLIPPED_DIAGONALLY_FLAG = 0x20000000;
76 enum class TileFlipFlags : uint32_t
77 {
78 None = 0,
79 Diagonally = FLIPPED_DIAGONALLY_FLAG,
80 Vertically = FLIPPED_VERTICALLY_FLAG,
81 Horizontally = FLIPPED_HORIZONTALLY_FLAG
82 };
83
87 enum class ObjectAlignment : uint8_t
88 {
89 Unspecified = 0, //unspecified
90 TopLeft = 1, //topleft
91 Top = 2, //top
92 TopRight = 3, //topright
93 Left = 4, //left
94 Center = 5, //center
95 Right = 6, //right
96 BottomLeft = 7, //bottomleft
97 Bottom = 8, //bottom
98 BottomRight = 9 //bottomright
99 };
100
104 enum class TextAlignment : uint8_t
105 {
106 Unresolved = 0,
107 Left = 1, //left
108 Center = 2, //center
109 Right = 3, //right
110 Justify = 4, //justify
111 Top = 5, //top
112 Bottom = 6 //bottom
113 };
114
118 enum class TileRenderSize : uint8_t
119 {
120 Undefined = 0,
121 Tile = 1, //tile (default)
122 Grid = 2 //grid
123 };
124
128 enum class FillMode : uint8_t
129 {
130 Undefined = 0,
131 Stretch = 1, //stretch (default)
132 PreserveAspectFit = 2 //preserve-aspect-fit
133 };
134
135 enum class EnumStorageType : uint8_t
136 {
137 Unspecified = 0,
138 Int = 1,
139 String = 2
140 };
141
143}
144
145#endif //TILESON_ENUMS_HPP
#define ENABLE_BITMASK_OPERATORS(x)
Definition EnumBitflags.hpp:18
Definition Color.hpp:17
Definition Grid.hpp:15
Definition Object.hpp:21
Definition Text.hpp:13
Definition Tile.hpp:23
Definition Base64.hpp:12
Type
Definition Enums.hpp:16
TileRenderSize
Definition Enums.hpp:119
TextAlignment
Definition Enums.hpp:105
ObjectType
Definition Enums.hpp:58
ParseStatus
Definition Enums.hpp:46
FillMode
Definition Enums.hpp:129
EnumStorageType
Definition Enums.hpp:136
TileFlipFlags
Definition Enums.hpp:77
LayerType
Definition Enums.hpp:34
ObjectAlignment
Definition Enums.hpp:88