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.h70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/map.h b/src/map.h deleted file mode 100644 index 22333aa..0000000 --- a/src/map.h +++ /dev/null
@@ -1,70 +0,0 @@
1#ifndef MAP_H
2#define MAP_H
3
4#include <string>
5#include <list>
6#include <map>
7
8class Entity;
9
10class Map {
11 public:
12 Map(int id);
13 Map() : Map(-1) {}
14 Map(const Map& map);
15 Map(Map&& map);
16 ~Map();
17 Map& operator= (Map other);
18 friend void swap(Map& first, Map& second);
19
20 enum class MoveType {
21 Wall,
22 Wrap,
23 Warp,
24 ReverseWarp
25 };
26
27 enum class MoveDir {
28 Left,
29 Right,
30 Up,
31 Down
32 };
33
34 struct EntityData {
35 std::string name;
36 std::pair<int, int> position;
37 std::map<std::string, int> items;
38 };
39
40 struct Adjacent {
41 MoveType type = MoveType::Wall;
42 int map = -1;
43 };
44
45 static MoveType moveTypeForShort(std::string str);
46 static MoveDir moveDirForShort(std::string str);
47 static bool moveTypeTakesMap(MoveType type);
48
49 int getID() const;
50 const int* getMapdata() const;
51 std::string getTitle() const;
52 const Adjacent& getAdjacent(MoveDir dir) const;
53
54 void createEntities(std::list<std::shared_ptr<Entity>>& entities) const;
55 bool operator==(const Map& other) const;
56 bool operator!=(const Map& other) const;
57
58 void setMapdata(int* mapdata);
59 void setTitle(std::string title);
60 void setAdjacent(MoveDir dir, MoveType type, int map);
61 void addEntity(EntityData& data);
62 private:
63 int* mapdata;
64 std::string title;
65 int id;
66 std::list<EntityData> entities;
67 std::map<MoveDir, Adjacent> adjacents;
68};
69
70#endif