summary refs log tree commit diff stats
path: root/tools/mapedit/src/object.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-05-17 15:55:37 -0400
committerGitHub <noreply@github.com>2018-05-17 15:55:37 -0400
commit90aadf3844386824140a20d7fbb847bc16009a94 (patch)
tree6f83fce90e71abb22b1a8f3e09c79963b2a34d5d /tools/mapedit/src/object.cpp
parentbc63fa57ced1c7329f7fdcfd168eaf7e290158bc (diff)
parent86f0106d0523825549f1e74b835688c78a10cf6c (diff)
downloadtherapy-90aadf3844386824140a20d7fbb847bc16009a94.tar.gz
therapy-90aadf3844386824140a20d7fbb847bc16009a94.tar.bz2
therapy-90aadf3844386824140a20d7fbb847bc16009a94.zip
Merge pull request #7 from hatkirby/es-rewrite
The ECS rewrite exceeds the original branch in functionality, so it is time to merge it in.
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;