private ChessBoardSim SimulateBoard(ChessPiece piece, int[] newPositionCoords) { ChessBoardSim simBoard = new ChessBoardSim(ChessPieces.GetBoardLayout(), turnNumber); simBoard.MovePiece(piece, newPositionCoords[0], newPositionCoords[1], true); return(simBoard); }
private bool ValidateKingIsSafeOnSquare(int[] square) { bool isSafe; ChessBoardSim simBoard = SimulateBoard(GetAlliedKing(), square); isSafe = simBoard.checkIfKingIsChecked(); return(isSafe); }
private ChessBoardSim SimulateBoard(ChessPiece piece, int[] newPositionCoords) { ChessBoardSim simBoard = new ChessBoardSim((ChessPiece[, ])boardLayout.Clone(), turnNumber); simBoard.MovePiece(piece, newPositionCoords[0], newPositionCoords[1], true); Debug.Log(whitePiecesRemaining.Count + " " + blackPiecesRemaining.Count); Debug.Log(simBoard.whitePiecesRemaining.Count + " " + simBoard.blackPiecesRemaining.Count); return(simBoard); }
private void Start() { chessBoard = this.gameObject; ChessPieces = new ChessBoardSim(new ChessPiece[8, 8], turnNumber); MovementOptions = new bool[8, 8]; DrawChessBoard(); PopulateBoard(); InstantiateSelectionBox(); CreateAudioSource(); //SetUpUI(); StartTurn(); }