]> git.localhorst.tv Git - l2e.git/blob - src/map/Tile.h
added tile flags in main
[l2e.git] / src / map / Tile.h
1 /*
2  * Tile.h
3  *
4  *  Created on: Sep 29, 2012
5  *      Author: holy
6  */
7
8 #ifndef MAP_TILE_H_
9 #define MAP_TILE_H_
10
11 #include "../geometry/Vector.h"
12
13 #include <SDL.h>
14
15 namespace map {
16
17 class Tile {
18
19 public:
20         Tile();
21         ~Tile() { }
22
23 public:
24         enum Flag {
25                 BLOCK_NORTH = 0x01,
26                 BLOCK_EAST = 0x02,
27                 BLOCK_SOUTH = 0x04,
28                 BLOCK_WEST = 0x08,
29         };
30
31         const geometry::Vector<int> &Offset() const { return offset; }
32
33         bool BlocksNorth() const { return flags & BLOCK_NORTH; }
34         bool BlocksEast() const { return flags & BLOCK_EAST; }
35         bool BlocksSouth() const { return flags & BLOCK_SOUTH; }
36         bool BlocksWest() const { return flags & BLOCK_WEST; }
37
38 // temporary setters
39 public:
40         Tile &SetOffset(const geometry::Vector<int> &o) { offset = o; return *this; }
41         Tile &SetFlags(Uint32 f) { flags = f; return *this; }
42
43 private:
44         geometry::Vector<int> offset;
45         Uint32 flags;
46
47 };
48
49 }
50
51 #endif /* MAP_TILE_H_ */