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
Raw Normal View History

2022-11-13 00:59:35 +00:00
module abstractfactory.chicagopizzaingredientfactory;
import abstractfactory.pizzaingredientfactory;
import abstractfactory.dough;
2022-11-13 21:45:45 +00:00
import abstractfactory.thickcrustdough;
2022-11-13 00:59:35 +00:00
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();
}
}