-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShape.hpp
More file actions
34 lines (26 loc) · 968 Bytes
/
Copy pathShape.hpp
File metadata and controls
34 lines (26 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include "Window.hpp"
#include "Color.hpp"
#include "Point2D.hpp"
namespace CGF
{
class Shape
{
public:
virtual ~Shape() = default;
virtual Point2D GetPosition() const { return mPosition; }
virtual Color GetColor() const { return mPosition.GetColor(); }
virtual void SetPosition(const Point2D& position) { mPosition = position; }
virtual void SetPosition(float x, float y) { mPosition.SetX(x); mPosition.SetY(y); }
virtual void SetColor(const Color& color) { mPosition.SetColor(color); }
virtual void Draw(const Window& window) const = 0; // Pure virtual function to draw the shape
virtual void Update(){}; // Virtual function to update the shape
protected:
Shape() = default;
Shape(const Shape&) = default;
Shape& operator=(const Shape&) = default;
Shape(Shape&&) = default;
Shape& operator=(Shape&&) = default;
Point2D mPosition; // Position and color of the shape
};
} // namespace CGF