summary refs log tree commit diff stats
path: root/tools/mapedit/src/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mapedit/src/map.h')
-rw-r--r--tools/mapedit/src/map.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/mapedit/src/map.h b/tools/mapedit/src/map.h index 850a66b..16bbb4c 100644 --- a/tools/mapedit/src/map.h +++ b/tools/mapedit/src/map.h
@@ -46,6 +46,11 @@ class MapWriteException: public std::exception
46struct MapObjectEntry { 46struct MapObjectEntry {
47 MapObject* object; 47 MapObject* object;
48 std::pair<double, double> position; 48 std::pair<double, double> position;
49
50 bool operator==(MapObjectEntry& other) const
51 {
52 return (object == other.object) && (position == other.position);
53 }
49}; 54};
50 55
51class Map { 56class Map {
@@ -64,10 +69,12 @@ class Map {
64 bool hasUnsavedChanges() const; 69 bool hasUnsavedChanges() const;
65 void setTileAt(int x, int y, int tile); 70 void setTileAt(int x, int y, int tile);
66 int getTileAt(int x, int y) const; 71 int getTileAt(int x, int y) const;
67 std::list<MapObjectEntry>& getObjects(); 72 const std::list<std::shared_ptr<MapObjectEntry>>& getObjects() const;
73 void addObject(std::shared_ptr<MapObjectEntry>& obj);
74 void removeObject(std::shared_ptr<MapObjectEntry>& obj);
68 75
69 private: 76 private:
70 std::list<MapObjectEntry> objects; 77 std::list<std::shared_ptr<MapObjectEntry>> objects;
71 int* mapdata; 78 int* mapdata;
72 std::string title; 79 std::string title;
73 std::string leftmap; 80 std::string leftmap;