mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-15 06:05:53 +00:00
Update systems to the new view
This commit is contained in:
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user