2021-09-14 15:02:23 -04:00
|
|
|
#include "classicnote.h"
|
2021-11-17 17:14:52 -05:00
|
|
|
#include "graphics/classicsprite.h"
|
|
|
|
#include "graphics/classicgraphicsmanager.h"
|
2021-09-14 15:02:23 -04:00
|
|
|
|
|
|
|
// Replace with interface by dependency injection
|
2021-11-17 17:14:52 -05:00
|
|
|
#include "graphics/classicflyinganimationscenario.h"
|
|
|
|
#include "graphics/classicdyinganimationscenario.h"
|
2021-09-14 15:02:23 -04:00
|
|
|
//
|
|
|
|
|
2021-09-27 23:48:06 -04:00
|
|
|
ClassicNote::ClassicNote(NoteInitializer &&init) :
|
2021-09-14 15:02:23 -04:00
|
|
|
Note(init.perfect_offset),
|
|
|
|
_evaluator(init.intervals, _perfect_offset),
|
2021-09-27 23:48:06 -04:00
|
|
|
_state(State::NONE),
|
|
|
|
_context(init.context)
|
|
|
|
{}
|
2021-09-14 15:02:23 -04:00
|
|
|
|
|
|
|
bool ClassicNote::isActive() const
|
|
|
|
{
|
|
|
|
return _state == State::ACTIVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ClassicNote::isInGame() const
|
|
|
|
{
|
|
|
|
return _state == State::FLYING
|
|
|
|
|| _state == State::ACTIVE
|
|
|
|
|| _state == State::DYING;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ClassicNote::shouldRemove() const
|
|
|
|
{
|
|
|
|
return _state == State::DEAD;
|
|
|
|
}
|