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