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
|
|
|
{}
|
|
|
|
|
2021-06-23 18:43:13 -04:00
|
|
|
void ClassicGraphicsManager::initGraphics(ClassicNote* note)
|
2021-06-16 13:11:00 -04:00
|
|
|
{
|
2021-06-23 15:18:33 -04:00
|
|
|
note->setSprite(_sprite_container.getSprite(note->type()));
|
2021-06-23 18:43:13 -04:00
|
|
|
note->sprite()->setCoordinates(note->getCoordinates().x, note->getCoordinates().y, 0, 0);
|
2021-06-16 13:11:00 -04:00
|
|
|
}
|
|
|
|
|
2021-06-23 18:43:13 -04:00
|
|
|
void ClassicGraphicsManager::resetGraphics(ClassicNote* note)
|
2021-06-16 13:11:00 -04:00
|
|
|
{
|
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
|
|
|
}
|