This repository has been archived on 2022-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
patterns/factorymethod/pizzasimple/pizzastore.d

29 lines
452 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;
}
}