core/src/main/java/com/tomgibara/chess/Move.java
// this is because an attack by a king could be a false positive if the king is moving into check
this is because an attack by a king could be a false positive if the king is moving into check
this is because an attack by a king could be a false positive if the king is moving into check
private boolean attacks(SquareMap<Piece> pieces, Squares occupied, Square vacated, Squares occupiedByOpposingColour) {
			long bits = this.bits & occupiedByOpposingColour.mask();
			for (int offset = 0; offset < 64 && bits != 0L; offset++, bits >>>= 1) {
				if ((bits & 1L) == 0L) continue; 
				Move move = moves[ptr(offset)];
				if (!move.isPossible()) continue;
				Piece piece = pieces.get(move.from);
				if (!move.isPossibleFor(piece)) continue;
				switch (piece.type) {
				case PAWN:
					if (move.isPawnCapture()) return true;
					break;
				case KING:
					if (!move.isCastling()) return true;
					break;
				default:
					if (occupied.disjoint(move.intermediateSquares, vacated)) return true;
				}
			}
			return false;
		}
private boolean attacks ( SquareMap < Piece > pieces , Squares occupied , Square vacated , Squares occupiedByOpposingColour ) { long bits = this . bits & occupiedByOpposingColour . mask ( ) ; for ( int offset = 0 ; offset < 64 && bits != 0L ; offset ++ , bits >>>= 1 ) { if ( ( bits & 1L ) == 0L ) continue ; Move move = moves [ ptr ( offset ) ] ; if ( ! move . isPossible ( ) ) continue ; Piece piece = pieces . get ( move . from ) ; if ( ! move . isPossibleFor ( piece ) ) continue ; switch ( piece . type ) { case PAWN : if ( move . isPawnCapture ( ) ) return true ; break ; case KING : if ( ! move . isCastling ( ) ) return true ; break ; default : if ( occupied . disjoint ( move . intermediateSquares , vacated ) ) return true ; } } return false ; }
this is because an attack by a king could be a false positive if the king is moving into check
this is because an attack by a king could be a false positive if the king is moving into check
// invalid move