project-kyoku/src/classicgame/classicgame.h

49 lines
1.2 KiB
C
Raw Normal View History

#ifndef CLASSICGAME_H
#define CLASSICGAME_H
2021-05-31 13:04:16 -04:00
#include <map>
#include <memory>
#include "game/game.h"
2021-05-31 13:04:16 -04:00
#include "classicactions.h"
#include <SFML/Audio/SoundBuffer.hpp>
#include <SFML/Audio/Sound.hpp>
class Music;
2021-07-21 14:15:56 -04:00
class ClassicNote;
2021-06-07 14:19:58 -04:00
class ClassicTimeline;
2021-06-16 13:11:00 -04:00
class ClassicGraphicsManager;
class ClassicNoteManager;
2021-06-07 14:19:58 -04:00
2021-05-31 13:04:16 -04: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 13:04:16 -04: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 14:19:58 -04:00
2021-07-21 14:15:56 -04:00
std::vector<ClassicNote*> _notes_on_hold;
2021-06-07 14:19:58 -04:00
std::unique_ptr<ClassicTimeline> _timeline;
std::shared_ptr<ClassicGraphicsManager> _graphics_manager;
std::shared_ptr<ClassicNoteManager> _note_manager;
sf::SoundBuffer _slap_buffer;
sf::Sound _slap;
std::unique_ptr<Music> _music;
bool _is_paused;
};
#endif // CLASSICGAME_H