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/object.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/mapedit/src/object.h') diff --git a/tools/mapedit/src/object.h b/tools/mapedit/src/object.h index a870a2e..a87fa96 100644 --- a/tools/mapedit/src/object.h +++ b/tools/mapedit/src/object.h @@ -67,7 +67,11 @@ class MapObject { class MapObjectEntry { public: - MapObjectEntry(const MapObject& object, int posx, int posy); + MapObjectEntry( + const MapObject& object, + int posx, + int posy, + size_t index); struct Item { MapObject::Input::Type type; @@ -78,6 +82,7 @@ class MapObjectEntry { std::pair getPosition() const; Item& getItem(std::string str); const std::map& getItems() const; + size_t getIndex() const; void setPosition(int x, int y); void addItem(std::string id, Item& item); @@ -89,6 +94,7 @@ class MapObjectEntry { const MapObject& object; std::pair position; std::map items; + size_t index; }; class VariableChoiceValidator : public wxValidator { -- cgit 1.4.1