Files
swift-chess/Sources/Engine/Pieces/Bishop.swift
2024-06-28 23:58:26 +02:00

20 lines
442 B
Swift

final class Bishop: Piece, DiagonalMoves {
override var unicodeRepresentation: String {
return color == .Black ? "" : ""
}
override var pseudoLegalPositions: [Square.Position] {
return getDiagonalMoves(from: position)
}
override func isLegal(on pos: Square.Position) -> Bool {
super.isLegal(on: pos)
}
init(with color: Color, on position: Square.Position) {
super.init(kind: .Bishop, on: position, with: color)
}
}