project-kyoku/src/classicgame/classicgame.h

40 lines
1002 B
C++

#ifndef CLASSICGAME_H
#define CLASSICGAME_H
#include <map>
#include "game.h"
#include "classicactions.h"
#include <SFML/Audio/SoundBuffer.hpp>
#include <SFML/Audio/Sound.hpp>
class ClassicNote;
class ClassicTimeline;
class ClassicGraphicsManager;
class ClassicGame final : public Game
{
public:
explicit ClassicGame(std::unique_ptr<ClassicGraphicsManager>&& manager);
virtual ~ClassicGame() override;
virtual void run() override;
virtual void input(PlayerInput &&inputdata) override;
virtual void update() override;
virtual void draw() const override;
private:
std::map<sf::Keyboard::Key, Type> _keys_to_buttons;
std::map<Type, Action> _buttons_to_pressed_actions;
std::map<Type, Action> _buttons_to_released_actions;
std::vector<ClassicNote*> _notes_on_hold;
std::unique_ptr<ClassicTimeline> _timeline;
std::unique_ptr<ClassicGraphicsManager> _graphics_manager;
sf::SoundBuffer _slap_buffer;
sf::Sound _slap;
};
#endif // CLASSICGAME_H