patterns/facade/hometheater/popcornpopper.d

35 lines
481 B
D
Raw Permalink Normal View History

2022-12-05 07:38:19 +00:00
module popcornpopper;
import std.stdio : writeln;
class PopcornPopper
{
private string description;
this(string description)
{
this.description = description;
}
void on()
{
writeln(description ~ " on");
}
void off()
{
writeln(description ~ " off");
}
void pop()
{
writeln(description ~ " popping popcorn!");
}
override string toString() const
{
return description;
}
}