Protocol

GKGameModelPlayer

Implement this protocol to describe a player in your turn-based game so that a strategist object can plan game moves.

Declaration

@protocol GKGameModelPlayer

Overview

You adopt this protocol to describe the gameplay of your turn-based game for use by a GKStrategist object. The strategist uses your player class, along with other custom classes you implement (adopting the GKGameModel and GKGameModelUpdate protocols) to plan moves in your game.

You use your custom class implementing this protocol in several places:

Your class that implements this protocol can also contain properties and methods relevant to the implementation of your game—for example, an identifying color or name.

For more information about describing your gameplay model and using a strategist, see The Minmax Strategist in GameplayKit Programming Guide.

Topics

Identifying a Player

playerId

A number uniquely identifying the player.

Required.

Relationships

Inherits From

See Also

Strategists

GKStrategist

A general interface for objects that provide artificial intelligence for use in turn-based (and similar) games.

GKMinmaxStrategist

An AI that chooses moves in turn-based games using a deterministic strategy.

GKMonteCarloStrategist

An AI that chooses moves in turn-based games using a probabilistic strategy.

GKGameModel

Implement this protocol to describe your gameplay model so that a strategist object can plan game moves.

GKGameModelUpdate

Implement this protocol to describe a move in your turn-based game so that a strategist object can plan game moves.