#include "classicsprite.h"

ClassicSprite::ClassicSprite(ClassicSprite::Init&& init) :
    _reset_color(init.color),
    _shape(init.shape),
    _trail(init.trail)
{
    _shape->setColor(init.color);
    _trail->setColor(init.color);
}

void ClassicSprite::reset()
{
    _shape->setPosition(kku::Point{0, 0});
    _trail->setPosition(kku::Point{0, 0});

    _shape->setColor(_reset_color);
    _trail->setColor(_reset_color);
}

void ClassicSprite::setPosition(const kku::Point& position)
{
    _shape->setPosition(position);
}

void ClassicSprite::setTrailPosition(const kku::Point &position)
{
    _trail->setPosition(position);
}

kku::Point ClassicSprite::getPosition() const
{
    return _shape->getPosition();
}

kku::Point ClassicSprite::getTrailPosition() const
{
    return _trail->getPosition();
}

void ClassicSprite::setColor(const kku::Color& color)
{
    _shape->setColor(color);
}

void ClassicSprite::setTrailColor(const kku::Color& color)
{
    _trail->setColor(color);
}

kku::Color ClassicSprite::getColor() const
{
    return _shape->getColor();
}

kku::Color ClassicSprite::getTrailColor() const
{
    return _trail->getColor();
}

void ClassicSprite::display() const
{
    _shape->display();
    _trail->display();
}

std::shared_ptr<const kku::Rectangle> ClassicSprite::getRectangle() const
{
    return _shape;
}
