38 lines
1006 B
D
38 lines
1006 B
D
|
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);
|
||
|
}
|