just changed name of variable allowedState to wantedState for better understanding and correctness
This commit is contained in:
parent
f008ecafa7
commit
50fa1b6cc6
@ -15,7 +15,7 @@ class GameViewController: UIViewController {
|
|||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
StateManager.stateManager.allowedState = StateTypes.menuSt
|
StateManager.stateManager.wantedState = StateTypes.menuSt
|
||||||
StateManager.stateManager.createStates()
|
StateManager.stateManager.createStates()
|
||||||
StateManager.stateManager.enterState()
|
StateManager.stateManager.enterState()
|
||||||
|
|
||||||
|
@ -14,11 +14,11 @@ class StateManager{
|
|||||||
static let stateManager = StateManager()
|
static let stateManager = StateManager()
|
||||||
|
|
||||||
var stateMachine: GKStateMachine?
|
var stateMachine: GKStateMachine?
|
||||||
var allowedState: StateTypes?
|
var wantedState: StateTypes?
|
||||||
let LOG = OSLog.init(subsystem: "StateManager", category: "StateManager")
|
let LOG = OSLog.init(subsystem: "StateManager", category: "StateManager")
|
||||||
|
|
||||||
func enterState(){
|
func enterState(){
|
||||||
switch allowedState {
|
switch wantedState {
|
||||||
case .menuSt:
|
case .menuSt:
|
||||||
if stateMachine?.enter(MenuState.self) == false {
|
if stateMachine?.enter(MenuState.self) == false {
|
||||||
os_log("Failed entering Menu State", log: LOG, type: .info)
|
os_log("Failed entering Menu State", log: LOG, type: .info)
|
||||||
|
Loading…
Reference in New Issue
Block a user