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/chicagopizzaingredientfacto...

52 lines
1.2 KiB
D

module abstractfactory.chicagopizzaingredientfactory;
import abstractfactory.pizzaingredientfactory;
import abstractfactory.dough;
import abstractfactory.thincrustdough;
import abstractfactory.sauce;
import abstractfactory.plumtomatosauce;
import abstractfactory.cheese;
import abstractfactory.mozzarellacheese;
import abstractfactory.veggies;
import abstractfactory.blackolives;
import abstractfactory.spinach;
import abstractfactory.eggplant;
import abstractfactory.pepperoni;
import abstractfactory.slicedpepperoni;
import abstractfactory.clams;
import abstractfactory.frozenclams;
class ChicagoPizzaIngredientFactory : PizzaIngredientFactory
{
override Dough createDough()
{
return new ThinCrustDough();
}
override Sauce createSauce()
{
return new PlumTomatoSauce();
}
override Cheese createCheese()
{
return new MozzarellaCheese();
}
override Veggies[] createVeggies()
{
Veggies[] veggies = cast(Veggies[])[ new BlackOlives(), new Spinach(), new Eggplant() ];
return veggies;
}
override Pepperoni createPepperoni()
{
return new SlicedPepperoni();
}
override Clams createClam()
{
return new FrozenClams();
}
}