just changed name of variable allowedState to wantedState for better understanding and correctness

This commit is contained in:
Chauntalle Schüle 2020-05-29 01:18:31 +02:00
parent f008ecafa7
commit 50fa1b6cc6
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ class GameViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
StateManager.stateManager.allowedState = StateTypes.menuSt
StateManager.stateManager.wantedState = StateTypes.menuSt
StateManager.stateManager.createStates()
StateManager.stateManager.enterState()

View File

@ -14,11 +14,11 @@ class StateManager{
static let stateManager = StateManager()
var stateMachine: GKStateMachine?
var allowedState: StateTypes?
var wantedState: StateTypes?
let LOG = OSLog.init(subsystem: "StateManager", category: "StateManager")
func enterState(){
switch allowedState {
switch wantedState {
case .menuSt:
if stateMachine?.enter(MenuState.self) == false {
os_log("Failed entering Menu State", log: LOG, type: .info)