AIGameStrategist
class AIGameStrategist
An class that represents an agent in the game.
-
The internal game strategist that will be used to determine actions.
Declaration
Swift
var strategy: AIGameStrategy -
The state that the agent is assessing for best actions.
Declaration
Swift
var state: AIAbstractGameState { get set } -
A string that describes the strategist to a receiver.
Declaration
Swift
var description: String { get } -
A string that provides a simple description of the strategist to a receiver.
Declaration
Swift
var simpleDescription: String { get } -
Initialize a strategist.
Declaration
Swift
init(with initialState: AIAbstractGameState)Parameters
initialStateThe initial state of the game world.
-
Initialize a strategist.
Declaration
Swift
init(with initialState: AIAbstractGameState, budget: Int)Parameters
initialStateThe initial state of the game world.
budgetThe maximum number of times the strategist can look forward to.
-
Initialize a strategist.
Declaration
Swift
init(with strategy: AIGameStrategy, reading state: AIAbstractGameState)Parameters
strategyThe GKStrategist that will be used to determine best actions.
stateThe initial state of the game world.
-
Update the strategist’s state to a new state for analysis.
Declaration
Swift
func update(with state: AIAbstractGameState)Parameters
stateThe new state to update to.
-
Returns the nest best action for the player.
Declaration
Swift
func nextAction() -> AIGameDecision