Oops! Removed DebugCode...
This commit is contained in:
@@ -11,7 +11,6 @@
|
|||||||
#include "Core/EntityFileParser.h"
|
#include "Core/EntityFileParser.h"
|
||||||
|
|
||||||
#include "Core/EPlayerDeath.h"
|
#include "Core/EPlayerDeath.h"
|
||||||
#include "Core/EPlayerDamage.h"
|
|
||||||
|
|
||||||
class PlayerDeathSystem : public ImpureSystem
|
class PlayerDeathSystem : public ImpureSystem
|
||||||
{
|
{
|
||||||
@@ -23,9 +22,5 @@ public:
|
|||||||
private:
|
private:
|
||||||
EventRelay<PlayerDeathSystem, Events::PlayerDeath> m_OnPlayerDeath;
|
EventRelay<PlayerDeathSystem, Events::PlayerDeath> m_OnPlayerDeath;
|
||||||
bool OnPlayerDeath(Events::PlayerDeath& e);
|
bool OnPlayerDeath(Events::PlayerDeath& e);
|
||||||
|
|
||||||
EventRelay<PlayerDeathSystem, Events::InputCommand> m_OnInputCommand;
|
|
||||||
bool OnInputCommand(const Events::InputCommand& e);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@@ -3,40 +3,9 @@
|
|||||||
PlayerDeathSystem::PlayerDeathSystem(World* m_World, EventBroker* eventBroker)
|
PlayerDeathSystem::PlayerDeathSystem(World* m_World, EventBroker* eventBroker)
|
||||||
: System(m_World, eventBroker)
|
: System(m_World, eventBroker)
|
||||||
{
|
{
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_OnInputCommand, &PlayerDeathSystem::OnInputCommand);
|
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_OnPlayerDeath, &PlayerDeathSystem::OnPlayerDeath);
|
EVENT_SUBSCRIBE_MEMBER(m_OnPlayerDeath, &PlayerDeathSystem::OnPlayerDeath);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerDeathSystem::OnInputCommand(const Events::InputCommand& e)
|
|
||||||
{
|
|
||||||
//testing: Jump > playerdamage
|
|
||||||
if (e.Command != "Jump") {
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 0 = released
|
|
||||||
if (e.Value != 0) {
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
auto players = m_World->GetComponents("Player");
|
|
||||||
|
|
||||||
for (auto& cPlayer : *players) {
|
|
||||||
EntityWrapper player(m_World, cPlayer.EntityID);
|
|
||||||
Events::PlayerDamage e;
|
|
||||||
e.Player = player;
|
|
||||||
e.Damage = 50;
|
|
||||||
m_EventBroker->Publish(e);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlayerDeathSystem::Update(double dt)
|
void PlayerDeathSystem::Update(double dt)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user