2021-10-04 11:30:21 -04:00
|
|
|
#pragma once
|
2021-05-28 13:50:57 -04:00
|
|
|
|
2021-05-31 13:04:16 -04:00
|
|
|
#include <map>
|
2021-08-09 14:59:40 -04:00
|
|
|
#include <memory>
|
2021-09-14 15:02:23 -04:00
|
|
|
|
2021-06-17 15:13:25 -04:00
|
|
|
#include <SFML/Audio/SoundBuffer.hpp>
|
|
|
|
#include <SFML/Audio/Sound.hpp>
|
2021-05-28 13:50:57 -04:00
|
|
|
|
2021-09-14 15:02:23 -04:00
|
|
|
#include "core/game.h"
|
|
|
|
#include "core/timeline.h"
|
|
|
|
|
|
|
|
#include "classicnote.h"
|
|
|
|
#include "classicactions.h"
|
|
|
|
|
2021-08-05 14:59:48 -04:00
|
|
|
class Music;
|
2021-06-16 13:11:00 -04:00
|
|
|
class ClassicGraphicsManager;
|
2021-10-04 11:30:21 -04:00
|
|
|
class HoldManager;
|
2021-06-07 14:19:58 -04:00
|
|
|
|
2021-05-31 13:04:16 -04:00
|
|
|
class ClassicGame final : public Game
|
2021-05-28 13:50:57 -04:00
|
|
|
{
|
|
|
|
public:
|
2021-08-09 14:59:40 -04:00
|
|
|
explicit ClassicGame(std::shared_ptr<ClassicGraphicsManager>&& manager, std::unique_ptr<Music>&& music);
|
2021-06-09 14:08:58 -04:00
|
|
|
virtual ~ClassicGame() override;
|
2021-05-28 13:50:57 -04:00
|
|
|
|
|
|
|
virtual void run() override;
|
|
|
|
|
2021-06-23 15:18:33 -04:00
|
|
|
virtual void input(PlayerInput &&inputdata) override;
|
2021-05-28 13:50:57 -04:00
|
|
|
virtual void update() override;
|
2021-06-23 15:18:33 -04:00
|
|
|
virtual void draw() const override;
|
2021-05-31 13:04:16 -04:00
|
|
|
|
|
|
|
private:
|
2021-06-23 15:18:33 -04:00
|
|
|
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-08-09 14:59:40 -04:00
|
|
|
std::shared_ptr<ClassicGraphicsManager> _graphics_manager;
|
2021-10-04 11:30:21 -04:00
|
|
|
std::shared_ptr<HoldManager> _hold_manager;
|
2021-09-14 15:02:23 -04:00
|
|
|
Timeline<ClassicNote> _timeline;
|
2021-08-09 14:59:40 -04:00
|
|
|
|
2021-06-17 15:13:25 -04:00
|
|
|
sf::SoundBuffer _slap_buffer;
|
|
|
|
sf::Sound _slap;
|
2021-08-05 14:59:48 -04:00
|
|
|
|
|
|
|
std::unique_ptr<Music> _music;
|
|
|
|
|
|
|
|
bool _is_paused;
|
2021-05-28 13:50:57 -04:00
|
|
|
};
|