Update systems to the new view

This commit is contained in:
Zoe Roux
2021-06-05 18:42:10 +02:00
parent acb3935c7c
commit f20445cdc8
24 changed files with 213 additions and 131 deletions
+3 -5
View File
@@ -3,11 +3,9 @@
// Edited by Benjamin Henry on 2021-05-20.
//
#include <iostream>
#include "KeyboardSystem.hpp"
#include "Component/Keyboard/KeyboardComponent.hpp"
#include "Component/Controllable/ControllableComponent.hpp"
#include "Entity/Entity.hpp"
#include "Controllers/Keyboard.hpp"
using Keyboard = RAY::Controller::Keyboard;
@@ -18,10 +16,10 @@ namespace BBM
: System(wal)
{}
void KeyboardSystem::onFixedUpdate(WAL::Entity &entity)
void KeyboardSystem::onFixedUpdate(WAL::ViewEntity<KeyboardComponent, ControllableComponent> &entity)
{
const auto &keyboard = entity.getComponent<KeyboardComponent>();
auto &controllable = entity.getComponent<ControllableComponent>();
const auto &keyboard = entity.get<KeyboardComponent>();
auto &controllable = entity.get<ControllableComponent>();
const std::map<KeyboardKey, bool &> keyPressedMap = {
{keyboard.keyJump, controllable.jump},