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/theaterlights.d

35 lines
530 B
D

module theaterlights;
import std.stdio : writeln;
import std.conv : to;
class TheaterLights
{
private string description;
this(string description)
{
this.description = description;
}
void on()
{
writeln(description ~ " on");
}
void off()
{
writeln(description ~ " off");
}
void dim(int level)
{
writeln(description ~ " dimming to " ~ level.to!string ~ "%");
}
override string toString() const
{
return description;
}
}