Changed visibility from package to interal

This commit is contained in:
cdricms
2024-06-26 22:46:58 +02:00
parent 78a4737015
commit bc145da022
12 changed files with 208 additions and 110 deletions

View File

@@ -1,7 +1,7 @@
public enum Kind: String, CaseIterable {
internal enum Kind: String, CaseIterable {
case Pawn, Knight, Bishop, Rook, Queen, King
public var value: Int8 {
internal var value: Int8 {
switch self {
case .Pawn: 1
case .Bishop: 3
@@ -12,7 +12,7 @@ public enum Kind: String, CaseIterable {
}
}
public static subscript(_ c: Character) -> (Self, Color)? {
internal static subscript(_ c: Character) -> (Self, Color)? {
let v = c.uppercased()
guard
@@ -39,7 +39,7 @@ public enum Kind: String, CaseIterable {
}
}
public protocol Piece {
internal protocol Piece {
var board: Board? { get }
var color: Color { get }
var unicodeRepresentation: String { get }
@@ -47,6 +47,6 @@ public protocol Piece {
var position: Square.Position { get }
var pseudoLegalPositions: [Square.Position] { get }
var legalPositions: [Square.Position] { get }
func move(dst: Square.Position) -> Bool
func isLegal(pos: Square.Position) -> Bool
func move(to dst: Square.Position) -> Bool
func isLegal(on pos: Square.Position) -> Bool
}