diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-05 16:07:07 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-05 16:07:07 -0500 |
commit | 13f946689e28e99ac71172925f63f4320798a0ee (patch) | |
tree | ba30132da24aa70b0d2daffc96ac3b3f63d57df6 /tools/mapedit/src/object.h | |
parent | dbc486d5cc0fa6b7cdb690fb4591f292d33e9ecc (diff) | |
download | therapy-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/object.h')
-rw-r--r-- | tools/mapedit/src/object.h | 8 |
1 files changed, 7 insertions, 1 deletions
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 { | |||
67 | 67 | ||
68 | class MapObjectEntry { | 68 | class MapObjectEntry { |
69 | public: | 69 | public: |
70 | MapObjectEntry(const MapObject& object, int posx, int posy); | 70 | MapObjectEntry( |
71 | const MapObject& object, | ||
72 | int posx, | ||
73 | int posy, | ||
74 | size_t index); | ||
71 | 75 | ||
72 | struct Item { | 76 | struct Item { |
73 | MapObject::Input::Type type; | 77 | MapObject::Input::Type type; |
@@ -78,6 +82,7 @@ class MapObjectEntry { | |||
78 | std::pair<int, int> getPosition() const; | 82 | std::pair<int, int> getPosition() const; |
79 | Item& getItem(std::string str); | 83 | Item& getItem(std::string str); |
80 | const std::map<std::string, Item>& getItems() const; | 84 | const std::map<std::string, Item>& getItems() const; |
85 | size_t getIndex() const; | ||
81 | 86 | ||
82 | void setPosition(int x, int y); | 87 | void setPosition(int x, int y); |
83 | void addItem(std::string id, Item& item); | 88 | void addItem(std::string id, Item& item); |
@@ -89,6 +94,7 @@ class MapObjectEntry { | |||
89 | const MapObject& object; | 94 | const MapObject& object; |
90 | std::pair<int, int> position; | 95 | std::pair<int, int> position; |
91 | std::map<std::string, Item> items; | 96 | std::map<std::string, Item> items; |
97 | size_t index; | ||
92 | }; | 98 | }; |
93 | 99 | ||
94 | class VariableChoiceValidator : public wxValidator { | 100 | class VariableChoiceValidator : public wxValidator { |