You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
962 B
C++

#pragma once
#include <memory>
#include "tools/mathutils.h"
#include "sprite.h"
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/RenderTarget.hpp>
class ClassicSprite : public Sprite
{
public:
explicit ClassicSprite(const std::shared_ptr<sf::RenderTarget>& render_target,
const sf::RectangleShape& shape);
virtual void reset() override;
virtual void display() const override;
void setCoordinates(const Coordinates &coordinates);
void setTrailCoordinates(const Coordinates &coordinates);
Coordinates coordinates() const;
Coordinates trailCoordinates() const;
void setColor(const sf::Color& color);
void setTrailColor(const sf::Color& color);
sf::Color color() const;
sf::Color trailColor() const;
private:
sf::RectangleShape _prototype;
sf::RectangleShape _shape;
sf::RectangleShape _trail;
const std::shared_ptr<sf::RenderTarget> _render_target;
};