Fixed indentation

This commit is contained in:
stiffly
2015-12-11 15:29:57 +01:00
parent 16d636a87c
commit 3da69c8a1b
5 changed files with 171 additions and 175 deletions
+44 -48
View File
@@ -3,60 +3,56 @@
void PlayerSystem::Update(World * world, ComponentWrapper & player, double dt)
{
if (input.Forward) {
m_Direction.z = -1;
}
else if (input.Back) {
m_Direction.z = 1;
}
else {
m_Direction.z = 0;
}
if (input.Left) {
m_Direction.x = -1;
}
else if (input.Right) {
m_Direction.x = 1;
}
else {
m_Direction.x = 0;
}
m_EventBroker->Process<PlayerSystem>();
ComponentWrapper& transform = world->GetComponent(player.EntityID, "Transform");
(glm::vec3&)player["Velocity"] = m_Speed * float(dt) * m_Direction;
(glm::vec3&)transform["Position"] += (glm::vec3)player["Velocity"];
if (input.Forward) {
m_Direction.z = -1;
} else if (input.Back) {
m_Direction.z = 1;
} else {
m_Direction.z = 0;
}
if (input.Left) {
m_Direction.x = -1;
} else if (input.Right) {
m_Direction.x = 1;
} else {
m_Direction.x = 0;
}
m_EventBroker->Process<PlayerSystem>();
ComponentWrapper& transform = world->GetComponent(player.EntityID, "Transform");
(glm::vec3&)player["Velocity"] = m_Speed * float(dt) * m_Direction;
(glm::vec3&)transform["Position"] += (glm::vec3)player["Velocity"];
}
bool PlayerSystem::OnKeyDown(const Events::KeyDown & event)
{
if (event.KeyCode == GLFW_KEY_W) {
input.Forward = true;
}
if (event.KeyCode == GLFW_KEY_A) {
input.Left = true;
}
if (event.KeyCode == GLFW_KEY_S) {
input.Back = true;
}
if (event.KeyCode == GLFW_KEY_D) {
input.Right = true;
}
return true;
if (event.KeyCode == GLFW_KEY_W) {
input.Forward = true;
}
if (event.KeyCode == GLFW_KEY_A) {
input.Left = true;
}
if (event.KeyCode == GLFW_KEY_S) {
input.Back = true;
}
if (event.KeyCode == GLFW_KEY_D) {
input.Right = true;
}
return true;
}
bool PlayerSystem::OnKeyUp(const Events::KeyUp & event)
{
if (event.KeyCode == GLFW_KEY_W) {
input.Forward = false;
}
if (event.KeyCode == GLFW_KEY_A) {
input.Left = false;
}
if (event.KeyCode == GLFW_KEY_S) {
input.Back = false;
}
if (event.KeyCode == GLFW_KEY_D) {
input.Right = false;
}
return false;
if (event.KeyCode == GLFW_KEY_W) {
input.Forward = false;
}
if (event.KeyCode == GLFW_KEY_A) {
input.Left = false;
}
if (event.KeyCode == GLFW_KEY_S) {
input.Back = false;
}
if (event.KeyCode == GLFW_KEY_D) {
input.Right = false;
}
return false;
}