diff --git a/GoldWars/GoldWars.xcodeproj/project.pbxproj b/GoldWars/GoldWars.xcodeproj/project.pbxproj index 5d102f2..22e7c65 100644 --- a/GoldWars/GoldWars.xcodeproj/project.pbxproj +++ b/GoldWars/GoldWars.xcodeproj/project.pbxproj @@ -49,6 +49,7 @@ AE6BB1C0248030720063ECAE /* StateTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6BB1BF248030720063ECAE /* StateTypes.swift */; }; AE6BB1C224807AC00063ECAE /* StateManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6BB1C124807AC00063ECAE /* StateManager.swift */; }; AE6BB1C424807C490063ECAE /* MenuState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6BB1C324807C490063ECAE /* MenuState.swift */; }; + AE6BB1C624807CDA0063ECAE /* SyncingState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6BB1C524807CDA0063ECAE /* SyncingState.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 */; }; @@ -117,6 +118,7 @@ AE6BB1BF248030720063ECAE /* StateTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateTypes.swift; sourceTree = ""; }; AE6BB1C124807AC00063ECAE /* StateManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateManager.swift; sourceTree = ""; }; AE6BB1C324807C490063ECAE /* MenuState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuState.swift; sourceTree = ""; }; + AE6BB1C524807CDA0063ECAE /* SyncingState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncingState.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 = ""; }; @@ -191,6 +193,7 @@ AE6BB1BF248030720063ECAE /* StateTypes.swift */, AE6BB1C124807AC00063ECAE /* StateManager.swift */, AE6BB1C324807C490063ECAE /* MenuState.swift */, + AE6BB1C524807CDA0063ECAE /* SyncingState.swift */, ); path = GoldWars; sourceTree = ""; @@ -415,6 +418,7 @@ 9E78ACBA245CBDAF00526FF7 /* HUD.swift in Sources */, 9EC2FBA72476B1EC00ABF11F /* PlayerInfoComponent.swift in Sources */, AE6BB1C0248030720063ECAE /* StateTypes.swift in Sources */, + AE6BB1C624807CDA0063ECAE /* SyncingState.swift in Sources */, 9EEDE02D246FCD770096C735 /* SpinningLogoEntity.swift in Sources */, AE6BB1C224807AC00063ECAE /* StateManager.swift in Sources */, 9E174C86245DD91500209FF0 /* ButtonComponent.swift in Sources */, diff --git a/GoldWars/GoldWars/MenuState.swift b/GoldWars/GoldWars/MenuState.swift index a7d41fa..e8e1879 100644 --- a/GoldWars/GoldWars/MenuState.swift +++ b/GoldWars/GoldWars/MenuState.swift @@ -19,7 +19,7 @@ class MenuState: GKState { override func update(deltaTime seconds: TimeInterval) { } - + override func didEnter(from previousState: GKState?) { os_log("Entered Menu State", log: LOG, type: .info) } diff --git a/GoldWars/GoldWars/StateTypes.swift b/GoldWars/GoldWars/StateTypes.swift index b7bb86f..04d04db 100644 --- a/GoldWars/GoldWars/StateTypes.swift +++ b/GoldWars/GoldWars/StateTypes.swift @@ -16,22 +16,6 @@ enum StateTypes { case endGameSt } -class SyncingState: GKState { - let LOG = OSLog.init(subsystem: "SyncingState", category: "SyncingState") - - override func isValidNextState(_ stateClass: AnyClass) -> Bool { - return stateClass is GameState.Type || stateClass is EndGameState.Type - } - - override func didEnter(from previousState: GKState?) { - os_log("Entered Syncing State", log: LOG, type: .info) - } - override func update(deltaTime seconds: TimeInterval) { - } - override func willExit(to nextState: GKState) { - } -} - class GameState: GKState { let LOG = OSLog.init(subsystem: "GameState", category: "GameState") diff --git a/GoldWars/GoldWars/SyncingState.swift b/GoldWars/GoldWars/SyncingState.swift new file mode 100644 index 0000000..6713d0c --- /dev/null +++ b/GoldWars/GoldWars/SyncingState.swift @@ -0,0 +1,26 @@ +// +// SyncingState.swift +// GoldWars +// +// Created by Chauntalle Schüle on 29.05.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import GameKit +import os + +class SyncingState: GKState { + let LOG = OSLog.init(subsystem: "SyncingState", category: "SyncingState") + + override func isValidNextState(_ stateClass: AnyClass) -> Bool { + return stateClass is GameState.Type || stateClass is EndGameState.Type + } + + override func didEnter(from previousState: GKState?) { + os_log("Entered Syncing State", log: LOG, type: .info) + } + override func update(deltaTime seconds: TimeInterval) { + } + override func willExit(to nextState: GKState) { + } +}