29 lines
503 B
D
29 lines
503 B
D
module factorymethod.pizzasimple.pizzastore;
|
|
|
|
import factorymethod.pizzasimple.simplepizzafactory;
|
|
import factorymethod.pizzasimple.pizza;
|
|
|
|
class PizzaStore
|
|
{
|
|
SimplePizzaFactory factory;
|
|
|
|
this(SimplePizzaFactory factory)
|
|
{
|
|
this.factory = factory;
|
|
}
|
|
|
|
Pizza orderPizza(string type)
|
|
{
|
|
Pizza pizza;
|
|
|
|
pizza = factory.createPizza(type);
|
|
|
|
pizza.prepare();
|
|
pizza.bake();
|
|
pizza.cut();
|
|
pizza.box();
|
|
|
|
return pizza;
|
|
}
|
|
}
|