2021-09-27 23:48:06 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "classicnote.h"
|
|
|
|
#include "initializers/arrownoteinitializer.h"
|
|
|
|
|
|
|
|
class ClassicArrowNote : public ClassicNote
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit ClassicArrowNote(ArrowNoteInitializer&& init);
|
|
|
|
virtual ~ClassicArrowNote() = default;
|
|
|
|
|
|
|
|
virtual void putToGame(const microsec& music_offset) override;
|
|
|
|
virtual void update(const microsec &music_offset) override;
|
|
|
|
virtual void input(PlayerInput&& inputdata) override;
|
|
|
|
virtual void draw() const override;
|
|
|
|
|
|
|
|
bool allElementsPressed() const;
|
|
|
|
bool isPressedAs(sf::Keyboard::Key key) const;
|
2021-10-04 11:30:21 -04:00
|
|
|
inline bool isHold() const;
|
2021-09-27 23:48:06 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
struct ArrowElement
|
|
|
|
{
|
|
|
|
std::shared_ptr<ClassicSprite> sprite;
|
|
|
|
std::array<std::shared_ptr<ClassicAnimationScenario>, 5> animations;
|
|
|
|
sf::Keyboard::Key pressed_as = sf::Keyboard::Unknown;
|
|
|
|
|
|
|
|
Coordinates coordinates;
|
|
|
|
std::vector<Coordinates> falling_curve_interpolation;
|
|
|
|
std::array<sf::Keyboard::Key, 2> keys;
|
|
|
|
Type type = Type::NONE;
|
|
|
|
bool pressed = false;
|
|
|
|
|
|
|
|
// Each note may consist of several buttons.
|
|
|
|
// For example, ↑ → or ↓ → ←
|
|
|
|
// Note Element represents this idea.
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<ArrowElement> _elements;
|
|
|
|
bool _is_hold;
|
|
|
|
};
|