This commit is contained in:
Tleety
2016-03-04 02:52:04 +01:00
parent 45991000ae
commit 0e95c5bb95
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ protected:
const std::string m_ComponentType;
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) = 0;
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt) = 0;
};
class ImpureSystem : public virtual System
+1 -1
View File
@@ -15,7 +15,7 @@ class ScoreScreenSystem : public PureSystem
public:
ScoreScreenSystem(SystemParams params);
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt) override;
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt) override;
EventRelay<ScoreScreenSystem, Events::KillDeath> m_EPlayerDeath;
bool OnPlayerDeath(const Events::KillDeath& e);
+6 -1
View File
@@ -11,7 +11,7 @@ ScoreScreenSystem::ScoreScreenSystem(SystemParams params)
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDisconnected, &ScoreScreenSystem::OnPlayerDisconnected);
}
void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt)
void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt)
{
if (!IsServer) {
return;
@@ -28,6 +28,8 @@ void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper&
if(entity.HasComponent("Team")) {
currentTeam = (int)entity["Team"]["Team"];
} else {
return;
}
auto children = entity.ChildrenWithComponent("ScoreIdentity");
@@ -56,6 +58,9 @@ void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper&
}
}
found = true;
if(!child.Valid()) {
break;
}
//Update Deaths for child
(int&)child["ScoreIdentity"]["Kills"] = it->second.Kills;
//Update Kills for child