Can now initialize board with FEN

This commit is contained in:
cdricms
2024-06-26 00:18:22 +02:00
parent c36319d4d7
commit 0ea0ec1bc6
8 changed files with 221 additions and 36 deletions

View File

@@ -0,0 +1,33 @@
package class King: Piece {
package weak var board: Board?
package var kind: Kind = .King
package var unicodeRepresentation: String {
return color == .Black ? "" : ""
}
package var color: Color
package var position: Square.Position
package var pseudoLegalPositions: [Square.Position] {
return []
}
package var legalPositions: [Square.Position] {
return pseudoLegalPositions.filter { isLegal(pos: $0) }
}
package func move(dst: Square.Position) -> Bool {
return false
}
package func isLegal(pos: Square.Position) -> Bool {
return false
}
package init(color: Color, on position: Square.Position) {
self.color = color
self.position = position
}
}