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