Can now initialize board with FEN
This commit is contained in:
33
Sources/Engine/Pieces/Rook.swift
Normal file
33
Sources/Engine/Pieces/Rook.swift
Normal file
@@ -0,0 +1,33 @@
|
||||
package class Rook: Piece {
|
||||
package weak var board: Board?
|
||||
package var kind: Kind = .Rook
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user