parent
36284a0903
commit
0b27a3ff67
@ -0,0 +1,14 @@
|
||||
public struct Board {
|
||||
var grid: [[Piece?]]
|
||||
|
||||
public init(width: Int, height: Int) throws {
|
||||
// guard width > 0, height > 0 else {
|
||||
// // TODO: Swift std error?
|
||||
// }
|
||||
self.init(grid: Array(repeating: Array(repeating: nil, count: height), count: width))
|
||||
}
|
||||
|
||||
public init(grid: [[Piece?]]) {
|
||||
self.grid = grid
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
public struct Model {
|
||||
public private(set) var text = "Hello, World!"
|
||||
|
||||
public init() {
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
public enum Piece {
|
||||
case Player1, Player2
|
||||
}
|
Loading…
Reference in new issue