]> git.localhorst.tv Git - l2e.git/blob - src/map/Map.h
extracted tile coordinates calculation
[l2e.git] / src / map / Map.h
1 /*
2  * Map.h
3  *
4  *  Created on: Sep 29, 2012
5  *      Author: holy
6  */
7
8 #ifndef MAP_MAP_H_
9 #define MAP_MAP_H_
10
11 #include "fwd.h"
12 #include "../geometry/Vector.h"
13 #include "../graphics/fwd.h"
14
15 #include <SDL.h>
16
17 namespace map {
18
19 class Map {
20
21 public:
22         Map();
23         ~Map() { }
24
25 public:
26         const graphics::Sprite *Tileset() const { return tileset; }
27         const Area &AreaAt(const geometry::Vector<int> &) const;
28         const Tile &TileAt(const geometry::Vector<int> &) const;
29         Trigger *TriggerAt(const geometry::Vector<int> &);
30         geometry::Vector<int> TileCoordinates(const geometry::Vector<int> &) const;
31
32         void Render(SDL_Surface *dest, const geometry::Vector<int> &offset) const;
33
34 // temporary setters
35 public:
36         void SetTileset(const graphics::Sprite *t) { tileset = t; }
37         void SetAreas(Area *a, int num) { areas = a; numAreas = num; }
38         void SetTriggers(Trigger *t, int num) { triggers = t; numTriggers = num; }
39         void SetWidth(int w) { width = w; }
40
41 private:
42         const graphics::Sprite *tileset;
43         Area *areas;
44         int numAreas;
45         Trigger *triggers;
46         int numTriggers;
47         int width;
48
49 };
50
51 }
52
53 #endif /* MAP_MAP_H_ */