Dispenser/States/PartiallyFullState.swift
/* |
Copyright (C) 2016 Apple Inc. All Rights Reserved. |
See LICENSE.txt for this sample’s licensing information |
Abstract: |
A state for use in a dispenser's state machine. This state represents when the dispenser is partially full. |
*/ |
import SpriteKit |
import GameplayKit |
class PartiallyFullState: DispenserState { |
// MARK: Initialization |
required init(game: GameScene) { |
super.init(game: game, associatedNodeName: "PartiallyFullState") |
} |
// MARK: GKState overrides |
override func isValidNextState(_ stateClass: AnyClass) -> Bool { |
// This state can only transition to the serve and refilling states. |
switch stateClass { |
case is ServeState.Type, is RefillingState.Type: |
return true |
default: |
return false |
} |
} |
} |
Copyright © 2016 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2016-09-13