public ITimeTableMachine MakeTimetable(ButtonPayload buttonPayload = null) { // TODO remake this ITimeTableMachine machine = new TimetableMachine(buttonPayload); return(machine); }
public TimetableMachine(ButtonPayload buttonPayload) { if (buttonPayload != null) { switch (buttonPayload.Stage) { case TimetableWeekState.Name: State = new TimetableWeekState(this); break; case TimeTableDayState.Name: var even = bool.Parse(buttonPayload.Params); State = new TimeTableDayState(this, buttonPayload.Action, even); break; } } else { State = new TimetableWeekState(this); } }
public void Action(ButtonPayload payload) { State.Action(payload); }
public abstract void Action(ButtonPayload buttonPayload);