2021-09-14 21:02:23 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-09-28 05:48:06 +02:00
|
|
|
#include "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;
|
|
|
|
|
|
|
|
class ClassicNote : public Note
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum class Grade
|
|
|
|
{
|
|
|
|
PERFECT,
|
|
|
|
GOOD,
|
|
|
|
BAD
|
|
|
|
};
|
|
|
|
|
|
|
|
enum State
|
|
|
|
{
|
|
|
|
NONE,
|
|
|
|
|
|
|
|
FLYING,
|
|
|
|
ACTIVE,
|
|
|
|
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-09-28 05:48:06 +02:00
|
|
|
virtual bool isActive() const override final;
|
|
|
|
virtual bool isInGame() const override final;
|
|
|
|
virtual bool shouldRemove() const override final;
|
2021-09-14 21:02:23 +02:00
|
|
|
|
2021-09-28 05:48:06 +02:00
|
|
|
virtual void putToGame(const microsec &music_offset) override = 0;
|
|
|
|
virtual void update(const microsec &music_offset) override = 0;
|
|
|
|
virtual void draw() const 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-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
|
|
|
};
|