diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-16 16:53:05 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-16 16:53:05 -0400 |
commit | 0d30e9b57229905f78e7bd60fe5d3cde72851f28 (patch) | |
tree | 4ca2abff9fb1933685f570e97a8b9e88a976c95f /tools/mapedit/src/world.h | |
parent | 36536297aac5c07e3d5fb96abed74570fc7615e9 (diff) | |
download | therapy-0d30e9b57229905f78e7bd60fe5d3cde72851f28.tar.gz therapy-0d30e9b57229905f78e7bd60fe5d3cde72851f28.tar.bz2 therapy-0d30e9b57229905f78e7bd60fe5d3cde72851f28.zip |
Rewrote map editor so a single file contains all maps
Maps are viewed in a tree control on the left. They can be dragged and dropped. Maps are bolded when they are dirty. Saving saves expansion status and order of maps in tree.
Diffstat (limited to 'tools/mapedit/src/world.h')
-rw-r--r-- | tools/mapedit/src/world.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/mapedit/src/world.h b/tools/mapedit/src/world.h new file mode 100644 index 0000000..7d796cc --- /dev/null +++ b/tools/mapedit/src/world.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef WORLD_H | ||
2 | #define WORLD_H | ||
3 | |||
4 | class World; | ||
5 | |||
6 | #include <wx/wxprec.h> | ||
7 | |||
8 | #ifndef WX_PRECOMP | ||
9 | #include <wx/wx.h> | ||
10 | #endif | ||
11 | |||
12 | #include <wx/treectrl.h> | ||
13 | #include <map> | ||
14 | #include <memory> | ||
15 | #include "map.h" | ||
16 | #include <list> | ||
17 | |||
18 | class MapeditFrame; | ||
19 | |||
20 | class World { | ||
21 | public: | ||
22 | World(); | ||
23 | World(std::string filename); | ||
24 | std::shared_ptr<Map> newMap(); | ||
25 | std::shared_ptr<Map> getMap(int id) const; | ||
26 | void setDirty(bool dirty); | ||
27 | bool getDirty() const; | ||
28 | std::string getFilename() const; | ||
29 | void setParent(MapeditFrame* parent); | ||
30 | void save(std::string filename, wxTreeCtrl* mapTree); | ||
31 | Map* getLastMap() const; | ||
32 | std::list<std::shared_ptr<Map>> getRootMaps() const; | ||
33 | const std::map<int, std::shared_ptr<Map>> getMaps() const; | ||
34 | |||
35 | private: | ||
36 | MapeditFrame* parent; | ||
37 | std::map<int, std::shared_ptr<Map>> maps; | ||
38 | int nextMapID = 0; | ||
39 | bool dirty = false; | ||
40 | std::string filename; | ||
41 | int lastmap = 0; | ||
42 | std::list<int> rootChildren; | ||
43 | }; | ||
44 | |||
45 | #endif | ||