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());
        }
Esempio n. 2
0
 public ClockStateFluentInterface(ClockState state)
 {
     this.state = state;
 }
Esempio n. 3
0
 private Clock()
 {
     State = new ClockState();
 }