AIRecordableGameScene

class AIRecordableGameScene : GameScene

A subclass of a challenge game scene that allows users to record states.

  • The state recording machine.

    Declaration

    Swift

    var journal: StateRecorderViewModel?
  • The strategy to use for state recording.

    Declaration

    Swift

    var strategy: AITreeStrategy?
  • The game’s current abstract state.

    Declaration

    Swift

    var state: AIAbstractGameState?
  • The recording window.

    Declaration

    Swift

    var recorder: NSWindowController?
  • Set up the scene, journal, and strategy to begin recording.

    Declaration

    Swift

    override func sceneDidLoad()
  • Declaration

    Swift

    override func willMove(from view: SKView)
  • Make the state recorder window and display it.

    Declaration

    Swift

    func makeRecorder()
  • Prevent the player from doing anything that could influence state updates.

    Declaration

    Swift

    func blockInput()
  • Prevent keyboard input.

    Declaration

    Swift

    override func keyDown(with event: NSEvent)
  • Run the AI’s version of didFinishUpdate.

    Declaration

    Swift

    override func didFinishUpdate()
  • Run any post-update logic and check input states.

    Declaration

    Swift

    func aiFinish()
  • Capture the current scene as a game state.

    Declaration

    Swift

    func getState() -> AIAbstractGameState?

    Return Value

    An abstract version of the world as a game state that the agent can use.

  • Re-evaluate the state and update the assessments.

    Declaration

    Swift

    func reevaluate()
  • Apply a game state update to the scene.

    Declaration

    Swift

    func apply(_ action: AIGameDecision)

    Parameters

    action

    The action that will be performed to change the state.