-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTileAttributes.h
61 lines (53 loc) · 1.33 KB
/
TileAttributes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*!
* \file TileAttributes.h
* \author Ekinox <[email protected]>
*/
#ifndef TILE_ATTRIBUTES_INCLUDED
#define TILE_ATTRIBUTES_INCLUDED 1
#include <string>
/*!
* \class TileAttributes
* \brief Models the attributes of a tile
*
* It models the attributes of a tile :
* <ul>
* <li>File name of the image</li>
* <li>Attributes (empty, breakable, push-able) as bit flags</li>
* </ul>
*/
struct TileAttributes
{
/*!
* \enum AttributeFlags
* \brief The bit flags of the attributes
*/
enum AttributeFlags
{
NotEmpty = 0 << 0,
Empty = 1 << 0,
NotBreakable = 0 << 1,
Breakable = 1 << 1,
NotPushable = 0 << 2,
Pushable = 1 << 2
};
std::string Filename; //!< The file name of the tile
/*!
* \brief The attributes of the tile
*
* It is a combination of AttributeFlags
*/
unsigned char Attributes;
TileAttributes() :
Filename(), Attributes(Empty)
{
}
/*!
* \param File The file name
* \param Attrs The attributes
*/
TileAttributes(const std::string &File, unsigned char Attrs) :
Filename(File), Attributes(Attrs)
{
}
};
#endif // TILE_ATTRIBUTES_INCLUDED