2021-06-07 20:19:58 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <SFML/System/Clock.hpp>
|
2021-06-09 20:08:58 +02:00
|
|
|
#include <SFML/Graphics/Drawable.hpp>
|
2021-06-07 20:19:58 +02:00
|
|
|
|
2021-06-23 21:18:33 +02:00
|
|
|
#include "inputtype.h"
|
|
|
|
|
2021-06-07 20:19:58 +02:00
|
|
|
using microsec = sf::Int64;
|
|
|
|
|
2021-06-23 21:18:33 +02:00
|
|
|
class Note
|
2021-06-07 20:19:58 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Note(microsec perfect_offset) :
|
|
|
|
_perfect_offset(perfect_offset) {}
|
2021-06-09 20:08:58 +02:00
|
|
|
virtual ~Note() = default;
|
2021-06-07 20:19:58 +02:00
|
|
|
|
2021-06-22 20:20:08 +02:00
|
|
|
virtual bool isActive(const microsec& music_offset) const = 0;
|
2021-06-11 18:58:44 +02:00
|
|
|
virtual void update(const microsec& music_offset) = 0;
|
2021-06-23 21:18:33 +02:00
|
|
|
virtual void input(PlayerInput&& inputdata) = 0;
|
|
|
|
virtual void draw() const = 0;
|
2021-06-08 20:32:36 +02:00
|
|
|
|
2021-06-21 21:10:50 +02:00
|
|
|
virtual void putToGame(const microsec &offset) = 0;
|
|
|
|
virtual bool isExpired() const = 0;
|
|
|
|
|
|
|
|
microsec offset() const
|
2021-06-08 20:32:36 +02:00
|
|
|
{
|
|
|
|
return _perfect_offset;
|
|
|
|
}
|
|
|
|
|
2021-06-07 20:19:58 +02:00
|
|
|
protected:
|
|
|
|
microsec _perfect_offset;
|
|
|
|
};
|