Tileson  1.3.0
A helpful json parser for Tiled maps
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 
10 namespace 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  };
25 
30  enum class LayerType : uint8_t
31  {
32  Undefined = 0,
33  TileLayer = 1,
34  ObjectGroup = 2,
35  ImageLayer = 3,
36  Group = 4
37  };
38 
42  enum class ParseStatus : uint8_t
43  {
44  OK = 0, //OK unless otherwise stated
45  FileNotFound = 1,
46  ParseError = 2,
47  MissingData = 3,
49  };
50 
54  enum class ObjectType : uint8_t
55  {
56  Undefined = 0,
57  Object = 1,
58  Ellipse = 2,
59  Rectangle = 3,
60  Point = 4,
61  Polygon = 5,
62  Polyline = 6,
63  Text = 7,
64  Template = 8
65  };
66 
67  static constexpr uint32_t FLIPPED_HORIZONTALLY_FLAG = 0x80000000;
68  static constexpr uint32_t FLIPPED_VERTICALLY_FLAG = 0x40000000;
69  static constexpr uint32_t FLIPPED_DIAGONALLY_FLAG = 0x20000000;
73  enum class TileFlipFlags : uint32_t
74  {
75  None = 0,
76  Diagonally = FLIPPED_DIAGONALLY_FLAG,
77  Vertically = FLIPPED_VERTICALLY_FLAG,
78  Horizontally = FLIPPED_HORIZONTALLY_FLAG
79  };
80 
84  enum class ObjectAlignment : uint8_t
85  {
86  Unspecified = 0, //unspecified
87  TopLeft = 1, //topleft
88  Top = 2, //top
89  TopRight = 3, //topright
90  Left = 4, //left
91  Center = 5, //center
92  Right = 6, //right
93  BottomLeft = 7, //bottomleft
94  Bottom = 8, //bottom
95  BottomRight = 9 //bottomright
96  };
97 
99 }
100 
101 #endif //TILESON_ENUMS_HPP
#define ENABLE_BITMASK_OPERATORS(x)
Definition: EnumBitflags.hpp:13
Definition: Color.hpp:17
Definition: Object.hpp:18
Definition: Text.hpp:13
Definition: Base64.hpp:12
Type
Definition: Enums.hpp:16
ObjectType
Definition: Enums.hpp:55
ParseStatus
Definition: Enums.hpp:43
TileFlipFlags
Definition: Enums.hpp:74
LayerType
Definition: Enums.hpp:31
ObjectAlignment
Definition: Enums.hpp:85