]> git.localhorst.tv Git - l2e.git/blob - src/map/Area.h
moved map data to maps.l2s
[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 "fwd.h"
12 #include "../geometry/Vector.h"
13 #include "../graphics/Sprite.h"
14
15 #include <SDL.h>
16
17 namespace map {
18
19 class Area {
20
21 public:
22         Area();
23         ~Area() { }
24
25 public:
26         int Width() const { return width; }
27         int Height() const { return numTiles / width + (numTiles % width ? 1 : 0); }
28         geometry::Vector<int> Size() const { return geometry::Vector<int>(Width(), Height()); }
29         Tile *TileAt(const geometry::Vector<int> &);
30         const Tile *TileAt(const geometry::Vector<int> &) const;
31
32         SDL_Surface *BattleBackground() { return battlebg; }
33
34         void Render(SDL_Surface *dest, const graphics::Sprite *tileset, const geometry::Vector<int> &offset) const;
35         void RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const geometry::Vector<int> &offset) const;
36
37         static void CreateTypeDescription();
38         static void Construct(void *);
39
40 // temporary setters
41 public:
42         void SetTiles(Tile *t, int num) { tiles = t; numTiles = num; }
43         void SetWidth(int w) { width = w; }
44
45 private:
46         SDL_Surface *battlebg;
47         Tile *tiles;
48         int numTiles;
49         int width;
50
51 };
52
53 }
54
55 #endif /* MAP_AREA_H_ */