<commit_before>//
//  LevelModeGameScene.swift
//  SOPA
//
//  Created by <NAME> on 23.04.18.
//  Copyright © 2018 <NAME>. All rights reserved.
//

import Foundation
import SpriteKit
class LevelModeGameScene: GameScene {
    let levelCopy: Level
    override init(size: CGSize, level: Level) {
        levelCopy = Level(level: level)
        super.init(size: size, level: level)
    }
    
    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func addButtons() {
        let restartButton = SpriteButton(imageNamed: "restart", onClick: restartLevel)
        restartButton.size.height = BUTTON_SIZE * size.width
        restartButton.size.width = BUTTON_SIZE *  size.width
        restartButton.position.y = BUTTON_SIZE *  size.width / 2
        restartButton.position.x = size.width - BUTTON_SIZE *  size.width / 2
        addChild(restartButton)
    }
    func restartLevel() {
        level = Level(level: levelCopy)
        levelSolved = false
        gameFieldNode?.update()
        currentMoves = 0
    }
}<commit_msg>Reset current moves on level restart<commit_after>//
//  LevelModeGameScene.swift
//  SOPA
//
//  Created by <NAME> on 23.04.18.
//  Copyright © 2018 <NAME>. All rights reserved.
//

import Foundation
import SpriteKit
class LevelModeGameScene: GameScene {
    let levelCopy: Level
    override init(size: CGSize, level: Level) {
        levelCopy = Level(level: level)
        super.init(size: size, level: level)
    }
    
    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func addButtons() {
        let restartButton = SpriteButton(imageNamed: "restart", onClick: restartLevel)
        restartButton.size.height = BUTTON_SIZE * size.width
        restartButton.size.width = BUTTON_SIZE *  size.width
        restartButton.position.y = BUTTON_SIZE *  size.width / 2
        restartButton.position.x = size.width - BUTTON_SIZE *  size.width / 2
        addChild(restartButton)
    }
    func restartLevel() {
        level = Level(level: levelCopy)
        levelSolved = false
        gameFieldNode?.update()
        currentMoves = 0
        currentMovesNode.text = String(currentMoves)
    }
}
{'fraction_non_alphanumeric': 0.10159010600706714, 'fraction_numerical': 0.011484098939929329, 'mean_word_length': 2.6298076923076925, 'pattern_counts': {'":': 0, '<': 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': '7371274', 'n_tokens_mistral': 701, 'n_tokens_neox': 681, 'n_words': 169}