Пример #1
0
        public ITimeTableMachine MakeTimetable(ButtonPayload buttonPayload = null)
        {
            // TODO remake this
            ITimeTableMachine machine = new TimetableMachine(buttonPayload);

            return(machine);
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
 public void Action(ButtonPayload payload)
 {
     State.Action(payload);
 }
Пример #4
0
 public abstract void Action(ButtonPayload buttonPayload);