20 lines
623 B
C++
20 lines
623 B
C++
|
#include "classicgraphicsmanager.h"
|
||
|
#include "classicnote.h"
|
||
|
|
||
|
ClassicGraphicsManager::ClassicGraphicsManager() :
|
||
|
_sprite_container({Action::PRESS_UP, Action::PRESS_DOWN,
|
||
|
Action::PRESS_LEFT, Action::PRESS_RIGHT},
|
||
|
std::make_unique<ClassicSpriteFactory>("VeraMono.ttf"))
|
||
|
{}
|
||
|
|
||
|
void ClassicGraphicsManager::initSprite(ClassicNote* note)
|
||
|
{
|
||
|
const auto action_type = note->action();
|
||
|
note->setSprite(_sprite_container.getSprite(action_type));
|
||
|
}
|
||
|
|
||
|
void ClassicGraphicsManager::resetSprite(ClassicNote* note)
|
||
|
{
|
||
|
_sprite_container.resetSprite(note->sprite(), note->action());
|
||
|
}
|