forked from NaiJi/project-kyoku
33 lines
776 B
C++
33 lines
776 B
C++
#include "classicnote.h"
|
|
#include "graphics/classicsprite.h"
|
|
#include "graphics/classicgraphicsmanager.h"
|
|
|
|
// Replace with interface by dependency injection
|
|
#include "graphics/classicflyinganimationscenario.h"
|
|
#include "graphics/classicdyinganimationscenario.h"
|
|
//
|
|
|
|
ClassicNote::ClassicNote(NoteInitializer &&init) :
|
|
Note(init.perfect_offset),
|
|
_evaluator(init.intervals, _perfect_offset),
|
|
_state(State::NONE),
|
|
_context(init.context)
|
|
{}
|
|
|
|
bool ClassicNote::isActive(const microsec& offset) const
|
|
{
|
|
return _evaluator.isActive(offset)
|
|
&& _state != State::DYING;
|
|
}
|
|
|
|
bool ClassicNote::isInGame() const
|
|
{
|
|
return _state == State::FLYING
|
|
|| _state == State::DYING;
|
|
}
|
|
|
|
bool ClassicNote::shouldRemove() const
|
|
{
|
|
return _state == State::DEAD;
|
|
}
|