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/pizzafactorymethod/pizzastore.d

24 lines
458 B
D
Raw Normal View History

2022-11-12 19:47:14 +00:00
module factorymethod.pizzafactorymethod.pizzastore;
import factorymethod.pizzafactorymethod.pizza;
import std.stdio : writeln;
class PizzaStore
{
abstract Pizza createPizza(string type);
Pizza orderPizza(string type)
{
Pizza pizza = createPizza(type);
writeln("--- Making a " ~ pizza.getName() ~ " ---");
pizza.prepare();
pizza.bake();
pizza.cut();
pizza.box();
return pizza;
}
}