patterns/templatemethod/simplebarista/coffee.d

35 lines
513 B
D
Raw Normal View History

2022-12-05 07:38:19 +00:00
module coffee;
import std.stdio : writeln;
class Coffee
{
void prepareRecipe()
{
boilWater();
brewCoffeeGrinds();
pourInCup();
addSugarAndMilk();
}
void boilWater()
{
writeln("Boiling water");
}
void brewCoffeeGrinds()
{
writeln("Dripping Coffee through filter");
}
void pourInCup()
{
writeln("Pouring into cup");
}
void addSugarAndMilk()
{
writeln("Adding Sugar and Milk");
}
}