summary refs log tree commit diff stats
path: root/tools/mapedit/src/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mapedit/src/object.cpp')
-rw-r--r--tools/mapedit/src/object.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/mapedit/src/object.cpp b/tools/mapedit/src/object.cpp index 8ed29af..aeb8fc1 100644 --- a/tools/mapedit/src/object.cpp +++ b/tools/mapedit/src/object.cpp
@@ -184,9 +184,15 @@ bool MapObject::operator!=(const MapObject& other) const
184 return id != other.id; 184 return id != other.id;
185} 185}
186 186
187MapObjectEntry::MapObjectEntry(const MapObject& object, int posx, int posy) : object(object) 187MapObjectEntry::MapObjectEntry(
188 const MapObject& object,
189 int posx,
190 int posy,
191 size_t index) :
192 object(object),
193 position(std::make_pair(posx, posy)),
194 index(index)
188{ 195{
189 position = std::make_pair(posx, posy);
190} 196}
191 197
192const MapObject& MapObjectEntry::getObject() const 198const MapObject& MapObjectEntry::getObject() const
@@ -209,6 +215,11 @@ const std::map<std::string, MapObjectEntry::Item>& MapObjectEntry::getItems() co
209 return items; 215 return items;
210} 216}
211 217
218size_t MapObjectEntry::getIndex() const
219{
220 return index;
221}
222
212void MapObjectEntry::addItem(std::string id, Item& item) 223void MapObjectEntry::addItem(std::string id, Item& item)
213{ 224{
214 items[id] = item; 225 items[id] = item;