Started to work on king threats

This commit is contained in:
cdricms
2024-06-28 23:58:26 +02:00
parent 4f5b51f4ae
commit 0a220f14f5
13 changed files with 78 additions and 46 deletions

View File

@@ -64,8 +64,9 @@ public struct Fen: CustomStringConvertible {
}
internal mutating func set(
from board: Board.Grid, castling ca: CastlingAvailibility,
enPassant: String
from board: Board.Grid, activeColor: Color,
castling ca: CastlingAvailibility,
enPassant: String, halfMoveClock hmc: UInt8, fullMoveClock fmc: UInt8
) {
#warning(
"Determine active color, halfMoveClock, fullMoveClock based on history SAN later passed in arguments"
@@ -95,7 +96,8 @@ public struct Fen: CustomStringConvertible {
rankNr += 1
}
value = placement + " w " + ca.rawValue + " " + enPassant + " 0 " + "1"
value =
"\(placement) \(activeColor) \(ca.rawValue) \(enPassant) \(halfMoveClock) \(fullMoveClock)"
}
public enum FenError: Error {