project-kyoku/modes/classicmode/game/classicgame.h

48 lines
1.1 KiB
C
Raw Normal View History

#ifndef CLASSICGAME_H
#define CLASSICGAME_H
2021-05-31 19:04:16 +02:00
#include <map>
#include <memory>
#include <SFML/Audio/SoundBuffer.hpp>
#include <SFML/Audio/Sound.hpp>
#include "core/game.h"
#include "core/timeline.h"
#include "classicnote.h"
#include "classicactions.h"
class Music;
2021-06-16 19:11:00 +02:00
class ClassicGraphicsManager;
2021-06-07 20:19:58 +02:00
2021-05-31 19:04:16 +02:00
class ClassicGame final : public Game
{
public:
explicit ClassicGame(std::shared_ptr<ClassicGraphicsManager>&& manager, std::unique_ptr<Music>&& music);
virtual ~ClassicGame() override;
virtual void run() override;
virtual void input(PlayerInput &&inputdata) override;
virtual void update() override;
virtual void draw() const override;
2021-05-31 19:04:16 +02:00
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;
2021-06-07 20:19:58 +02:00
std::shared_ptr<ClassicGraphicsManager> _graphics_manager;
Timeline<ClassicNote> _timeline;
sf::SoundBuffer _slap_buffer;
sf::Sound _slap;
std::unique_ptr<Music> _music;
bool _is_paused;
};
#endif // CLASSICGAME_H