]> git.localhorst.tv Git - l2e.git/blob - src/map/Tile.h
43f9dbb8e9b11a2939a7ea28d6ff32074d8aa5fd
[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         static const int TYPE_ID = 603;
21
22 public:
23         Tile();
24         ~Tile() { }
25
26 public:
27         enum Flag {
28                 BLOCK_NORTH = 0x01,
29                 BLOCK_EAST = 0x02,
30                 BLOCK_SOUTH = 0x04,
31                 BLOCK_WEST = 0x08,
32         };
33
34         SDL_Surface *BattleBackground() { return battlebg; }
35
36         const geometry::Vector<int> &Offset() const { return offset; }
37
38         bool BlocksNorth() const { return flags & BLOCK_NORTH; }
39         bool BlocksEast() const { return flags & BLOCK_EAST; }
40         bool BlocksSouth() const { return flags & BLOCK_SOUTH; }
41         bool BlocksWest() const { return flags & BLOCK_WEST; }
42
43         static void CreateTypeDescription();
44         static void Construct(void *);
45
46 // temporary setters
47 public:
48         Tile &SetOffset(const geometry::Vector<int> &o) { offset = o; return *this; }
49         Tile &SetFlags(Uint32 f) { flags = f; return *this; }
50
51 private:
52         SDL_Surface *battlebg;
53         geometry::Vector<int> offset;
54         int flags;
55
56 };
57
58 }
59
60 #endif /* MAP_TILE_H_ */