From 91640f2f35d703898edb14abaae7dd63f5346027 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 15 Mar 2015 17:20:42 -0400 Subject: Added file management to map editor (only edits environment at current time) --- tools/mapedit/src/map.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'tools/mapedit/src/map.h') diff --git a/tools/mapedit/src/map.h b/tools/mapedit/src/map.h index 83244f3..66e4596 100644 --- a/tools/mapedit/src/map.h +++ b/tools/mapedit/src/map.h @@ -25,20 +25,41 @@ class MapLoadException: public std::exception std::string mapname; }; +class MapWriteException: public std::exception +{ + public: + MapWriteException(std::string mapname) : mapname(mapname) {} + + virtual const char* what() const throw() + { + return ("An error occured writing map " + mapname).c_str(); + } + + private: + std::string mapname; +}; + class Map { public: Map(); - Map(const std::string name); + Map(std::string name); Map(const Map& map); Map(Map&& map); ~Map(); Map& operator= (Map other); friend void swap(Map& first, Map& second); + void save(std::string name); + bool hasUnsavedChanges() const; + void setTileAt(int x, int y, int tile); + int getTileAt(int x, int y) const; + + private: int* mapdata; std::string title; std::string leftmap; std::string rightmap; + bool dirty; }; #endif -- cgit 1.4.1