<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKGameModelPlayer",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKGameModelPlayer"
  },
  "title" : "GKGameModelPlayer"
}
-->

# GKGameModelPlayer

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

```
protocol GKGameModelPlayer : NSObjectProtocol
```

## Overview

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

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

- In the [`players`](/documentation/GameplayKit/GKGameModel/players) and [`activePlayer`](/documentation/GameplayKit/GKGameModel/activePlayer) properties of your game model class, to describe the set of players in your game and indicate which player’s turn it currently is
- In the [`gameModelUpdates(for:)`](/documentation/GameplayKit/GKGameModel/gameModelUpdates(for:)) method of your game model class, to describe the set of moves currently valid for a specified player
- In the [`isWin(for:)`](/documentation/GameplayKit/GKGameModel/isWin(for:)), [`isLoss(for:)`](/documentation/GameplayKit/GKGameModel/isLoss(for:)), and [`score(for:)`](/documentation/GameplayKit/GKGameModel/score(for:)) method of your game model class, to rate the desirability of that particular state of the game model to a specified player
- When calling the [`bestMove(for:)`](/documentation/GameplayKit/GKMinmaxStrategist/bestMove(for:)) or [`randomMove(for:fromNumberOfBestMoves:)`](/documentation/GameplayKit/GKMinmaxStrategist/randomMove(for:fromNumberOfBestMoves:)) method to find an optimal move, to indicate the player for whom GameplayKit should plan moves

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](https://developer.apple.com/library/archive/documentation/General/Conceptual/GameplayKit_Guide/Minmax.html#//apple_ref/doc/uid/TP40015172-CH2) in [GameplayKit Programming Guide](https://developer.apple.com/library/archive/documentation/General/Conceptual/GameplayKit_Guide/index.html#//apple_ref/doc/uid/TP40015172).

## Topics

### Identifying a Player

[`playerId`](/documentation/GameplayKit/GKGameModelPlayer/playerId)

A number uniquely identifying the player.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)