mirror of
https://github.com/lichess-org/dartchess.git
synced 2026-05-26 13:51:01 +00:00
Tweak
This commit is contained in:
+1
-1
@@ -81,7 +81,7 @@ extension type const File._(int value) implements int {
|
||||
/// Gets the chessboard [File] from a file index between 0 and 7.
|
||||
const File(this.value) : assert(value >= 0 && value < 8);
|
||||
|
||||
/// Gets a [File] its name in algebraic notation.
|
||||
/// Gets a [File] from its name in algebraic notation.
|
||||
///
|
||||
/// Throws a [FormatException] if the algebraic notation is invalid.
|
||||
factory File.fromName(String algebraic) {
|
||||
|
||||
@@ -2654,7 +2654,7 @@ SquareSet _pseudoLegalMoves(Position pos, Square square, _Context context) {
|
||||
}
|
||||
pseudo = pseudo & captureTargets;
|
||||
final delta = pos.turn == Side.white ? 8 : -8;
|
||||
final step = square.value + delta;
|
||||
final step = square + delta;
|
||||
if (0 <= step && step < 64 && !pos.board.occupied.has(Square(step))) {
|
||||
pseudo = pseudo.withSquare(Square(step));
|
||||
final canDoubleStep =
|
||||
|
||||
Reference in New Issue
Block a user