# GCKGameManagerState Class

[Instance Methods](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#pub-methods) \| [Properties](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#properties) GCKGameManagerState Class Reference

## Overview

A representation of the state of the Game Manager running on the receiver device.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000020)**
:   The Game Manager API is no longer supported and will be removed in a future release.

Inherits NSObject.

|---|---|
| ## Instance Method Summary ||
| ([GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \*__nullable) | - [getPlayer:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a4c6cec9cc7703fa1c31001108b601a4b) |
|   | Returns the [GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info "Represents data for a single player. ") for the specified player ID or `nil` if the player does not exist. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a4c6cec9cc7703fa1c31001108b601a4b) |
|   ||
| (NSArray\< [GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \* \> \*) | - [getPlayersInState:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a42ec9263d1f760c254c6afab9118c87d) |
|   | Returns a list of players that are in the specified player state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a42ec9263d1f760c254c6afab9118c87d) |
|   ||
| (BOOL) | - [hasLobbyStateChanged:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a1ac52b407ba0ed42f0d62068a1c8ed25) |
|   | Returns whether the lobby state is different between this object and the specified game manager state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a1ac52b407ba0ed42f0d62068a1c8ed25) |
|   ||
| (BOOL) | - [hasGameplayStateChanged:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a3ad7e66ba24426559fa3397e2335049c) |
|   | Returns whether the gameplay state is different between this object and the specified game manager state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a3ad7e66ba24426559fa3397e2335049c) |
|   ||
| (BOOL) | - [hasGameDataChanged:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#aadb1b1ce4c9618807656a8495dfb7c84) |
|   | Returns whether the game data is different between this object and the specified game manager state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#aadb1b1ce4c9618807656a8495dfb7c84) |
|   ||
| (BOOL) | - [hasGameStatusTextChanged:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a885a2998ef29a501746de3bac16fd815) |
|   | Returns whether game status text is different between this object and the specified game manager state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a885a2998ef29a501746de3bac16fd815) |
|   ||
| (BOOL) | - [hasPlayerChanged:otherState:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a607ed1cdcace305a01a33788f879d276) |
|   | Returns whether the player with the specified player ID has changed between this object and the specified game manager state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a607ed1cdcace305a01a33788f879d276) |
|   ||
| (BOOL) | - [hasPlayerStateChanged:otherState:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a086f0c11510bec9ef9c3a2eacdb77c1d) |
|   | Returns whether the player state of the player with the specified player ID has changed between this object and the specified game manager state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a086f0c11510bec9ef9c3a2eacdb77c1d) |
|   ||
| (BOOL) | - [hasPlayerDataChanged:otherState:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a0672fdf8dc2281619b726a8b1708babd) |
|   | Returns whether the player data of the player with the specified player ID has changed between this object and the specified game manager state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a0672fdf8dc2281619b726a8b1708babd) |
|   ||
| (NSArray\< NSString \* \> \*) | - [getListOfChangedPlayers:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a7d088664c13db86af3cb20104daf1ad0) |
|   | Returns a list of player IDs that are different between this object and the specified game manager state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a7d088664c13db86af3cb20104daf1ad0) |
|   ||

