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

25 lines
442 B
D
Raw Normal View History

2022-11-13 00:59:35 +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;
}
}