]> git.localhorst.tv Git - l2e.git/blob - src/map/Map.h
closed the gap between battle and map state (yay)
[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         Area *AreaAt(const geometry::Vector<int> &);
28         const Area *AreaAt(const geometry::Vector<int> &) const;
29         Tile *TileAt(const geometry::Vector<int> &);
30         const Tile *TileAt(const geometry::Vector<int> &) const;
31         Trigger *TriggerAt(const geometry::Vector<int> &);
32         SDL_Surface *BattleBackgroundAt(const geometry::Vector<int> &);
33         geometry::Vector<int> TileCoordinates(const geometry::Vector<int> &) const;
34
35         Entity **EntitiesBegin() { return &entities; }
36         Entity **EntitiesEnd() { return (&entities) + numEntities; }
37
38         void Render(SDL_Surface *dest, const geometry::Vector<int> &offset) const;
39         void RenderDebug(SDL_Surface *dest, const geometry::Vector<int> &offset) const;
40
41 // temporary setters
42 public:
43         void SetTileset(const graphics::Sprite *t) { tileset = t; }
44         void SetBattleBackground(SDL_Surface *bg) { battlebg = bg; }
45         void SetAreas(Area *a, int num) { areas = a; numAreas = num; }
46         void SetTriggers(Trigger *t, int num) { triggers = t; numTriggers = num; }
47         void SetEntities(Entity *e, int num) { entities = e; numEntities = num; }
48         void SetWidth(int w) { width = w; }
49
50 private:
51         const graphics::Sprite *tileset;
52         SDL_Surface *battlebg;
53         Area *areas;
54         int numAreas;
55         Trigger *triggers;
56         int numTriggers;
57         Entity *entities;
58         int numEntities;
59         int width;
60
61 };
62
63 }
64
65 #endif /* MAP_MAP_H_ */