diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-15 17:20:42 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-15 17:20:42 -0400 |
commit | 91640f2f35d703898edb14abaae7dd63f5346027 (patch) | |
tree | 35bdcfd4a61fa54f70c5b44d567a0fdd665e0129 /tools/mapedit/src/map.h | |
parent | 3d24adb1162c4ce1b5030b73ea72873a2b14f6f9 (diff) | |
download | therapy-91640f2f35d703898edb14abaae7dd63f5346027.tar.gz therapy-91640f2f35d703898edb14abaae7dd63f5346027.tar.bz2 therapy-91640f2f35d703898edb14abaae7dd63f5346027.zip |
Added file management to map editor (only edits environment at current time)
Diffstat (limited to 'tools/mapedit/src/map.h')
-rw-r--r-- | tools/mapedit/src/map.h | 23 |
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 | ||
28 | class 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 | |||
28 | class Map { | 42 | class 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 |