25 lines
711 B
D
25 lines
711 B
D
module factorymethod.pizzasimple.app;
|
|
|
|
import factorymethod.pizzasimple.simplepizzafactory;
|
|
import factorymethod.pizzasimple.pizzastore;
|
|
import factorymethod.pizzasimple.pizza;
|
|
import std.stdio : writeln;
|
|
|
|
void main()
|
|
{
|
|
SimplePizzaFactory factory = new SimplePizzaFactory();
|
|
PizzaStore store = new PizzaStore(factory);
|
|
|
|
Pizza pizza = store.orderPizza("cheese");
|
|
writeln("Мы заказали ", pizza.getName());
|
|
writeln(pizza);
|
|
|
|
pizza = store.orderPizza("veggie");
|
|
writeln("Мы заказали ", pizza.getName());
|
|
writeln(pizza.toString());
|
|
|
|
pizza = store.orderPizza("pepperoni");
|
|
writeln("Мы заказали ", pizza.getName());
|
|
writeln(pizza.toString());
|
|
}
|