Пример #1
0
 public Tuple <FigureAbstract, int> Action(HistoryList.Actions Action)
 {
     if (Action == HistoryList.Actions.Undo)
     {
         return(Tuple.Create(_before, _figurePos));
     }
     else
     {
         return(Tuple.Create(_after, _figurePos));
     }
 }
Пример #2
0
        //Для создания или удаления
        public State(HistoryList.Actions state, FigureAbstract figureState, int pos)
        {
            _figurePos = pos;
            switch (state)
            {
            case HistoryList.Actions.Create:
                _before = null;
                _after  = figureState;
                break;

            case HistoryList.Actions.Delete:
                _before = figureState;
                _after  = null;
                break;
            }
        }