You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
project-kyoku/note.h

46 lines
725 B
C++

#ifndef NOTE_H
#define NOTE_H
#include <SFML/System/Clock.hpp>
using microsec = sf::Int64;
struct NoteGrade
{
int score = 0;
enum class Rating
{
WRONG,
BAD,
GOOD,
GREAT
} rating = Rating::BAD;
};
class Note
{
public:
enum class Arrow
{
UP,
RIGHT,
DOWN,
LEFT
};
Note(microsec offset, microsec death_offset, Note::Arrow type = Note::Arrow::UP);
NoteGrade onTap(Arrow arrow_type, microsec tap_time_stamp) const;
microsec deathOffset() const noexcept;
private:
microsec _offset;
microsec _death_offset;
Arrow _type = Arrow::UP;
NoteGrade calculatePrecision(microsec odds) const;
};
#endif // NOTE_H