static void Main(string[] args) { ClockSetup clockSetup = new ClockSetup(); // Setup starts in 'year' state clockSetup.RotateKnobRight(); clockSetup.PushKnob(); // year should be 1 on from current // Setup should now be in 'month' state clockSetup.RotateKnobRight(); clockSetup.RotateKnobRight(); clockSetup.PushKnob(); // month should be 2 on from current // Setup should now be in 'day' state clockSetup.RotateKnobRight(); clockSetup.RotateKnobRight(); clockSetup.RotateKnobRight(); clockSetup.PushKnob(); // day should be 3 on from current // Setup should now be in 'hour' state clockSetup.RotateKnobLeft(); clockSetup.RotateKnobLeft(); clockSetup.PushKnob(); // hour should be 2 less than current // Setup should now be in 'minute' state clockSetup.RotateKnobRight(); clockSetup.PushKnob(); // minute should be 1 on than current // Setup should now be in 'finished' state clockSetup.PushKnob(); // to display selected date Console.Read(); }
public MinuteSetupState(ClockSetup clockSetup) { this.clockSetup = clockSetup; minute = DateTime.Now.Minute; }
public HourSetupState(ClockSetup clockSetup) { this.clockSetup = clockSetup; hour = DateTime.Now.Hour; }
public DaySetupState(ClockSetup clockSetup) { this.clockSetup = clockSetup; day = DateTime.Now.Day; }
public MonthSetupState(ClockSetup clockSetup) { this.clockSetup = clockSetup; month = DateTime.Now.Month; }
public YearSetupState(ClockSetup clockSetup) { this.clockSetup = clockSetup; year = DateTime.Now.Year; }
public FinishedSetupState(ClockSetup clockSetup) { this.clockSetup = clockSetup; }