Can now move pieces
This commit is contained in:
@@ -11,23 +11,8 @@ final class Queen: Piece, LinearMoves, DiagonalMoves {
|
||||
return pseudoLegalPositions.filter { isLegal(on: $0) }
|
||||
}
|
||||
|
||||
override func move(to dst: Square.Position) {
|
||||
|
||||
}
|
||||
|
||||
override func isLegal(on pos: Square.Position) -> Bool {
|
||||
if let board = board, let s = board[pos] {
|
||||
if let p = s.piece {
|
||||
if p.color == color { return false }
|
||||
if p.kind == .King {
|
||||
// TODO: Notify board of check
|
||||
delegate?.notify(.kingInCheck(self))
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true
|
||||
super.isLegal(on: pos)
|
||||
}
|
||||
|
||||
init(with color: Color, on position: Square.Position) {
|
||||
|
||||
Reference in New Issue
Block a user