|---|---|
| ## Property Summary ||
| [GCKLobbyState](https://developers.google.com/cast/v3/reference/ios/g_c_k_lobby_state_8h#afcdd9a6ac637781d8c87f4dfb97832e1) | [lobbyState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#ab3955a03824d295ea536e18659fb4161) |
|   | The lobby state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#ab3955a03824d295ea536e18659fb4161) |
|   ||
| [GCKGameplayState](https://developers.google.com/cast/v3/reference/ios/g_c_k_gameplay_state_8h#a4154426d931e8848dae63734e124a410) | [gameplayState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a0015fc8af8ff4def7f941fc8ecda1b81) |
|   | The gameplay state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a0015fc8af8ff4def7f941fc8ecda1b81) |
|   ||
| id | [gameData](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#af9453ac8ac188f774a4417676dbcf6eb) |
|   | The game specific data. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#af9453ac8ac188f774a4417676dbcf6eb) |
|   ||
| NSString \* | [gameStatusText](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a2451329b82b21800edd76875c38ec1c7) |
|   | The game status text. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a2451329b82b21800edd76875c38ec1c7) |
|   ||
| NSArray\< [GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \* \> \* | [players](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#aaae4d40298e4c0dbb357c9d656b6965c) |
|   | The list of all players in the game. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#aaae4d40298e4c0dbb357c9d656b6965c) |
|   ||
| NSArray\< [GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \* \> \* | [controllablePlayers](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#ae75ef2d581cafdf2f0b4d9ae5209defa) |
|   | The list of all the players created by this sender device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#ae75ef2d581cafdf2f0b4d9ae5209defa) |
|   ||
| NSArray\< [GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \* \> \* | [connectedPlayers](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a26f71496b177fa6dfea9ab46c2bbb4f9) |
|   | The list of players in a connected state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a26f71496b177fa6dfea9ab46c2bbb4f9) |
|   ||
| NSArray\< [GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \* \> \* | [connectedControllablePlayers](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#ad27ac9a1c116d8ec6f96bee7b4a7280b) |
|   | The list of players in a connected state that were also created on this sender device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#ad27ac9a1c116d8ec6f96bee7b4a7280b) |
|   ||
| NSString \* | [applicationName](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a61a56ae95918abe3e5b23eeb547c0176) |
|   | The application name. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#a61a56ae95918abe3e5b23eeb547c0176) |
|   ||
| NSInteger | [maxPlayers](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#af78fe9325174d8bec3b2979bf26e4507) |
|   | The maximum number of players as defined by the receiver. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state#af78fe9325174d8bec3b2979bf26e4507) |
|   ||

## Method Detail

|---|---|---|---|---|
| - ([GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \*__nullable) getPlayer: |   | (NSString \*) | *playerID* |   |

Returns the [GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info "Represents data for a single player. ") for the specified player ID or `nil` if the player does not exist.

Parameters
:

    |---|---|
    | playerID | The player ID. |


|---|---|---|---|---|
| - (NSArray\<[GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \*\> \*) getPlayersInState: |   | ([GCKPlayerState](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6)) | *playerState* |   |

Returns a list of players that are in the specified player state.

Parameters
:

    |---|---|
    | playerState | The player state. |


|---|---|---|---|---|
| - (BOOL) hasLobbyStateChanged: |   | ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \*) | *otherState* |   |

Returns whether the lobby state is different between this object and the specified game manager state.

Parameters
:

    |---|---|
    | otherState | The game manager state to compare to. |


|---|---|---|---|---|
| - (BOOL) hasGameplayStateChanged: |   | ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \*) | *otherState* |   |

Returns whether the gameplay state is different between this object and the specified game manager state.

Parameters
:

    |---|---|
    | otherState | The game manager state to compare to. |


|---|---|---|---|---|
| - (BOOL) hasGameDataChanged: |   | ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \*) | *otherState* |   |

Returns whether the game data is different between this object and the specified game manager state.

Parameters
:

    |---|---|
    | otherState | The game manager state to compare to. |


|---|---|---|---|---|
| - (BOOL) hasGameStatusTextChanged: |   | ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \*) | *otherState* |   |

Returns whether game status text is different between this object and the specified game manager state.

Parameters
:

    |---|---|
    | otherState | The game manager state to compare to. |


|---|---|---|---|
| - (BOOL) hasPlayerChanged: |   | (NSString \*) | *playerId* |
| otherState: |   | ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \*) | *otherState* |
|   |   |   |   |

Returns whether the player with the specified player ID has changed between this object and the specified game manager state.

Parameters
:

    |---|---|
    | playerId | The player ID. |
    | otherState | The game manager state to compare to. |


|---|---|---|---|
| - (BOOL) hasPlayerStateChanged: |   | (NSString \*) | *playerId* |
| otherState: |   | ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \*) | *otherState* |
|   |   |   |   |

Returns whether the player state of the player with the specified player ID has changed between this object and the specified game manager state.

Parameters
:

    |---|---|
    | playerId | The player ID. |
    | otherState | The game manager state to compare to. |


|---|---|---|---|
| - (BOOL) hasPlayerDataChanged: |   | (NSString \*) | *playerId* |
| otherState: |   | ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \*) | *otherState* |
|   |   |   |   |

Returns whether the player data of the player with the specified player ID has changed between this object and the specified game manager state.

Parameters
:

    |---|---|
    | playerId | The player ID. |
    | otherState | The game manager state to compare to. |


|---|---|---|---|---|
| - (NSArray\<NSString \*\> \*) getListOfChangedPlayers: |   | ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \*) | *otherState* |   |

Returns a list of player IDs that are different between this object and the specified game manager state.

This includes players that were added, removed, or have changed in any way.

Parameters
:

    |---|---|
    | otherState | The game manager state to compare to. |


## Property Detail

|---|---|
| |---| | - ([GCKLobbyState](https://developers.google.com/cast/v3/reference/ios/g_c_k_lobby_state_8h#afcdd9a6ac637781d8c87f4dfb97832e1)) lobbyState | | readnonatomicassign |

The lobby state.

See GCKLobbyState for valid values.

|---|---|
| |---| | - ([GCKGameplayState](https://developers.google.com/cast/v3/reference/ios/g_c_k_gameplay_state_8h#a4154426d931e8848dae63734e124a410)) gameplayState | | readnonatomicassign |

The gameplay state.

See GCKGameplayState for valid values.

|---|---|
| |---| | - (id) gameData | | readnonatomiccopy |

The game specific data.

Will be either an object that can be serialized to JSON using NSJSONSerialization, or `nil`.

|---|---|
| |---| | - (NSString\*) gameStatusText | | readnonatomiccopy |

The game status text.

|---|---|
| |---| | - (NSArray\<[GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \*\>\*) players | | readnonatomicstrong |

The list of all players in the game.

|---|---|
| |---| | - (NSArray\<[GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \*\>\*) controllablePlayers | | readnonatomicassign |

The list of all the players created by this sender device.

|---|---|
| |---| | - (NSArray\<[GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \*\>\*) connectedPlayers | | readnonatomicstrong |

The list of players in a connected state.

A player is considered to be in a connected state if the associated [GCKPlayerInfo::playerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info#a2f8fa3a0d0dce2d25d02b064ce56f7c5 "The current state of the player. ") is one of [GCKPlayerStateAvailable](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa45be92bf9f623b97cd1451ba70b17fc), [GCKPlayerStateReady](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6a67c467391f891b6ca8cf79f1ce10b561), [GCKPlayerStateIdle](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6af675a8e49374d9b30e18589adbf4a687), or [GCKPlayerStatePlaying](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa01672db33b85b34abc2d7f21518eb1a).

|---|---|
| |---| | - (NSArray\<[GCKPlayerInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info) \*\>\*) connectedControllablePlayers | | readnonatomicstrong |

The list of players in a connected state that were also created on this sender device.

A player is considered to be in a connected state if the associated [GCKPlayerInfo::playerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_player_info#a2f8fa3a0d0dce2d25d02b064ce56f7c5 "The current state of the player. ") is one of [GCKPlayerStateAvailable](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa45be92bf9f623b97cd1451ba70b17fc), [GCKPlayerStateReady](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6a67c467391f891b6ca8cf79f1ce10b561), [GCKPlayerStateIdle](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6af675a8e49374d9b30e18589adbf4a687), or [GCKPlayerStatePlaying](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa01672db33b85b34abc2d7f21518eb1a).

|---|---|
| |---| | - (NSString\*) applicationName | | readnonatomiccopy |

The application name.

Returns `nil` if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

|---|---|
| |---| | - (NSInteger) maxPlayers | | readnonatomicassign |

The maximum number of players as defined by the receiver.

Returns 0 if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.