From 8142a9c87a13cecc7a3698e877f24d89f128c074 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 21 Apr 2018 14:50:52 -0400 Subject: Started working on prototype objects --- src/systems/mapping.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/systems/mapping.cpp') diff --git a/src/systems/mapping.cpp b/src/systems/mapping.cpp index a3a17ec..c7c2f9d 100644 --- a/src/systems/mapping.cpp +++ b/src/systems/mapping.cpp @@ -195,4 +195,18 @@ void MappingSystem::loadMap(size_t mapId) MappableComponent::Boundary::Type::danger); } } + + for (const Map::Object& object : map.getObjects()) + { + const Prototype& prototype = game_.getPrototypeManager(). + getPrototype(object.getType()); + + id_type emplacedObject = prototype.instantiate( + game_, + object.getX(), + object.getY(), + object.getItems()); + + mappable.getInstances()[object.getIndex()] = emplacedObject; + } } -- cgit 1.4.1