From 729ee968b3844692cdfd26ce9fbcd4d18e627222 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Mon, 1 Jun 2020 19:22:13 +0200 Subject: [PATCH] Delete TimerComponent file --- .../GoldWars/Components/TimerComponent.swift | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 GoldWars/GoldWars/Components/TimerComponent.swift diff --git a/GoldWars/GoldWars/Components/TimerComponent.swift b/GoldWars/GoldWars/Components/TimerComponent.swift deleted file mode 100644 index c55b1b9..0000000 --- a/GoldWars/GoldWars/Components/TimerComponent.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// TimerComponent.swift -// GoldWars -// -// Created by Daniel Steckert on 05.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import GameplayKit - -class TimerComponent: GKComponent { - - let labelNode :SKLabelNode - let roundTimer: RoundTimer - init(anchorPoint: CGPoint) { - self.labelNode = SKLabelNode(text: "") - self.labelNode.fontColor = UIColor.black - self.labelNode.fontSize = CGFloat(45) - self.labelNode.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y - 15) - self.roundTimer = RoundTimer() - super.init() - startWithDuration() - } - - func startWithDuration(){ - print("startWithDuration") - roundTimer.startTimer() - RoundCalculatorService.sharedInstance.isCalculating = false - } - - func timeLeft() -> Int { - self.roundTimer.timeLeft - } - - func update() { - self.labelNode.text = String(timeLeft()) - - if(isFinished()){ - self.labelNode.text = "Synching" - RoundCalculatorService.sharedInstance.resetNumberOfAttacksAndFormats() - if !MultiplayerNetwork.sharedInstance.isSending { - MultiplayerNetwork.sharedInstance.sendPlayerMoves(localRoundData: DataService.sharedInstance.localRoundData) - } - if !RoundCalculatorService.sharedInstance.isCalculating - && DataService.sharedInstance.didReceiveAllData() - && GameCenterManager.sharedInstance.isServer { - RoundCalculatorService.sharedInstance.calculateRound() - } - } - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - -}