2021-09-14 21:02:23 +02:00
|
|
|
#include "classicnote.h"
|
2021-11-17 23:14:52 +01:00
|
|
|
#include "graphics/classicsprite.h"
|
2021-12-23 18:33:24 +01:00
|
|
|
#include "game/classicgraphicsmanager.h"
|
2021-09-14 21:02:23 +02:00
|
|
|
|
|
|
|
// Replace with interface by dependency injection
|
2021-11-17 23:14:52 +01:00
|
|
|
#include "graphics/classicflyinganimationscenario.h"
|
|
|
|
#include "graphics/classicdyinganimationscenario.h"
|
2021-09-14 21:02:23 +02:00
|
|
|
//
|
|
|
|
|
2021-09-28 05:48:06 +02:00
|
|
|
ClassicNote::ClassicNote(NoteInitializer &&init) :
|
2021-09-14 21:02:23 +02:00
|
|
|
Note(init.perfect_offset),
|
|
|
|
_evaluator(init.intervals, _perfect_offset),
|
2021-09-28 05:48:06 +02:00
|
|
|
_state(State::NONE),
|
|
|
|
_context(init.context)
|
|
|
|
{}
|
2021-09-14 21:02:23 +02:00
|
|
|
|
2021-12-08 19:00:47 +01:00
|
|
|
bool ClassicNote::isActive(const microsec& offset) const
|
2021-09-14 21:02:23 +02:00
|
|
|
{
|
2021-12-08 19:00:47 +01:00
|
|
|
return _evaluator.isActive(offset)
|
|
|
|
&& _state != State::DYING;
|
2021-09-14 21:02:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ClassicNote::isInGame() const
|
|
|
|
{
|
|
|
|
return _state == State::FLYING
|
|
|
|
|| _state == State::DYING;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ClassicNote::shouldRemove() const
|
|
|
|
{
|
|
|
|
return _state == State::DEAD;
|
|
|
|
}
|