]> git.localhorst.tv Git - l2e.git/blob - src/map/Tile.h
moved map data to maps.l2s
[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         SDL_Surface *BattleBackground() { return battlebg; }
32
33         const geometry::Vector<int> &Offset() const { return offset; }
34
35         bool BlocksNorth() const { return flags & BLOCK_NORTH; }
36         bool BlocksEast() const { return flags & BLOCK_EAST; }
37         bool BlocksSouth() const { return flags & BLOCK_SOUTH; }
38         bool BlocksWest() const { return flags & BLOCK_WEST; }
39
40         static void CreateTypeDescription();
41         static void Construct(void *);
42
43 // temporary setters
44 public:
45         Tile &SetOffset(const geometry::Vector<int> &o) { offset = o; return *this; }
46         Tile &SetFlags(Uint32 f) { flags = f; return *this; }
47
48 private:
49         SDL_Surface *battlebg;
50         geometry::Vector<int> offset;
51         int flags;
52
53 };
54
55 }
56
57 #endif /* MAP_TILE_H_ */