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.h23
1 files changed, 22 insertions, 1 deletions
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
25 std::string mapname; 25 std::string mapname;
26}; 26};
27 27
28class MapWriteException: public std::exception
29{
30 public:
31 MapWriteException(std::string mapname) : mapname(mapname) {}
32
33 virtual const char* what() const throw()
34 {
35 return ("An error occured writing map " + mapname).c_str();
36 }
37
38 private:
39 std::string mapname;
40};
41
28class Map { 42class Map {
29 public: 43 public:
30 Map(); 44 Map();
31 Map(const std::string name); 45 Map(std::string name);
32 Map(const Map& map); 46 Map(const Map& map);
33 Map(Map&& map); 47 Map(Map&& map);
34 ~Map(); 48 ~Map();
35 Map& operator= (Map other); 49 Map& operator= (Map other);
36 friend void swap(Map& first, Map& second); 50 friend void swap(Map& first, Map& second);
37 51
52 void save(std::string name);
53 bool hasUnsavedChanges() const;
54 void setTileAt(int x, int y, int tile);
55 int getTileAt(int x, int y) const;
56
57 private:
38 int* mapdata; 58 int* mapdata;
39 std::string title; 59 std::string title;
40 std::string leftmap; 60 std::string leftmap;
41 std::string rightmap; 61 std::string rightmap;
62 bool dirty;
42}; 63};
43 64
44#endif 65#endif