patterns/abstractfactory/app.d

38 lines
1006 B
D
Raw Normal View History

2022-12-05 07:38:19 +00:00
module abstractfactory.app;
import abstractfactory.pizza;
import abstractfactory.pizzastore;
import abstractfactory.nypizzastore;
import abstractfactory.chicagopizzastore;
import std.stdio : writeln;
void main()
{
PizzaStore nyStore = new NYPizzaStore();
PizzaStore chicagoStore = new ChicagoPizzaStore();
Pizza pizza = nyStore.orderPizza("cheese");
writeln("Ethan ordered a ", pizza);
pizza = chicagoStore.orderPizza("cheese");
writeln("Joel ordered a ", pizza);
pizza = nyStore.orderPizza("clam");
writeln("Ethan ordered a ", pizza);
pizza = chicagoStore.orderPizza("clam");
writeln("Joel ordered a ", pizza);
pizza = nyStore.orderPizza("pepperoni");
writeln("Ethan ordered a ", pizza);
pizza = chicagoStore.orderPizza("pepperoni");
writeln("Joel ordered a ", pizza);
pizza = nyStore.orderPizza("veggie");
writeln("Ethan ordered a ", pizza);
pizza = chicagoStore.orderPizza("veggie");
writeln("Joel ordered a ", pizza);
}