Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Shapes / Shape.h
blob: f31e42e475d061aa46965cb06b5cc20e1bfb9b74 (plain) (blame)
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
#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;

};