]> git.localhorst.tv Git - l2e.git/blob - src/map/Map.h
fixed entity bounds in Map
[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 "Entity.h"
12 #include "fwd.h"
13 #include "../geometry/Vector.h"
14 #include "../graphics/fwd.h"
15
16 #include <SDL.h>
17
18 namespace map {
19
20 class Map {
21
22 public:
23         Map();
24         ~Map() { }
25
26 public:
27         const graphics::Sprite *Tileset() const { return tileset; }
28         Area *AreaAt(const geometry::Vector<int> &);
29         const Area *AreaAt(const geometry::Vector<int> &) const;
30         Tile *TileAt(const geometry::Vector<int> &);
31         const Tile *TileAt(const geometry::Vector<int> &) const;
32         Trigger *TriggerAt(const geometry::Vector<int> &);
33         SDL_Surface *BattleBackgroundAt(const geometry::Vector<int> &);
34         geometry::Vector<int> TileCoordinates(const geometry::Vector<int> &) const;
35
36         Entity *EntitiesBegin() { return entities; }
37         Entity *EntitiesEnd() { return entities + numEntities; }
38
39         void Render(SDL_Surface *dest, const geometry::Vector<int> &offset) const;
40         void RenderDebug(SDL_Surface *dest, const geometry::Vector<int> &offset) const;
41
42 // temporary setters
43 public:
44         void SetTileset(const graphics::Sprite *t) { tileset = t; }
45         void SetBattleBackground(SDL_Surface *bg) { battlebg = bg; }
46         void SetAreas(Area *a, int num) { areas = a; numAreas = num; }
47         void SetTriggers(Trigger *t, int num) { triggers = t; numTriggers = num; }
48         void SetEntities(Entity *e, int num) { entities = e; numEntities = num; }
49         void SetWidth(int w) { width = w; }
50
51 private:
52         const graphics::Sprite *tileset;
53         SDL_Surface *battlebg;
54         Area *areas;
55         int numAreas;
56         Trigger *triggers;
57         int numTriggers;
58         Entity *entities;
59         int numEntities;
60         int width;
61
62 };
63
64 }
65
66 #endif /* MAP_MAP_H_ */