summary refs log tree commit diff stats
path: root/src/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/map.h b/src/map.h index 071b6f2..fa2edcc 100644 --- a/src/map.h +++ b/src/map.h
@@ -1,28 +1,41 @@
1#ifndef MAP_H 1#ifndef MAP_H
2#define MAP_H 2#define MAP_H
3 3
4#include <string>
5#include <list>
6
7class Entity;
8
4class Map { 9class Map {
5 public: 10 public:
6 Map(const char* filename); 11 Map();
7 Map(Map& map); 12 Map(const std::string name);
13 Map(const Map& map);
8 Map(Map&& map); 14 Map(Map&& map);
9 ~Map(); 15 ~Map();
10 Map& operator= (Map other); 16 Map& operator= (Map other);
11 friend void swap(Map& first, Map& second); 17 friend void swap(Map& first, Map& second);
12 18
13 const int* mapdata() const; 19 static Map& getNamedMap(const std::string name);
14 const char* title() const; 20
21 const int* getMapdata() const;
22 const char* getTitle() const;
15 const Map* getLeftMap() const; 23 const Map* getLeftMap() const;
16 const Map* getRightMap() const; 24 const Map* getRightMap() const;
17 void setLeftMap(const Map* m); 25 void setLeftMap(const Map* m);
18 void setRightMap(const Map* m); 26 void setRightMap(const Map* m);
27 void createEntities(std::list<std::shared_ptr<Entity>>& entities) const;
19 private: 28 private:
20 Map(); 29 struct EntityData {
30 std::string name;
31 std::pair<double, double> position;
32 };
21 33
22 int* m_mapdata; 34 int* mapdata;
23 char* m_title; 35 char* title;
24 const Map* m_leftMap = nullptr; 36 const Map* leftMap = nullptr;
25 const Map* m_rightMap = nullptr; 37 const Map* rightMap = nullptr;
38 std::list<EntityData> entities;
26}; 39};
27 40
28#endif 41#endif