Some refactor and tests
This commit is contained in:
@@ -10,7 +10,16 @@ final class King: Piece {
|
||||
var position: Square.Position
|
||||
|
||||
var pseudoLegalPositions: [Square.Position] {
|
||||
return []
|
||||
[
|
||||
position + (1, 0),
|
||||
position + (1, 1),
|
||||
position + (0, 1),
|
||||
position + (-1, 1),
|
||||
position + (-1, 0),
|
||||
position + (-1, -1),
|
||||
position + (0, -1),
|
||||
position + (1, -1)
|
||||
].filter {$0.index != nil}
|
||||
}
|
||||
|
||||
var legalPositions: [Square.Position] {
|
||||
|
||||
Reference in New Issue
Block a user