Updated all uses of EntityXMLFile to use the new EntityFile to load entities into a world.

This commit is contained in:
2016-03-02 20:12:59 +01:00
parent 3ef15dcb81
commit 7624c6ee0a
17 changed files with 41 additions and 60 deletions
+4 -8
View File
@@ -328,10 +328,8 @@ bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e)
void PlayerMovementSystem::spawnHexagon(EntityWrapper target)
{
//put a hexagon at the entitys... feet?
auto hexagonEffect = ResourceManager::Load<EntityXMLFile>("Schema/Entities/DoubleJumpHexagon.xml");
EntityXMLFileParser parser(hexagonEffect);
EntityID hexagonEffectID = parser.MergeEntities(m_World);
EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID);
auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/DoubleJumpHexagon.xml");
EntityWrapper hexagonEW = entityFile->MergeInto(m_World);
hexagonEW["Transform"]["Position"] = (glm::vec3)target["Transform"]["Position"];
}
@@ -342,10 +340,8 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
return false;
}
auto dashEffectResource = ResourceManager::Load<EntityXMLFile>("Schema/Entities/DashEffect.xml");
EntityXMLFileParser parser(dashEffectResource);
EntityID dashEffectID = parser.MergeEntities(m_World);
EntityWrapper dashEffect(m_World, dashEffectID);
auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/DashEffect.xml");
EntityWrapper dashEffect = entityFile->MergeInto(m_World);
auto playerModel = player.FirstChildByName("PlayerModel");
auto playerEntityModel = playerModel["Model"];
auto playerEntityAnimation = playerModel["Animation"];