private void SetNativeClock() { TopLamp = new LampTop(Seconds); FirstRow = new LampRow(4, Hours / 5, LampState.Red); SecondRow = new LampRow(4, Hours % 5, LampState.Red); ThirdRow = new QuarterlyLampRow(11, Minutes / 5, LampState.Yellow, LampState.Red); FourthRow = new LampRow(4, Minutes % 5, LampState.Yellow); }
public BerlinClock(ILampRowBuilder builder, TimeSpan time) { HourTopRow = builder.CreateHourRow(); HourBottomRow = builder.CreateHourRow(); MinutTopRow = builder.CreateTopMinuteRow(); MinutBottomRow = builder.CreateBottomMinuteRow(); SecondsRow = builder.CreateRowOfSecond(); InitClock(time); }
private string GetBottomRow(int minutes) { int numberBottomMinutesLamps = minutes % 5; return(LampRow.GetLampRow(TOTAL_LAMPS_OF_BOTTOM_ROW, numberBottomMinutesLamps, StatusLampEnum.YELLOW)); }
private string GetBottomRow(int hours) { int numberBottomHourLampsOn = hours % 5; // get the number of lamps on, on bottom row return(LampRow.GetLampRow(TOTAL_LAMPS_PER_LINE, numberBottomHourLampsOn, StatusLampEnum.RED)); }
private string GetTopRow(int hours) { int numberTopHourLampsOn = hours / 5; // get the number of lamps on, on top row return(LampRow.GetLampRow(TOTAL_LAMPS_PER_LINE, numberTopHourLampsOn, StatusLampEnum.RED)); }