Oops! Removed DebugCode...
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
#include "Core/EntityFileParser.h"
|
||||
|
||||
#include "Core/EPlayerDeath.h"
|
||||
#include "Core/EPlayerDamage.h"
|
||||
|
||||
class PlayerDeathSystem : public ImpureSystem
|
||||
{
|
||||
@@ -23,9 +22,5 @@ public:
|
||||
private:
|
||||
EventRelay<PlayerDeathSystem, Events::PlayerDeath> m_OnPlayerDeath;
|
||||
bool OnPlayerDeath(Events::PlayerDeath& e);
|
||||
|
||||
EventRelay<PlayerDeathSystem, Events::InputCommand> m_OnInputCommand;
|
||||
bool OnInputCommand(const Events::InputCommand& e);
|
||||
|
||||
};
|
||||
#endif
|
||||
@@ -3,40 +3,9 @@
|
||||
PlayerDeathSystem::PlayerDeathSystem(World* m_World, EventBroker* eventBroker)
|
||||
: System(m_World, eventBroker)
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_OnInputCommand, &PlayerDeathSystem::OnInputCommand);
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user