public string Serialize(ClockState state)
        {
            var stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(state.TopLight == LightState.On ? TopLightColor : TurnedOffLightSymbol);
            stringBuilder.AppendLine(PrintLine(state.Line1, Line1Colors));
            stringBuilder.AppendLine(PrintLine(state.Line2, Line2Colors));
            stringBuilder.AppendLine(PrintLine(state.Line3, Line3Colors));
            stringBuilder.Append(PrintLine(state.Line4, Line4Colors));
            return(stringBuilder.ToString());
        }
示例#2
0
 public ClockStateFluentInterface(ClockState state)
 {
     this.state = state;
 }
示例#3
0
 private Clock()
 {
     State = new ClockState();
 }