コード例 #1
0
        public override void PopulateBoard()
        {
            currentRoyalPiece  = (King)AddPieceToBoard(new King(Team.WHITE, "e1"));
            opposingRoyalPiece = (King)AddPieceToBoard(new King(Team.BLACK, "e8"));

            aSideWhiteEmpress = (Empress)AddPieceToBoard(new Empress(Team.WHITE, "a1"));
            aSideBlackEmpress = (Empress)AddPieceToBoard(new Empress(Team.BLACK, "a8"));
            hSideWhiteRook    = (Rook)AddPieceToBoard(new Rook(Team.WHITE, "h1"));
            hSideBlackRook    = (Rook)AddPieceToBoard(new Rook(Team.BLACK, "h8"));

            AddPieceToBoard(new Princess(Team.WHITE, "b1"));
            AddPieceToBoard(new Princess(Team.BLACK, "b8"));

            AddPieceToBoard(new Queen(Team.WHITE, "c1"));
            AddPieceToBoard(new Queen(Team.BLACK, "c8"));

            AddPieceToBoard(new Amazon(Team.WHITE, "d1"));
            AddPieceToBoard(new Amazon(Team.BLACK, "d8"));

            AddPieceToBoard(new Bishop(Team.WHITE, "f1"));
            AddPieceToBoard(new Bishop(Team.BLACK, "f8"));

            AddPieceToBoard(new Knight(Team.WHITE, "g1"));
            AddPieceToBoard(new Knight(Team.BLACK, "g8"));

            for (int x = 0; x < BOARD_WIDTH; x++)
            {
                AddPieceToBoard(new Pawn(Team.WHITE, new BoardCoord(x, WHITE_PAWNROW)));
                AddPieceToBoard(new Pawn(Team.BLACK, new BoardCoord(x, BLACK_PAWNROW)));
            }
        }
コード例 #2
0
 protected override void TryPerformCastlingRookMoves(ChessPiece mover)
 {
     if (mover.GetBoardPosition().x == 2)
     {
         if (mover.GetTeam() == Team.WHITE)
         {
             aSideWhiteEmpress = (Empress)PerformCastle(aSideWhiteEmpress, new BoardCoord(3, mover.GetBoardPosition().y));
         }
         else
         {
             aSideBlackEmpress = (Empress)PerformCastle(aSideBlackEmpress, new BoardCoord(3, mover.GetBoardPosition().y));
         }
     }
     else if (mover.GetBoardPosition().x == 6)
     {
         if (mover.GetTeam() == Team.WHITE)
         {
             hSideWhiteRook = (Rook)PerformCastle(hSideWhiteRook, new BoardCoord(5, mover.GetBoardPosition().y));
         }
         else
         {
             hSideBlackRook = (Rook)PerformCastle(hSideBlackRook, new BoardCoord(5, mover.GetBoardPosition().y));
         }
     }
 }
コード例 #3
0
        public PerfectChess() : base()
        {
            aSideWhiteEmpress = aSideBlackEmpress = null;

            selectedPawnPromotion = Piece.Amazon;
            pawnPromotionOptions  = new Piece[7] {
                Piece.Amazon, Piece.Queen, Piece.Empress, Piece.Princess, Piece.Rook, Piece.Bishop, Piece.Knight
            };
        }