patterns/abstractfactory/clampizza.d

25 lines
606 B
D
Raw Normal View History

2022-12-05 07:38:19 +00:00
module abstractfactory.clampizza;
import abstractfactory.pizza;
import abstractfactory.pizzaingredientfactory;
import std.stdio : writeln;
class ClamPizza : Pizza
{
PizzaIngredientFactory ingredientFactory;
this(PizzaIngredientFactory ingredientFactory)
{
this.ingredientFactory = ingredientFactory;
}
override void prepare()
{
writeln("Preparing ", name);
dough = ingredientFactory.createDough();
sauce = ingredientFactory.createSauce();
cheese = ingredientFactory.createCheese();
clams = ingredientFactory.createClam();
}
}