Adding models now crashes. Threading
Added a create player event that currently is not used.
This commit is contained in:
stiffly
2015-12-15 11:21:46 +01:00
parent 3f77da4a07
commit b698a0d36f
11 changed files with 161 additions and 66 deletions
+6
View File
@@ -9,6 +9,7 @@
#include "Core/EventBroker.h"
#include "Core/EKeyDown.h"
#include "Core/EKeyUp.h"
#include "ECreatePlayer.h"
struct KeyInput
{
@@ -26,6 +27,7 @@ public:
{
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &PlayerSystem::OnKeyDown);
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &PlayerSystem::OnKeyUp);
EVENT_SUBSCRIBE_MEMBER(m_ECreatePlayer, &PlayerSystem::OnCreatePlayer);
}
virtual void Update(World* world, ComponentWrapper& player, double dt) override;
@@ -34,11 +36,15 @@ private:
float m_Speed = 5;
glm::vec3 m_Direction;
KeyInput input;
bool ShouldCreatePlayer = false;
void CreatePlayer(World * world, unsigned int& entityID);
EventRelay<PlayerSystem, Events::KeyDown> m_EKeyDown;
bool OnKeyDown(const Events::KeyDown &event);
EventRelay<PlayerSystem, Events::KeyUp> m_EKeyUp;
bool OnKeyUp(const Events::KeyUp &event);
EventRelay<PlayerSystem, Events::CreatePlayer> m_ECreatePlayer;
bool OnCreatePlayer(const Events::CreatePlayer &event);
};
#endif