19 lines
485 B
Swift
19 lines
485 B
Swift
final class Queen: Piece, LinearMoves, DiagonalMoves {
|
|
override var unicodeRepresentation: String {
|
|
return color == .Black ? "♛" : "♕"
|
|
}
|
|
|
|
override var pseudoLegalPositions: [Square.Position] {
|
|
return getDiagonalMoves(from: position) + getLinearMoves(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: .Queen, on: position, with: color)
|
|
}
|
|
|
|
}
|