From 046ee24a341468e9b3ea2983a731dbce18b52ac6 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 13 May 2018 11:00:02 -0400 Subject: Integrated RealizableComponent into RealizingSystem --- src/systems/playing.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'src/systems/playing.cpp') diff --git a/src/systems/playing.cpp b/src/systems/playing.cpp index dabc9a5..6652099 100644 --- a/src/systems/playing.cpp +++ b/src/systems/playing.cpp @@ -5,7 +5,6 @@ #include "components/playable.h" #include "components/controllable.h" #include "components/orientable.h" -#include "components/realizable.h" #include "systems/mapping.h" #include "systems/pondering.h" #include "systems/orienting.h" @@ -36,13 +35,10 @@ void PlayingSystem::initPlayer() auto& realizing = game_.getSystemManager().getSystem(); - auto& realizable = game_.getEntityManager(). - getComponent(realizing.getSingleton()); - auto& transformable = game_.getEntityManager(). emplaceComponent(player); - transformable.pos = realizable.startingPos; + transformable.pos = realizing.getStartingPos(); transformable.size.w() = 10; transformable.size.h() = 12; @@ -56,13 +52,13 @@ void PlayingSystem::initPlayer() auto& playable = game_.getEntityManager(). emplaceComponent(player); - playable.mapId = realizable.activeMap; - playable.checkpointMapId = realizable.startingMapId; - playable.checkpointPos = realizable.startingPos; + playable.mapId = realizing.getActiveMap(); + playable.checkpointMapId = realizing.getStartingMapId(); + playable.checkpointPos = realizing.getStartingPos(); realizing.enterActiveMap(player); - realizable.activePlayer = player; + realizing.setActivePlayer(player); } void PlayingSystem::changeMap( @@ -77,20 +73,16 @@ void PlayingSystem::changeMap( getComponent(player); auto& pondering = game_.getSystemManager().getSystem(); - auto& realizing = game_.getSystemManager().getSystem(); - auto& realizable = game_.getEntityManager(). - getComponent(realizing.getSingleton()); - - id_type newMapEntity = realizable.entityByMapId[mapId]; + id_type newMapEntity = realizing.getEntityByMapId(mapId); if (playable.mapId != newMapEntity) { - if (playable.mapId == realizable.activeMap) + if (playable.mapId == realizing.getActiveMap()) { realizing.leaveActiveMap(player); - } else if (newMapEntity == realizable.activeMap) + } else if (newMapEntity == realizing.getActiveMap()) { realizing.enterActiveMap(player); } @@ -102,7 +94,7 @@ void PlayingSystem::changeMap( transformable.pos = warpPos; - if (realizable.activePlayer == player) + if (realizing.getActivePlayer() == player) { realizing.loadMap(newMapEntity); } -- cgit 1.4.1