project-kyoku/src/classicgame/classicgame.h

31 lines
750 B
C
Raw Normal View History

#ifndef CLASSICGAME_H
#define CLASSICGAME_H
2021-05-31 19:04:16 +02:00
#include <map>
#include "game.h"
2021-05-31 19:04:16 +02:00
#include "classicactions.h"
2021-05-31 19:04:16 +02:00
class ClassicGame final : public Game
{
public:
explicit ClassicGame();
2021-05-31 19:04:16 +02:00
virtual ~ClassicGame() override = default;
virtual void run() override;
virtual void input(const sf::Event& event) override;
virtual void update() override;
virtual void draw(const sf::RenderWindow& window) const override;
2021-05-31 19:04:16 +02:00
private:
std::map<sf::Keyboard::Key, Button> _keys_to_buttons;
std::map<Button, Action> _buttons_to_pressed_actions;
std::map<Button, Action> _buttons_to_released_actions;
Action getActionKeyPressed(Button button) const;
Action getActionKeyReleased(Button button) const;
};
#endif // CLASSICGAME_H