19 lines
586 B
C
19 lines
586 B
C
#pragma once
|
|
|
|
#include <entityx/entityx.h>
|
|
#include "../../GameServer.h"
|
|
#include "../Components.h"
|
|
|
|
struct InputProcessor : public entityx::System<InputProcessor>
|
|
{
|
|
InputProcessor(GameServer *server) : m_gserver(server) {}
|
|
GameServer *m_gserver;
|
|
|
|
void update(entityx::EntityManager &es, entityx::EventManager &events, entityx::TimeDelta dt) override
|
|
{
|
|
//For each with input component look for id
|
|
es.each<InputVelocity, PhysicBody>([](entityx::Entity entity, InputVelocity &iVel, PhysicBody &bod) {
|
|
// Do things with entity, position and direction.
|
|
});
|
|
};
|
|
}; |