#pragma once #include #include "classicactions.h" #include "classicsprite.h" class ClassicSpriteFactory { public: inline std::shared_ptr create(Type type) { sf::RectangleShape sprite; sprite.setSize({20.f, 20.f}); switch (type) { case Type::UP: sprite.setFillColor(sf::Color(255, 0, 0)); break; case Type::DOWN: sprite.setFillColor(sf::Color(0, 255, 0)); break; case Type::LEFT: sprite.setFillColor(sf::Color(0, 0, 255)); break; case Type::RIGHT: sprite.setFillColor(sf::Color(255, 0, 255)); break; default: // yellow sprite.setFillColor(sf::Color(255, 239, 0)); } return std::make_shared(sprite); } };