#pragma once #include "core/precisionevaluator.h" #include "classicmode/classicnote.h" #include "game/arrowelement.h" #include class Context; class ClassicArrowNote : public ClassicNote { public: struct Init { const std::shared_ptr context; const kku::microsec perfect_offset = 0; const std::vector& intervals = {}; const std::vector& elements = {}; const bool is_holding = false; }; enum class Grade { PERFECT = 0, GOOD = 1, BAD = 2 }; explicit ClassicArrowNote(Init&& init); virtual bool isActive(const kku::microsec& offset) const override; virtual void update(const kku::microsec &music_offset) override; virtual void input(kku::GameEvent&& input) override; bool isHold() const; std::vector& getElements(); Grade calculatePrecision(const kku::microsec& offset) const; bool isPressedAs(kku::SystemEvent::Key::Code key) const; private: const kku::PrecisionEvaluator _evaluator; std::vector _elements; const std::shared_ptr _context; bool _is_holding; };