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/facade/hometheater/popcornpopper.d

35 lines
481 B
D

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;
}
}