diff --git a/CustomTypes/Package.swift b/CustomTypes/Package.swift index 3f2a492..ff70ef8 100644 --- a/CustomTypes/Package.swift +++ b/CustomTypes/Package.swift @@ -11,11 +11,15 @@ let package = Package( name: "CustomTypes", targets: ["CustomTypes"]), ], + dependencies: [ + .package(path: "../Model") + ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( - name: "CustomTypes"), + name: "CustomTypes", + dependencies: [ .product(name: "Model", package: "Model") ]), .testTarget( name: "CustomTypesTests", dependencies: ["CustomTypes"]), diff --git a/CustomTypes/Sources/CustomTypes/CustomTypes.swift b/CustomTypes/Sources/CustomTypes/CustomTypes.swift deleted file mode 100644 index 08b22b8..0000000 --- a/CustomTypes/Sources/CustomTypes/CustomTypes.swift +++ /dev/null @@ -1,2 +0,0 @@ -// The Swift Programming Language -// https://docs.swift.org/swift-book diff --git a/CustomTypes/Sources/CustomTypes/Display.swift b/CustomTypes/Sources/CustomTypes/Display.swift new file mode 100644 index 0000000..fdb9966 --- /dev/null +++ b/CustomTypes/Sources/CustomTypes/Display.swift @@ -0,0 +1,35 @@ +import Model + +extension Piece: CustomStringConvertible { + public var description: String { + switch self { + case .PlayerA: + "🔴" + case .PlayerB: + "🟡" + } + } +} + +extension Board: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { + var str = String() + + for row in 0..