Esempio n. 1
0
        /**
         * Performs a move based on the origin and destination squares
         */
        public void MoveHandler(Square orig, Square dest)
        {
            PieceType promoteTo = ((dest.getSquareNumber() <= 7 | dest.getSquareNumber() > 55) & (orig.getPiece().Equals(PieceType.p) | orig.getPiece().Equals(PieceType.P))) ? getPromotion(orig.getPiece()) : PieceType.Empty;

            Move current = new Move(orig.getSquareNumber(), dest.getSquareNumber(), promoteTo);
            if (MoveCheck(current))
            {
                performMove(current);
            }
        }