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/app.d

38 lines
1006 B
D
Raw Normal View History

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