2021-09-14 21:02:23 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-12-09 08:55:53 +01:00
|
|
|
#include "classicmode/context.h"
|
2021-09-14 21:02:23 +02:00
|
|
|
#include "core/note.h"
|
|
|
|
#include "core/precisionevaluator.h"
|
2021-11-23 19:35:13 +01:00
|
|
|
#include "classicmode/noteinitializer.h"
|
2021-09-14 21:02:23 +02:00
|
|
|
|
|
|
|
class ClassicSprite;
|
|
|
|
class ClassicAnimationScenario;
|
2021-12-23 18:33:24 +01:00
|
|
|
class ClassicGraphicsManager;
|
|
|
|
|
|
|
|
namespace sf { class RenderTarget; class RenderStates; }
|
2021-09-14 21:02:23 +02:00
|
|
|
|
|
|
|
class ClassicNote : public Note
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum class Grade
|
|
|
|
{
|
|
|
|
PERFECT,
|
|
|
|
GOOD,
|
|
|
|
BAD
|
|
|
|
};
|
|
|
|
|
|
|
|
enum State
|
|
|
|
{
|
|
|
|
NONE,
|
|
|
|
|
|
|
|
FLYING,
|
|
|
|
DYING,
|
|
|
|
DEAD
|
|
|
|
};
|
|
|
|
|
2021-09-28 05:48:06 +02:00
|
|
|
explicit ClassicNote(NoteInitializer&& init);
|
2021-11-24 19:21:30 +01:00
|
|
|
virtual ~ClassicNote() override = default;
|
2021-09-14 21:02:23 +02:00
|
|
|
|
2021-12-08 19:00:47 +01:00
|
|
|
virtual bool isActive(const microsec& offset) const override final;
|
2021-09-28 05:48:06 +02:00
|
|
|
virtual bool isInGame() const override final;
|
|
|
|
virtual bool shouldRemove() const override final;
|
2021-09-14 21:02:23 +02:00
|
|
|
|
2021-12-23 18:33:24 +01:00
|
|
|
virtual void putToGame() override = 0;
|
2021-09-28 05:48:06 +02:00
|
|
|
virtual void update(const microsec &music_offset) override = 0;
|
2021-09-14 21:02:23 +02:00
|
|
|
|
2021-11-23 19:35:13 +01:00
|
|
|
virtual void input(PlayerInput&& inputdata) = 0;
|
|
|
|
|
2021-12-23 18:33:24 +01:00
|
|
|
// encapsulate
|
|
|
|
virtual void draw(const ClassicGraphicsManager * const manager, sf::RenderTarget& target, sf::RenderStates states) const = 0;
|
|
|
|
virtual void setGraphics(ClassicGraphicsManager * const manager, TimeRange&& range) = 0;
|
|
|
|
//
|
|
|
|
|
2021-09-28 05:48:06 +02:00
|
|
|
protected:
|
2021-09-14 21:02:23 +02:00
|
|
|
const PrecisionEvaluator<Grade> _evaluator;
|
|
|
|
|
|
|
|
State _state;
|
2021-11-02 18:03:27 +01:00
|
|
|
const Context *_context;
|
2021-09-14 21:02:23 +02:00
|
|
|
};
|