2021-05-28 13:50:57 -04:00
|
|
|
#ifndef CLASSICGAME_H
|
|
|
|
#define CLASSICGAME_H
|
|
|
|
|
2021-05-31 13:04:16 -04:00
|
|
|
#include <map>
|
2021-06-11 12:58:44 -04:00
|
|
|
#include <list>
|
2021-05-28 13:50:57 -04:00
|
|
|
#include "game.h"
|
2021-05-31 13:04:16 -04:00
|
|
|
#include "classicactions.h"
|
2021-06-16 11:16:18 -04:00
|
|
|
#include "spritecontainer.h"
|
2021-05-28 13:50:57 -04:00
|
|
|
|
2021-06-07 14:19:58 -04:00
|
|
|
class ClassicTimeline;
|
|
|
|
|
2021-05-31 13:04:16 -04:00
|
|
|
class ClassicGame final : public Game
|
2021-05-28 13:50:57 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit ClassicGame();
|
2021-06-09 14:08:58 -04:00
|
|
|
virtual ~ClassicGame() override;
|
2021-05-28 13:50:57 -04:00
|
|
|
|
|
|
|
virtual void run() override;
|
|
|
|
|
|
|
|
virtual void input(const sf::Event& event) override;
|
|
|
|
virtual void update() override;
|
2021-06-09 14:08:58 -04:00
|
|
|
virtual void draw(sf::RenderWindow &window) const override;
|
2021-05-31 13:04:16 -04: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;
|
2021-06-07 14:19:58 -04:00
|
|
|
|
|
|
|
std::unique_ptr<ClassicTimeline> _timeline;
|
2021-06-16 11:16:18 -04:00
|
|
|
SpriteContainer _sprite_container;
|
2021-05-28 13:50:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CLASSICGAME_H
|