2021-09-14 15:02:23 -04:00
|
|
|
#pragma once
|
|
|
|
|
2021-12-03 14:21:27 -05:00
|
|
|
#include "context.h"
|
2021-09-14 15:02:23 -04:00
|
|
|
#include "core/note.h"
|
|
|
|
#include "core/precisionevaluator.h"
|
2021-11-23 13:35:13 -05:00
|
|
|
#include "classicmode/noteinitializer.h"
|
2021-09-14 15:02:23 -04:00
|
|
|
|
|
|
|
class ClassicSprite;
|
|
|
|
class ClassicAnimationScenario;
|
|
|
|
|
|
|
|
class ClassicNote : public Note
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum class Grade
|
|
|
|
{
|
|
|
|
PERFECT,
|
|
|
|
GOOD,
|
|
|
|
BAD
|
|
|
|
};
|
|
|
|
|
|
|
|
enum State
|
|
|
|
{
|
|
|
|
NONE,
|
|
|
|
|
|
|
|
FLYING,
|
|
|
|
DYING,
|
|
|
|
DEAD
|
|
|
|
};
|
|
|
|
|
2021-09-27 23:48:06 -04:00
|
|
|
explicit ClassicNote(NoteInitializer&& init);
|
2021-11-24 13:21:30 -05:00
|
|
|
virtual ~ClassicNote() override = default;
|
2021-09-14 15:02:23 -04:00
|
|
|
|
2021-12-08 13:00:47 -05:00
|
|
|
virtual bool isActive(const microsec& offset) const override final;
|
2021-09-27 23:48:06 -04:00
|
|
|
virtual bool isInGame() const override final;
|
|
|
|
virtual bool shouldRemove() const override final;
|
2021-09-14 15:02:23 -04:00
|
|
|
|
2021-09-27 23:48:06 -04: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 15:02:23 -04:00
|
|
|
|
2021-11-23 13:35:13 -05:00
|
|
|
virtual void input(PlayerInput&& inputdata) = 0;
|
|
|
|
|
2021-09-27 23:48:06 -04:00
|
|
|
protected:
|
2021-09-14 15:02:23 -04:00
|
|
|
const PrecisionEvaluator<Grade> _evaluator;
|
|
|
|
|
|
|
|
State _state;
|
2021-11-02 13:03:27 -04:00
|
|
|
const Context *_context;
|
2021-09-14 15:02:23 -04:00
|
|
|
};
|