<commit_before>//
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit

protocol GameTimerProtocol {
    func timeTicked(displayText: String, color: UIColor)
    func timeFinished()
}

class GameTimer: NSObject {
    static var timer = NSTimer()
    static var minutes = 0
    static var seconds = 0
    static var secondsLeft = 0
    
    static var presenter: GamePresenter!
    
    static func start() {
        secondsLeft = 120;
        timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: "updateCounter", userInfo: nil, repeats: true)
    }
    
    static func stop() {
        timer.invalidate()
    }
    
    static func updateCounter() {
        if GameTimer.secondsLeft > 0 {
            GameTimer.secondsLeft--
            GameTimer.minutes = (GameTimer.secondsLeft % 3600) / 60
            GameTimer.seconds = (GameTimer.secondsLeft % 3600) % 60
            let displayText = String(format: "%d", GameTimer.minutes) + ":" + String(format: "%02d", GameTimer.seconds)
            var color: UIColor = .darkGrayColor()
            if GameTimer.secondsLeft <= 10 {
                color = .redColor()
            }
            presenter.timeTicked(displayText, color: color)
        } else {<commit_msg>Fix swift warnings in GameTimer.swift<commit_after>//
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit

protocol GameTimerProtocol {
    func timeTicked(displayText: String, color: UIColor)
    func timeFinished()
}

class GameTimer: NSObject {
    static var timer = NSTimer()
    static var minutes = 0
    static var seconds = 0
    static var secondsLeft = 0
    
    static var presenter: GamePresenter!
    
    static func start() {
        secondsLeft = 120;
        timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: #selector(GameTimer.updateCounter), userInfo: nil, repeats: true)
    }
    
    static func stop() {
        timer.invalidate()
    }
    
    static func updateCounter() {
        if GameTimer.secondsLeft > 0 {
            GameTimer.secondsLeft -= 1
            GameTimer.minutes = (GameTimer.secondsLeft % 3600) / 60
            GameTimer.seconds = (GameTimer.secondsLeft % 3600) % 60
            let displayText = String(format: "%d", GameTimer.minutes) + ":" + String(format: "%02d", GameTimer.seconds)
            var color: UIColor = .darkGrayColor()
            if GameTimer.secondsLeft <= 10 {
                color = .redColor()
            }
            presenter.timeTicked(displayText, color: color)
        } else {
{'fraction_non_alphanumeric': 0.1007843137254902, 'fraction_numerical': 0.023137254901960783, 'mean_word_length': 2.312987012987013, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1072068', 'n_tokens_mistral': 774, 'n_tokens_neox': 717, 'n_words': 199}