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); }
public Lamp(Color color, LampState initialState = LampState.Off) { Color = color; State = initialState; }
internal void SwitchOff() => State = LampState.Off;
internal void SwitchOn() => State = LampState.On;