Linear + Diagonal moves

This commit is contained in:
cdricms
2024-06-27 18:09:01 +02:00
parent bc145da022
commit 8b5c2a592e
11 changed files with 179 additions and 108 deletions

View File

@@ -1,7 +1,7 @@
internal enum Kind: String, CaseIterable {
enum Kind: String, CaseIterable {
case Pawn, Knight, Bishop, Rook, Queen, King
internal var value: Int8 {
var value: Int8 {
switch self {
case .Pawn: 1
case .Bishop: 3
@@ -12,7 +12,7 @@ internal enum Kind: String, CaseIterable {
}
}
internal static subscript(_ c: Character) -> (Self, Color)? {
static subscript(_ c: Character) -> (Self, Color)? {
let v = c.uppercased()
guard
@@ -39,7 +39,7 @@ internal enum Kind: String, CaseIterable {
}
}
internal protocol Piece {
protocol Piece {
var board: Board? { get }
var color: Color { get }
var unicodeRepresentation: String { get }