Sliding pieces moves are now illegal if after piece of same color

This commit is contained in:
cdricms
2024-06-30 21:06:03 +02:00
parent 02de114d74
commit d3503f1441
8 changed files with 225 additions and 54 deletions

View File

@@ -65,7 +65,7 @@ public class Piece: Hashable {
internal var pseudoLegalPositions: [Square.Position] {
return []
}
internal var legalPositions = [Square.Position]()
package internal(set) var legalPositions = [Square.Position]()
internal func getLegalPosition() {
legalPositions = pseudoLegalPositions.filter { isLegal(on: $0) }
}