checkWinningState() public method

public checkWinningState ( ) : void
return void
Example #1
0
        // egy lépés szimulálása
        public override IState SimulateStep(IState current, AbstractStep step)
        {
            if (!(step is QuartoStep))
                throw new Exception("Not proper step type!");
            QuartoStep cStep = (QuartoStep)step;
            Board returnBoard = new Board((Board)current);

            if (returnBoard.SelectedPiece == null)
            {
                returnBoard.SelectedPiece= cStep.P;
                returnBoard.UpdateActivePieces(returnBoard.ActivePieces, returnBoard.SelectedPiece);

            }
            else
            {

                   returnBoard.insertPiece(cStep.X, cStep.Y, returnBoard.SelectedPiece);
                   returnBoard.SelectedPiece = null;
                   returnBoard.checkWinningState();

            }

            if (returnBoard == (Board)current)
            {
                return null;
            }
            return returnBoard;
        }