From c46db36fe1c319a76cb6bd089b25952db0d98e11 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 16 Mar 2015 10:30:31 -0400 Subject: Added ability to edit and remove entities to map editor --- tools/mapedit/src/map.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tools/mapedit/src/map.h') 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 struct MapObjectEntry { MapObject* object; std::pair position; + + bool operator==(MapObjectEntry& other) const + { + return (object == other.object) && (position == other.position); + } }; class Map { @@ -64,10 +69,12 @@ class Map { bool hasUnsavedChanges() const; void setTileAt(int x, int y, int tile); int getTileAt(int x, int y) const; - std::list& getObjects(); + const std::list>& getObjects() const; + void addObject(std::shared_ptr& obj); + void removeObject(std::shared_ptr& obj); private: - std::list objects; + std::list> objects; int* mapdata; std::string title; std::string leftmap; -- cgit 1.4.1