GCKGameManagerState 类

GCKGameManagerState 类参考

概览

在接收器设备上运行的游戏管理器的状态表示。

Deprecated:
游戏管理器 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
playerIDThe player ID.
- (NSArray<GCKPlayerInfo *> *) getPlayersInState: (GCKPlayerState playerState

返回处于指定玩家状态的玩家列表。

Parameters
playerStateThe player state.
- (BOOL) hasLobbyStateChanged: (GCKGameManagerState *)  otherState

返回此对象与指定的游戏管理器状态之间的大厅状态是否不同。

Parameters
otherStateThe game manager state to compare to.
- (BOOL) hasGameplayStateChanged: (GCKGameManagerState *)  otherState

返回此对象与指定的游戏管理器状态之间的游戏状态是否不同。

Parameters
otherStateThe game manager state to compare to.
- (BOOL) hasGameDataChanged: (GCKGameManagerState *)  otherState

返回此对象与指定的游戏管理器状态之间的游戏数据是否不同。

Parameters
otherStateThe game manager state to compare to.
- (BOOL) hasGameStatusTextChanged: (GCKGameManagerState *)  otherState

返回此对象与指定的游戏管理器状态之间的游戏状态文本是否不同。

Parameters
otherStateThe game manager state to compare to.
- (BOOL) hasPlayerChanged: (NSString *)  playerId
otherState: (GCKGameManagerState *)  otherState 

返回具有指定玩家 ID 的玩家是否在此对象与指定的游戏管理器状态之间发生了变化。

Parameters
playerIdThe player ID.
otherStateThe game manager state to compare to.
- (BOOL) hasPlayerStateChanged: (NSString *)  playerId
otherState: (GCKGameManagerState *)  otherState 

返回具有指定玩家 ID 的玩家的玩家状态是否已在此对象与指定的游戏管理器状态之间发生变化。

Parameters
playerIdThe player ID.
otherStateThe game manager state to compare to.
- (BOOL) hasPlayerDataChanged: (NSString *)  playerId
otherState: (GCKGameManagerState *)  otherState 

返回具有指定玩家 ID 的玩家的数据是否在此对象与指定的游戏管理器状态之间发生了变化。

Parameters
playerIdThe player ID.
otherStateThe game manager state to compare to.
- (NSArray<NSString *> *) getListOfChangedPlayers: (GCKGameManagerState *)  otherState

返回此对象与指定的游戏管理器状态之间不同的玩家 ID 列表。

这包括已添加、移除或以任何方式发生变化的球员。

Parameters
otherStateThe game manager state to compare to.

媒体资源详情

- (GCKLobbyState) lobbyState
readnonatomicassign

大厅状态。

如需查看有效值,请参阅 GCKLobbyState。

- (GCKGameplayState) gameplayState
readnonatomicassign

游戏状态。

如需查看有效值,请参阅 GCKGameplayState。

- (id) gameData
readnonatomiccopy

特定于游戏的数据。

可以是可以使用 NSJSONSerialization 序列化为 JSON 的对象,也可以是 nil

- (NSString*) gameStatusText
readnonatomiccopy

游戏状态文本。

- (NSArray<GCKPlayerInfo *>*) players
readnonatomicstrong

游戏中的所有玩家的列表。

- (NSArray<GCKPlayerInfo *>*) controllablePlayers
readnonatomicassign

相应发送方设备创建的所有播放器的列表。

- (NSArray<GCKPlayerInfo *>*) connectedPlayers
readnonatomicstrong

处于已连接状态的玩家列表。

如果关联的 GCKPlayerInfo::playerStateGCKPlayerStateAvailableGCKPlayerStateReadyGCKPlayerStateIdleGCKPlayerStatePlaying 之一,则表示播放器处于已连接状态。

- (NSArray<GCKPlayerInfo *>*) connectedControllablePlayers
readnonatomicstrong

处于已连接状态且在此发送设备上创建的播放器的列表。

如果关联的 GCKPlayerInfo::playerStateGCKPlayerStateAvailableGCKPlayerStateReadyGCKPlayerStateIdleGCKPlayerStatePlaying 之一,则表示播放器处于已连接状态。

- (NSString*) applicationName
readnonatomiccopy

应用名称。

如果 GCKGameManagerChannel 尚未连接到接收者的游戏管理器,则返回 nil

- (NSInteger) maxPlayers
readnonatomicassign

接收器定义的最大玩家数量。

如果 GCKGameManagerChannel 尚未连接到接收者的游戏管理器,则返回 0。