project-kyoku/modes/classicmode/game/classicnote.h

57 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#include "classicmode/context.h"
#include "core/note.h"
#include "core/precisionevaluator.h"
#include "classicmode/noteinitializer.h"
class ClassicSprite;
class ClassicAnimationScenario;
class ClassicGraphicsManager;
namespace sf { class RenderTarget; class RenderStates; }
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);
virtual ~ClassicNote() override = default;
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;
virtual void putToGame() override = 0;
2021-09-28 05:48:06 +02:00
virtual void update(const microsec &music_offset) override = 0;
virtual void input(PlayerInput&& inputdata) = 0;
// 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:
const PrecisionEvaluator<Grade> _evaluator;
State _state;
const Context *_context;
};