-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cpp
32 lines (31 loc) · 874 Bytes
/
Main.cpp
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
#include "Container.h"
#include "Base.h"
#include "Shapes.h"
#include "ShapeFactory.h"
using namespace std;
int main()
{
Container<Shape> Figures;
for (int i = 0; i < 30; i++)
{
int ShapeType = rand() % 6 + 1;
switch (ShapeType)
{
case 1:Figures.AddLast(ShapeCreator::CreatePoint(true)); break;
case 2:Figures.AddLast(ShapeCreator::CreateCircle()); break;
case 3:Figures.AddLast(ShapeCreator::CreateRectangle()); break;
case 4:Figures.AddLast(ShapeCreator::CreateSquare()); break;
case 5:Figures.AddLast(ShapeCreator::CreateLine()); break;
case 6:Figures.AddLast(ShapeCreator::CreateNgon()); break;
default: break;
}
}
cout << "\n" << "Number of figures: " << Shape::GetCount()<<endl;
for (int i = 0; i < 30; i++)
{
Figures.DeleteFirst();
}
cout << "\n" << "Number of figures: " << Shape::GetCount()<<endl;
system("pause");
return 1;
}