2021-06-07 20:19:58 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-06-24 00:43:13 +02:00
|
|
|
#include "classicactions.h"
|
2021-08-09 20:59:40 +02:00
|
|
|
#include "game/precisionevaluator.h"
|
|
|
|
|
|
|
|
#include "SFML/Window/Keyboard.hpp"
|
2021-06-07 20:19:58 +02:00
|
|
|
|
2021-06-09 20:08:58 +02:00
|
|
|
#include <memory>
|
2021-08-09 20:59:40 +02:00
|
|
|
#include <vector>
|
2021-06-21 21:10:50 +02:00
|
|
|
#include <array>
|
2021-06-09 20:08:58 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
enum class ClassicGrade
|
2021-06-07 20:19:58 +02:00
|
|
|
{
|
2021-08-09 20:59:40 +02:00
|
|
|
PERFECT,
|
|
|
|
GOOD,
|
|
|
|
BAD
|
|
|
|
};
|
2021-07-15 04:45:52 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
enum ClassicNoteState
|
|
|
|
{
|
|
|
|
NONE,
|
2021-07-15 04:45:52 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
FLYING,
|
|
|
|
ACTIVE,
|
|
|
|
DYING,
|
|
|
|
DEAD
|
|
|
|
};
|
2021-06-09 20:08:58 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
class ClassicSprite;
|
|
|
|
class ClassicAnimationScenario;
|
2021-06-21 21:10:50 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
struct ClassicNote
|
|
|
|
{
|
|
|
|
PrecisionEvaluator<ClassicGrade> evaluator;
|
|
|
|
std::vector<microsec> intervals;
|
|
|
|
bool hold = false;
|
2021-07-21 20:15:56 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
ClassicNoteState state = ClassicNoteState::NONE;
|
2021-06-09 20:08:58 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
struct Element
|
2021-07-14 17:24:47 +02:00
|
|
|
{
|
2021-07-19 19:59:23 +02:00
|
|
|
Coordinates coordinates; // Each note may consist of several buttons.
|
2021-08-09 20:59:40 +02:00
|
|
|
// For example, ↑ → or ↓ → ←
|
2021-07-19 19:59:23 +02:00
|
|
|
// Note Element represents this idea.
|
|
|
|
bool pressed = false; // Each ending button in such sequence
|
|
|
|
sf::Keyboard::Key pressed_as; // is an element.
|
2021-07-14 17:24:47 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
Type type = Type::NONE;
|
|
|
|
std::vector<Coordinates> falling_curve_interpolation;
|
|
|
|
std::array<sf::Keyboard::Key, 2> available_keys;
|
|
|
|
std::shared_ptr<ClassicSprite> sprite;
|
|
|
|
std::array<std::shared_ptr<ClassicAnimationScenario>, 5> animations;
|
|
|
|
};
|
2021-06-24 00:43:13 +02:00
|
|
|
|
2021-08-09 20:59:40 +02:00
|
|
|
std::vector<Element> elements;
|
2021-06-07 20:19:58 +02:00
|
|
|
};
|