diff --git a/GoldWars/GoldWars.xcodeproj/project.pbxproj b/GoldWars/GoldWars.xcodeproj/project.pbxproj index 6aa558c..14649eb 100644 --- a/GoldWars/GoldWars.xcodeproj/project.pbxproj +++ b/GoldWars/GoldWars.xcodeproj/project.pbxproj @@ -51,6 +51,7 @@ AE6BB1C424807C490063ECAE /* MenuState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6BB1C324807C490063ECAE /* MenuState.swift */; }; AE6BB1C624807CDA0063ECAE /* SyncingState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6BB1C524807CDA0063ECAE /* SyncingState.swift */; }; AE6BB1C824807E6A0063ECAE /* GameState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6BB1C724807E6A0063ECAE /* GameState.swift */; }; + AE6BB1CA24807FDB0063ECAE /* EndGameState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6BB1C924807FDB0063ECAE /* EndGameState.swift */; }; C04783EE2468583F004961FB /* intro-music.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = C04783ED2468583F004961FB /* intro-music.mp3 */; }; C04783F024685995004961FB /* SettingsScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04783EF24685995004961FB /* SettingsScene.swift */; }; C05BB9C4247D890C00411249 /* SliderComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C05BB9C3247D890C00411249 /* SliderComponent.swift */; }; @@ -121,6 +122,7 @@ AE6BB1C324807C490063ECAE /* MenuState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuState.swift; sourceTree = ""; }; AE6BB1C524807CDA0063ECAE /* SyncingState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncingState.swift; sourceTree = ""; }; AE6BB1C724807E6A0063ECAE /* GameState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameState.swift; sourceTree = ""; }; + AE6BB1C924807FDB0063ECAE /* EndGameState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndGameState.swift; sourceTree = ""; }; C04783ED2468583F004961FB /* intro-music.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "intro-music.mp3"; sourceTree = ""; }; C04783EF24685995004961FB /* SettingsScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsScene.swift; sourceTree = ""; }; C05BB9C3247D890C00411249 /* SliderComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderComponent.swift; sourceTree = ""; }; @@ -197,6 +199,7 @@ AE6BB1C324807C490063ECAE /* MenuState.swift */, AE6BB1C524807CDA0063ECAE /* SyncingState.swift */, AE6BB1C724807E6A0063ECAE /* GameState.swift */, + AE6BB1C924807FDB0063ECAE /* EndGameState.swift */, ); path = GoldWars; sourceTree = ""; @@ -410,6 +413,8 @@ 3FE19DB5246C7A22004827AB /* RoundCalculatorService.swift in Sources */, 9EC239E1246878A900952F74 /* MultiplayerNetwork.swift in Sources */, 9EA3ABEB245C6DFA006BC61D /* BaseNode.swift in Sources */, + AE6BB1CA24807FDB0063ECAE /* EndGameState.swift in Sources */, + 9E04AFAF245E2B73002D5CFC /* AttackActionComponent.swift in Sources */, 3E6785422472CBEC007B9DE4 /* Way.swift in Sources */, 110360D9244B101A008610AF /* GameScene.swift in Sources */, C04783F024685995004961FB /* SettingsScene.swift in Sources */, diff --git a/GoldWars/GoldWars/EndGameState.swift b/GoldWars/GoldWars/EndGameState.swift new file mode 100644 index 0000000..da979c6 --- /dev/null +++ b/GoldWars/GoldWars/EndGameState.swift @@ -0,0 +1,29 @@ +// +// EndGameState.swift +// GoldWars +// +// Created by Chauntalle Schüle on 29.05.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import GameKit +import os + +class EndGameState: GKState { + + let LOG = OSLog.init(subsystem: "EndGameState", category: "EndGameState") + + override func isValidNextState(_ stateClass: AnyClass) -> Bool { + return stateClass is MenuState.Type + } + + override func update(deltaTime seconds: TimeInterval) { + } + + override func didEnter(from previousState: GKState?) { + os_log("Entered EndGame State", log: LOG, type: .info) + } + + override func willExit(to nextState: GKState) { + } +} diff --git a/GoldWars/GoldWars/StateTypes.swift b/GoldWars/GoldWars/StateTypes.swift index b75bfdc..9fb8886 100644 --- a/GoldWars/GoldWars/StateTypes.swift +++ b/GoldWars/GoldWars/StateTypes.swift @@ -6,31 +6,9 @@ // Copyright © 2020 SP2. All rights reserved. // -import GameKit -import os - enum StateTypes { case menuSt case syncingSt case gameSt case endGameSt } - -class EndGameState: GKState { - - let LOG = OSLog.init(subsystem: "EndGameState", category: "EndGameState") - - override func isValidNextState(_ stateClass: AnyClass) -> Bool { - return stateClass is MenuState.Type - } - - override func update(deltaTime seconds: TimeInterval) { - } - - override func didEnter(from previousState: GKState?) { - os_log("Entered EndGame State", log: LOG, type: .info) - } - - override func willExit(to nextState: GKState) { - } -}