DesignPattern/03.AbstractFactory/2.Code/main.cpp

26 lines
430 B
C++
Raw Normal View History

2019-10-19 01:32:12 +00:00
#include <iostream>
#include "AbstractFactory.h"
int main()
{
AbstractFactory *fac = NULL;
AbstractBall *ball = NULL;
AbstractShirt *shirt = NULL;
fac = new BasketballFactory();
ball = fac->getBall();
shirt = fac->getShirt();
2020-11-29 07:28:46 +00:00
delete fac;
delete ball;
delete shirt;
2019-10-19 01:32:12 +00:00
fac = new FootballFactory();
ball = fac->getBall();
shirt = fac->getShirt();
2020-11-29 07:28:46 +00:00
delete fac;
delete ball;
delete shirt;
2019-10-19 01:32:12 +00:00
system("pause");
return 0;
}