Esempio n. 1
0
        private bool RedoAStep()
        {
            if (StkRedoStep.Count <= 0)
            {
                return(false);
            }

            PlayInfo OldPos = StkRedoStep.Pop();

            StkUndoStep.Push(OldPos);

            Button btn = MatrixPositions[OldPos.Point.Y][OldPos.Point.X];

            btn.BackgroundImage = OldPos.Symbol;

            if (StkRedoStep.Count <= 0)
            {
                CurrentPlayer = OldPos.CurrentPlayer == 1 ? 0 : 1;
            }
            else
            {
                OldPos = StkRedoStep.Peek();
            }

            ChangePlayer();

            return(true);
        }
Esempio n. 2
0
        public bool Redo()
        {
            if (StkRedoStep.Count <= 0)
            {
                return(false);
            }

            PlayInfo OldPos = StkRedoStep.Peek();

            CurrentPlayer = OldPos.CurrentPlayer;

            bool IsRedo1 = RedoAStep();
            bool IsRedo2 = RedoAStep();

            return(IsRedo1 && IsRedo2);
        }