project-kyoku/modes/classicmode/game/classicnote.cpp

33 lines
715 B
C++
Raw Normal View History

#include "classicnote.h"
#include "classicsprite.h"
#include "classicgraphicsmanager.h"
// Replace with interface by dependency injection
#include "classicflyinganimationscenario.h"
#include "classicdyinganimationscenario.h"
//
2021-09-27 23:48:06 -04:00
ClassicNote::ClassicNote(NoteInitializer &&init) :
Note(init.perfect_offset),
_evaluator(init.intervals, _perfect_offset),
2021-09-27 23:48:06 -04:00
_state(State::NONE),
_context(init.context)
{}
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;
}