public King(Colour pieceColour, PositionOnBoard positionOnBoard, BoardAI boardAI) { color = pieceColour; position = positionOnBoard; pieceID = color == Colour.Black ? 1 : 2; LinktoBoard(boardAI); }
internal Pawn(Colour pieceColour, PositionOnBoard positionOnBoard, BoardAI boardAI) { color = pieceColour; position = positionOnBoard; pieceID = color == Colour.Black ? 13 : 14; LinktoBoard(boardAI); }
internal Cannon(Colour pieceColour, PositionOnBoard positionOnBoard, BoardAI boardAI) { color = pieceColour; position = positionOnBoard; pieceID = color == Colour.Black ? 11 : 12; LinktoBoard(boardAI); }
internal Bishop(Colour pieceColour, PositionOnBoard positionOnBoard, BoardAI boardAI) { color = pieceColour; position = positionOnBoard; pieceID = color == Colour.Black ? 5 : 6; LinktoBoard(boardAI); }
internal Rook(Colour pieceColour, PositionOnBoard positionOnBoard, BoardAI boardAI) { color = pieceColour; position = positionOnBoard; pieceID = color == Colour.Black ? 9 : 10; LinktoBoard(boardAI); }
internal Knight(Colour pieceColour, PositionOnBoard positionOnBoard, BoardAI boardAI) { color = pieceColour; position = positionOnBoard; pieceID = color == Colour.Black ? 7 : 8; LinktoBoard(boardAI); }
// Use this for initialization void Start() { board = gameObject.GetComponent <Board>(); board.CreateBoard(); boardAI = new BoardAI(9, 10); //List<PositionOnBoard> ans = boardAI.theboard[4, 8].LegalMoves(); }
internal void LinktoBoard(BoardAI boardAI) { theBoard = boardAI; }
public void PrepareForOffline(int boardAILevel) { currentBoardAI = prefabsBoardAIs[boardAILevel].GetComponent <BoardAI>(); }
internal PieceControl[,] boardFor(int[,] boardFromInts) { BoardAI newBoard = new BoardAI(numberofColumns, numberOfRows); PieceControl[,] placeHolder = new PieceControl[numberofColumns, numberOfRows]; for (int col = 0; col < numberofColumns; col++) { for (int row = 0; row < numberOfRows; row++) { switch (boardFromInts[col, row]) { case 0: placeHolder[col, row] = new BlankSpace(new PositionOnBoard(col, row)); break; case 1: placeHolder[col, row] = new King(PieceControl.Colour.Black, new PositionOnBoard(col, row), newBoard); break; case 2: placeHolder[col, row] = new King(PieceControl.Colour.Red, new PositionOnBoard(col, row), newBoard); break; case 3: placeHolder[col, row] = new Guard(PieceControl.Colour.Black, new PositionOnBoard(col, row), newBoard); break; case 4: placeHolder[col, row] = new Guard(PieceControl.Colour.Red, new PositionOnBoard(col, row), newBoard); break; case 5: placeHolder[col, row] = new Bishop(PieceControl.Colour.Black, new PositionOnBoard(col, row), newBoard); break; case 6: placeHolder[col, row] = new Bishop(PieceControl.Colour.Red, new PositionOnBoard(col, row), newBoard); break; case 7: placeHolder[col, row] = new Knight(PieceControl.Colour.Black, new PositionOnBoard(col, row), newBoard); break; case 8: placeHolder[col, row] = new Knight(PieceControl.Colour.Black, new PositionOnBoard(col, row), newBoard); break; case 9: placeHolder[col, row] = new Rook(PieceControl.Colour.Black, new PositionOnBoard(col, row), newBoard); break; case 10: placeHolder[col, row] = new Rook(PieceControl.Colour.Red, new PositionOnBoard(col, row), newBoard); break; case 11: placeHolder[col, row] = new Cannon(PieceControl.Colour.Black, new PositionOnBoard(col, row), newBoard); break; case 12: placeHolder[col, row] = new Cannon(PieceControl.Colour.Red, new PositionOnBoard(col, row), newBoard); break; case 13: placeHolder[col, row] = new Pawn(PieceControl.Colour.Black, new PositionOnBoard(col, row), newBoard); break; case 14: placeHolder[col, row] = new Pawn(PieceControl.Colour.Red, new PositionOnBoard(col, row), newBoard); break; } } } return(placeHolder); }