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

20 lines
346 B
C++

#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();
fac = new FootballFactory();
ball = fac->getBall();
shirt = fac->getShirt();
system("pause");
return 0;
}