2021-06-07 14:19:58 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <SFML/System/Clock.hpp>
|
2021-06-09 14:08:58 -04:00
|
|
|
#include <SFML/Graphics/Drawable.hpp>
|
2021-06-07 14:19:58 -04:00
|
|
|
|
|
|
|
using microsec = sf::Int64;
|
|
|
|
|
2021-06-09 14:08:58 -04:00
|
|
|
class Note : public sf::Drawable
|
2021-06-07 14:19:58 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Note(microsec perfect_offset) :
|
|
|
|
_perfect_offset(perfect_offset) {}
|
2021-06-09 14:08:58 -04:00
|
|
|
virtual ~Note() = default;
|
2021-06-07 14:19:58 -04:00
|
|
|
|
2021-06-11 12:58:44 -04:00
|
|
|
virtual bool isActive(const microsec& music_offset) const = 0;
|
|
|
|
virtual void update(const microsec& music_offset) = 0;
|
2021-06-09 14:08:58 -04:00
|
|
|
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const = 0;
|
2021-06-08 14:32:36 -04:00
|
|
|
|
|
|
|
virtual microsec offset() const
|
|
|
|
{
|
|
|
|
return _perfect_offset;
|
|
|
|
}
|
|
|
|
|
2021-06-07 14:19:58 -04:00
|
|
|
protected:
|
|
|
|
microsec _perfect_offset;
|
|
|
|
};
|