project-kyoku/src/classicgame/classicgraphicsmanager.cpp

20 lines
623 B
C++
Raw Normal View History

2021-06-16 13:11:00 -04:00
#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());
}