]> git.localhorst.tv Git - l2e.git/blob - src/map/Area.h
added basic map classes
[l2e.git] / src / map / Area.h
1 /*
2  * Area.h
3  *
4  *  Created on: Sep 26, 2012
5  *      Author: holy
6  */
7
8 #ifndef MAP_AREA_H_
9 #define MAP_AREA_H_
10
11 #include "../geometry/Vector.h"
12
13 #include <SDL.h>
14
15 namespace graphics {
16         class Sprite;
17 }
18
19 namespace map {
20
21 class Tile;
22
23 class Area {
24
25 public:
26         Area();
27         ~Area() { }
28
29 public:
30         int Width() const { return width; }
31         int Height() const { return numTiles / width + (numTiles % width ? 1 : 0); }
32
33         void Render(SDL_Surface *dest, const graphics::Sprite *tileset, const geometry::Vector<int> &offset) const;
34
35 // temporary setters
36 public:
37         void SetTiles(const Tile *t, int num) { tiles = t; numTiles = num; }
38         void SetWidth(int w) { width = w; }
39
40 private:
41         const Tile *tiles;
42         int numTiles;
43         int width;
44
45 };
46
47 }
48
49 #endif /* MAP_AREA_H_ */