added SyncingState

This commit is contained in:
Chauntalle Schüle 2020-05-29 01:15:06 +02:00
parent d7d17dba2b
commit f008ecafa7
4 changed files with 31 additions and 17 deletions

View File

@ -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 = "<group>"; };
AE6BB1C124807AC00063ECAE /* StateManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateManager.swift; sourceTree = "<group>"; };
AE6BB1C324807C490063ECAE /* MenuState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuState.swift; sourceTree = "<group>"; };
AE6BB1C524807CDA0063ECAE /* SyncingState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncingState.swift; sourceTree = "<group>"; };
C04783ED2468583F004961FB /* intro-music.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "intro-music.mp3"; sourceTree = "<group>"; };
C04783EF24685995004961FB /* SettingsScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsScene.swift; sourceTree = "<group>"; };
C05BB9C3247D890C00411249 /* SliderComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderComponent.swift; sourceTree = "<group>"; };
@ -191,6 +193,7 @@
AE6BB1BF248030720063ECAE /* StateTypes.swift */,
AE6BB1C124807AC00063ECAE /* StateManager.swift */,
AE6BB1C324807C490063ECAE /* MenuState.swift */,
AE6BB1C524807CDA0063ECAE /* SyncingState.swift */,
);
path = GoldWars;
sourceTree = "<group>";
@ -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 */,

View File

@ -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")

View File

@ -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) {
}
}