9 #include "SFML/Window/Keyboard.hpp"
18 auto drawable = std::dynamic_pointer_cast<Drawable>(component);
19 std::string attribute = component->getAttribute();
20 if (drawable ==
nullptr || event ==
nullptr || attribute !=
"player " + std::to_string(event->id))
24 auto [x, y] = drawable->getPosition();
25 if (event->key == sf::Keyboard::Key::Up)
27 if (event->key == sf::Keyboard::Key::Down)
29 if (event->key == sf::Keyboard::Key::Left)
31 if (event->key == sf::Keyboard::Key::Right)
33 drawable->setPosition({x, y});