diff options
1 files changed, 27 insertions, 0 deletions
| -rw-r--r-- | Polymorphism/Shapes/Shape.h | 27 |
diff --git a/Polymorphism/Shapes/Shape.h b/Polymorphism/Shapes/Shape.h new file mode 100644 index 0000000..f31e42e --- /dev/null +++ b/Polymorphism/Shapes/Shape.h @@ -0,0 +1,27 @@ +#pragma once + +#include "Point.h" + +class Shape +{ + Point* points; + int pointsCount; + + void CopyFrom(const Shape& other); + void Free(); + +public: + Shape(int pointsCount); + Shape(const Shape& other); + Shape& operator=(const Shape& other); + virtual ~Shape(); + + void setPoint(int x, int y, int ind); + const Point& getPoint(int ind); + + virtual double getPer() =0; + virtual double getArea() = 0; + + virtual Shape* clone() = 0; + +};
\ No newline at end of file |
