30 lines
561 B
C++
30 lines
561 B
C++
#pragma once
|
|
|
|
#include "math/vector.hpp"
|
|
|
|
class Renderer;
|
|
|
|
namespace shapes
|
|
{
|
|
|
|
/**
|
|
* @brief Shape interface
|
|
*
|
|
* Interface for 2d shapes that can be transformed and drawn using a Renderer.
|
|
*/
|
|
class Shape
|
|
{
|
|
public:
|
|
Shape() = default;
|
|
|
|
virtual void Translate(const math::Vector& offset) = 0;
|
|
virtual void Rotate(const math::Vector& center, float angle) = 0;
|
|
virtual void Scale(const math::Vector& center, float factor) = 0;
|
|
|
|
virtual void Draw(Renderer& renderer) const = 0;
|
|
|
|
virtual ~Shape() = default;
|
|
};
|
|
|
|
} // namespace shapes
|