2021-06-16 13:11:00 -04:00
|
|
|
#include "classicgraphicsmanager.h"
|
|
|
|
#include "classicnote.h"
|
|
|
|
|
2021-06-23 15:18:33 -04:00
|
|
|
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)
|
|
|
|
{
|
2021-06-23 15:18:33 -04:00
|
|
|
note->setSprite(_sprite_container.getSprite(note->type()));
|
2021-06-16 13:11:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void ClassicGraphicsManager::resetSprite(ClassicNote* note)
|
|
|
|
{
|
2021-06-23 15:18:33 -04:00
|
|
|
_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
|
|
|
}
|