string GetRowWithLamps(int count, int totalLampsInRow, LampState lampOnState, IRowConverter rowConverter = null)
        {
            Debug.Assert(count <= totalLampsInRow);
            Debug.Assert(lampOnState != LampState.Off);

            var row = new string((char)lampOnState, count);

            if (rowConverter != null)
            {
                row = rowConverter.Convert(row);
            }

            row = row.PadRight(totalLampsInRow, (char)LampState.Off);
            return(row);
        }
Exemple #2
0
 public Lamp(Color color, LampState initialState = LampState.Off)
 {
     Color = color;
     State = initialState;
 }
Exemple #3
0
 internal void SwitchOff() => State = LampState.Off;
Exemple #4
0
 internal void SwitchOn() => State = LampState.On;