summary refs log tree commit diff stats
path: root/tools/mapedit/src/map.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-03-05 16:07:07 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-03-05 16:07:07 -0500
commit13f946689e28e99ac71172925f63f4320798a0ee (patch)
treeba30132da24aa70b0d2daffc96ac3b3f63d57df6 /tools/mapedit/src/map.h
parentdbc486d5cc0fa6b7cdb690fb4591f292d33e9ecc (diff)
downloadtherapy-13f946689e28e99ac71172925f63f4320798a0ee.tar.gz
therapy-13f946689e28e99ac71172925f63f4320798a0ee.tar.bz2
therapy-13f946689e28e99ac71172925f63f4320798a0ee.zip
Added entity indexing
Changed the world format so that map objects are indexed (per map). The next available map object index is cached for each map.
Diffstat (limited to 'tools/mapedit/src/map.h')
-rw-r--r--tools/mapedit/src/map.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/mapedit/src/map.h b/tools/mapedit/src/map.h index 9c14218..1ae905f 100644 --- a/tools/mapedit/src/map.h +++ b/tools/mapedit/src/map.h
@@ -89,6 +89,7 @@ class Map {
89 bool getHidden() const; 89 bool getHidden() const;
90 const std::map<MoveDir, Adjacent>& getAdjacents() const; 90 const std::map<MoveDir, Adjacent>& getAdjacents() const;
91 const Adjacent& getAdjacent(MoveDir direction) const; 91 const Adjacent& getAdjacent(MoveDir direction) const;
92 size_t getNextObjectIndex() const;
92 93
93 void setTitle(std::string title, bool dirty = true); 94 void setTitle(std::string title, bool dirty = true);
94 void setTileAt(int x, int y, int tile, bool dirty = true); 95 void setTileAt(int x, int y, int tile, bool dirty = true);
@@ -100,6 +101,8 @@ class Map {
100 void setExpanded(bool exp); 101 void setExpanded(bool exp);
101 void setHidden(bool hid); 102 void setHidden(bool hid);
102 void setAdjacent(MoveDir direction, MoveType type, int map = -1, bool dirty = true); 103 void setAdjacent(MoveDir direction, MoveType type, int map = -1, bool dirty = true);
104 size_t getAndIncrementNextObjectIndex();
105 void setNextObjectIndex(size_t v);
103 106
104 private: 107 private:
105 int id; 108 int id;
@@ -113,6 +116,7 @@ class Map {
113 bool hidden = false; 116 bool hidden = false;
114 std::map<MoveDir, Adjacent> adjacents; 117 std::map<MoveDir, Adjacent> adjacents;
115 const Adjacent defaultAdjacent {}; 118 const Adjacent defaultAdjacent {};
119 size_t nextObjectIndex = 0;
116}; 120};
117 121
118class MapPtrCtr : public wxTreeItemData { 122class MapPtrCtr : public wxTreeItemData {