project-kyoku/src/modes/classicmode/game/classicarrownote.h

44 lines
1.2 KiB
C
Raw Normal View History

2021-09-28 05:48:06 +02:00
#pragma once
#include "arrowelement.h"
2022-02-10 00:30:49 +01:00
#include "classicmode/classicnote.h"
2021-12-29 15:59:18 +01:00
2022-02-10 00:30:49 +01:00
#include "classicmode/arrownoteinitializer.h"
class HoldManager;
2021-09-28 05:48:06 +02:00
class ClassicArrowNote : public ClassicNote
{
public:
2022-02-06 02:33:09 +01:00
enum class Grade
{
PERFECT,
GOOD,
BAD
};
2022-02-10 00:30:49 +01:00
explicit ClassicArrowNote(ArrowNoteInitializer&& init, const std::shared_ptr<HoldManager>& hold_manager);
2021-09-28 05:48:06 +02:00
virtual ~ClassicArrowNote() = default;
2022-02-06 02:33:09 +01:00
virtual bool isActive(const kku::microsec& offset) const override;
2021-12-29 15:59:18 +01:00
virtual void update(const kku::microsec &music_offset) override;
virtual void input(kku::GameEvent&& input) override;
2021-09-28 05:48:06 +02:00
virtual void display(const ClassicGraphicsManager * const manager) const override;
2021-12-29 15:59:18 +01:00
virtual void setGraphics(ClassicGraphicsManager * const manager, kku::TimeRange&& range) override;
virtual void removeGraphics(ClassicGraphicsManager * const manager) override;
2021-09-28 05:48:06 +02:00
bool allElementsPressed() const;
2022-01-11 21:15:24 +01:00
bool isPressedAs(kku::SystemEvent::Key::Code key) const;
2021-10-04 17:30:21 +02:00
inline bool isHold() const;
2021-09-28 05:48:06 +02:00
private:
2022-02-06 02:33:09 +01:00
const kku::PrecisionEvaluator<Grade> _evaluator;
2022-02-10 00:30:49 +01:00
const std::shared_ptr<HoldManager> _hold_manager;
2022-02-06 02:33:09 +01:00
2021-09-28 05:48:06 +02:00
std::vector<ArrowElement> _elements;
bool _is_hold;
};
using ArrowElements = std::vector<ArrowElement>;