// // GameBoard.swift // TetrisKit // // Created by Shadowfacts on 10/13/19. // Copyright © 2019 Shadowfacts. All rights reserved. // import Foundation public struct GameBoard { public let width: Int public let height: Int public internal(set) var tiles: [[Bool]] public init(width: Int, height: Int) { self.width = width self.height = height tiles = (1...height).map { _ in Array(repeating: false, count: width) } } public subscript(x: Int, y: Int) -> Bool { return self.tiles[y][x] } mutating func set(piece: GamePiece) { let (left, top) = piece.topLeft for y in 0..