project-kyoku/src/classicgame/classicgraphicsmanager.cpp

25 lines
703 B
C++
Raw Normal View History

2021-06-16 13:11:00 -04:00
#include "classicgraphicsmanager.h"
#include "classicnote.h"
ClassicGraphicsManager::ClassicGraphicsManager(sf::RenderTarget& target) :
_sprite_container({Type::UP, Type::DOWN,
Type::LEFT, Type::RIGHT},
std::make_unique<ClassicSpriteFactory>("VeraMono.ttf")),
_render_target(target)
2021-06-16 13:11:00 -04:00
{}
void ClassicGraphicsManager::initSprite(ClassicNote* note)
{
note->setSprite(_sprite_container.getSprite(note->type()));
2021-06-16 13:11:00 -04:00
}
void ClassicGraphicsManager::resetSprite(ClassicNote* note)
{
_sprite_container.resetSprite(note->sprite(), note->type());
}
void ClassicGraphicsManager::draw(const ClassicNote *note)
{
_render_target.draw(*note->sprite());
2021-06-16 13:11:00 -04:00
}