Files
DarkRP2DServer/src/core/systems/InputProcessor.h
2020-03-28 13:50:48 +01:00

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.
});
};
};