private static BitBoard makeWithoutFileH() { BitBoard result = new BitBoard(); for (BoardSquare s : BoardSquare.values()) { if (s.file() != 'h') { result.set(s); } } return result; }
public static BitBoard makeKnightMoves(BoardSquare kn) { BitBoard result = new BitBoard(); for (BoardSquare bs : BoardSquare.values()) { if (kn.hasKnightMoveTo(bs)) { result.set(bs); } } return result; }
private static BitBoard makeInteriorSquares() { BitBoard result = new BitBoard(); for (BoardSquare bs : BoardSquare.values()) { if (!bs.onEdge()) { result.set(bs); } } return result; }
public static BitBoard makeBishopMoves(BoardSquare bish) { BitBoard result = new BitBoard(); for (BoardSquare bs : BoardSquare.values()) { if (bish.hasBishopMoveTo(bs)) { result.set(bs); } } return result; }
public BitBoard pawnCaptureWest(PieceColor mover) { BitBoard result = new BitBoard(this); if (mover.equals(PieceColor.WHITE)) { result.bits >>>= 9; } else { result.bits <<= 7; } return result.intersection(NO_FILE_H); }
public static BitBoard makeRookMoves(BoardSquare rook) { BitBoard result = new BitBoard(); for (BoardSquare bs : BoardSquare.values()) { if (rook.hasRookMoveTo(bs)) { result.set(bs); } } return result; }
public BitBoard pawnAdvance(PieceColor mover) { BitBoard result = new BitBoard(this); if (mover.equals(PieceColor.WHITE)) { result.bits >>>= 8; } else { result.bits <<= 8; } return result; }
public static BitBoard makeQueenMoves(BoardSquare queen) { BitBoard result = makeRookMoves(queen); return result.union(makeBishopMoves(queen)); }
public BitBoard negation() { BitBoard result = new BitBoard(); result.bits = ~this.bits; return result; }
public BitBoard symmetricDifference(BitBoard that) { BitBoard result = new BitBoard(this); result.removeIntersection(that); return result; }
public BitBoard union(BitBoard that) { BitBoard result = new BitBoard(this); result.addAll(that); return result; }
public BitBoard intersection(BitBoard that) { BitBoard result = new BitBoard(this); result.retainAll(that); return result; }