patterns/abstractfactory/pizzastore.d

25 lines
442 B
D
Raw Normal View History

2022-12-05 07:38:19 +00:00
module abstractfactory.pizzastore;
import abstractfactory.pizza;
import std.stdio : writeln;
abstract class PizzaStore
{
protected:
Pizza createPizza(string item);
public:
Pizza orderPizza(string type)
{
Pizza pizza = createPizza(type);
writeln("--- Making a " ~ pizza.getName() ~ " ---");
pizza.prepare();
pizza.bake();
pizza.cut();
pizza.box();
return pizza;
}
}