38 lines
716 B
Swift
38 lines
716 B
Swift
|
//
|
||
|
// TetrisViewController.swift
|
||
|
// Tetris Mac
|
||
|
//
|
||
|
// Created by Shadowfacts on 10/16/19.
|
||
|
// Copyright © 2019 Shadowfacts. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import Cocoa
|
||
|
import SwiftUI
|
||
|
import Carbon
|
||
|
import TetrisKit
|
||
|
|
||
|
class TetrisViewController: NSViewController {
|
||
|
|
||
|
let gameController = GameController()
|
||
|
|
||
|
init() {
|
||
|
super.init(nibName: nil, bundle: nil)
|
||
|
preferredContentSize = NSSize(width: 634, height: 804)
|
||
|
}
|
||
|
|
||
|
required init?(coder: NSCoder) {
|
||
|
fatalError()
|
||
|
}
|
||
|
|
||
|
override func loadView() {
|
||
|
self.view = TetrisHostingView(gameController)
|
||
|
}
|
||
|
|
||
|
override func viewDidAppear() {
|
||
|
super.viewDidAppear()
|
||
|
|
||
|
gameController.start()
|
||
|
}
|
||
|
|
||
|
}
|