35 lines
481 B
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;
|
||
|
}
|
||
|
}
|