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

22 lines
489 B
D
Raw Permalink Normal View History

2022-11-16 23:25:52 +00:00
import std.stdio : writeln;
import coffee, tea, coffeewithhook, teawithhook;
void main()
{
auto tea = new Tea();
auto coffee = new Coffee();
writeln("\nMaking tea...");
tea.prepareRecipe();
writeln("\nMaking coffee...");
coffee.prepareRecipe();
auto teaHook = new TeaWithHook();
auto coffeeHook = new CoffeeWithHook();
writeln("\nMaking tea...");
teaHook.prepareRecipe();
writeln("\nMaking coffee...");
coffeeHook.prepareRecipe();
}