概览
表示接收端设备上运行的游戏管理器的状态。
- Deprecated:
- Game Manager API 不再受支持,并将在未来的版本中移除。
此类继承 NSObject。
实例方法摘要 | |
(GCKPlayerInfo *__nullable) | - getPlayer: |
返回指定玩家 ID 的 GCKPlayerInfo,如果玩家不存在,则返回 nil 。更多... | |
(NSArray< GCKPlayerInfo * > *) | - getPlayersInState: |
返回处于指定播放器状态的玩家列表。更多... | |
(BOOL) | - hasLobbyStateChanged: |
返回此对象与指定的游戏管理器状态之间大堂状态是否不同。更多... | |
(BOOL) | - hasGameplayStateChanged: |
返回此对象和指定的游戏管理器状态之间的游戏状态是否不同。更多... | |
(BOOL) | - hasGameDataChanged: |
返回此对象与指定游戏管理器状态之间是否存在差异游戏数据。更多... | |
(BOOL) | - hasGameStatusTextChanged: |
返回此对象与指定的游戏管理器状态是否不同的游戏状态文本。更多... | |
(BOOL) | - hasPlayerChanged:otherState: |
返回具有指定玩家 ID 的玩家是否已在此对象和指定的游戏管理器状态之间切换。更多... | |
(BOOL) | - hasPlayerStateChanged:otherState: |
返回具有指定玩家 ID 的玩家的玩家状态在此对象和指定游戏管理器状态之间是否已更改。更多... | |
(BOOL) | - hasPlayerDataChanged:otherState: |
返回具有指定玩家 ID 的玩家的玩家数据在此对象和指定游戏管理器状态之间是否已更改。更多... | |
(NSArray< NSString * > *) | - getListOfChangedPlayers: |
返回此对象与指定游戏管理器状态之间不同的玩家 ID 的列表。更多... | |
属性摘要 | |
GCKLobbyState | lobbyState |
大堂状态。更多... | |
GCKGameplayState | gameplayState |
游戏内容状态。更多... | |
id | gameData |
游戏相关数据。更多... | |
NSString * | gameStatusText |
游戏状态文字。更多... | |
NSArray< GCKPlayerInfo * > * | players |
游戏中所有玩家的列表。更多... | |
NSArray< GCKPlayerInfo * > * | controllablePlayers |
此发送者设备创建的所有玩家的列表。更多... | |
NSArray< GCKPlayerInfo * > * | connectedPlayers |
处于已连接状态的玩家列表。更多... | |
NSArray< GCKPlayerInfo * > * | connectedControllablePlayers |
处于此关联状态且在此发送者设备上创建的玩家的列表。更多... | |
NSString * | applicationName |
应用名称。更多... | |
NSInteger | maxPlayers |
接收方定义的玩家数上限。更多... | |
方法详细信息
- (GCKPlayerInfo *__nullable) getPlayer: | (NSString *) | playerID |
返回指定玩家 ID 的 GCKPlayerInfo,如果玩家不存在,则返回 nil
。
- Parameters
-
playerID The player ID.
- (NSArray<GCKPlayerInfo *> *) getPlayersInState: | (GCKPlayerState) | playerState |
返回处于指定播放器状态的玩家列表。
- Parameters
-
playerState The player state.
- (BOOL) hasLobbyStateChanged: | (GCKGameManagerState *) | otherState |
返回此对象与指定的游戏管理器状态之间大堂状态是否不同。
- Parameters
-
otherState The game manager state to compare to.
- (BOOL) hasGameplayStateChanged: | (GCKGameManagerState *) | otherState |
返回此对象和指定的游戏管理器状态之间的游戏状态是否不同。
- Parameters
-
otherState The game manager state to compare to.
- (BOOL) hasGameDataChanged: | (GCKGameManagerState *) | otherState |
返回此对象与指定游戏管理器状态之间是否存在差异游戏数据。
- Parameters
-
otherState The game manager state to compare to.
- (BOOL) hasGameStatusTextChanged: | (GCKGameManagerState *) | otherState |
返回此对象与指定的游戏管理器状态是否不同的游戏状态文本。
- Parameters
-
otherState The game manager state to compare to.
- (BOOL) hasPlayerChanged: | (NSString *) | playerId | |
otherState: | (GCKGameManagerState *) | otherState | |
返回具有指定玩家 ID 的玩家是否已在此对象和指定的游戏管理器状态之间切换。
- Parameters
-
playerId The player ID. otherState The game manager state to compare to.
- (BOOL) hasPlayerStateChanged: | (NSString *) | playerId | |
otherState: | (GCKGameManagerState *) | otherState | |
返回具有指定玩家 ID 的玩家的玩家状态在此对象和指定游戏管理器状态之间是否已更改。
- Parameters
-
playerId The player ID. otherState The game manager state to compare to.
- (BOOL) hasPlayerDataChanged: | (NSString *) | playerId | |
otherState: | (GCKGameManagerState *) | otherState | |
返回具有指定玩家 ID 的玩家的玩家数据在此对象和指定游戏管理器状态之间是否已更改。
- Parameters
-
playerId The player ID. otherState The game manager state to compare to.
- (NSArray<NSString *> *) getListOfChangedPlayers: | (GCKGameManagerState *) | otherState |
返回此对象与指定游戏管理器状态之间不同的玩家 ID 的列表。
包括已添加、移除或以任何方式更改过的玩家。
- Parameters
-
otherState The game manager state to compare to.
属性详情
|
readnonatomicassign |
大堂状态。
如需了解有效值,请参阅 GCKLobbyState。
|
readnonatomicassign |
游戏内容状态。
如需了解有效值,请参阅 GCKGameplayState。
|
readnonatomiccopy |
游戏相关数据。
可以是可以使用 NSJSONSerialization 序列化为 JSON 的对象,也可以是 nil
。
|
readnonatomiccopy |
游戏状态文字。
|
readnonatomicstrong |
游戏中所有玩家的列表。
|
readnonatomicassign |
此发送者设备创建的所有玩家的列表。
|
readnonatomicstrong |
处于已连接状态的玩家列表。
如果关联的 GCKPlayerInfo::playerState 是 GCKPlayerStateAvailable、GCKPlayerStateReady、GCKPlayerStateIdle 或 GCKPlayerStatePlaying 之一,则玩家会被视为处于已连接状态。
|
readnonatomicstrong |
处于此关联状态且在此发送者设备上创建的玩家的列表。
如果关联的 GCKPlayerInfo::playerState 是 GCKPlayerStateAvailable、GCKPlayerStateReady、GCKPlayerStateIdle 或 GCKPlayerStatePlaying 之一,则玩家会被视为处于已连接状态。
|
readnonatomiccopy |
应用名称。
如果 GCKGameManagerChannel 尚未连接到接收者的游戏管理器,则返回 nil
。
|
readnonatomicassign |
接收方定义的玩家数上限。
如果 GCKGameManagerChannel 尚未连接到接收者的游戏管理器,则返回 0。