From 13f946689e28e99ac71172925f63f4320798a0ee Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 5 Mar 2018 16:07:07 -0500 Subject: 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. --- tools/mapedit/src/map.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/mapedit/src/map.h') 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 { bool getHidden() const; const std::map& getAdjacents() const; const Adjacent& getAdjacent(MoveDir direction) const; + size_t getNextObjectIndex() const; void setTitle(std::string title, bool dirty = true); void setTileAt(int x, int y, int tile, bool dirty = true); @@ -100,6 +101,8 @@ class Map { void setExpanded(bool exp); void setHidden(bool hid); void setAdjacent(MoveDir direction, MoveType type, int map = -1, bool dirty = true); + size_t getAndIncrementNextObjectIndex(); + void setNextObjectIndex(size_t v); private: int id; @@ -113,6 +116,7 @@ class Map { bool hidden = false; std::map adjacents; const Adjacent defaultAdjacent {}; + size_t nextObjectIndex = 0; }; class MapPtrCtr : public wxTreeItemData { -- cgit 1.4.1