From 495fe9ae299e81c213161d992d05cc11a403a1d7 Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Wed, 20 May 2020 03:02:00 +0300 Subject: Add files via upload --- Polymorphism/Shape.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Polymorphism/Shape.h (limited to 'Polymorphism/Shape.h') diff --git a/Polymorphism/Shape.h b/Polymorphism/Shape.h new file mode 100644 index 0000000..fbce027 --- /dev/null +++ b/Polymorphism/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 -- cgit v1.3.1-23-gd82d