GCKGameManagerState 類別

GCKGameManagerState 類別參考資料

總覽

代表接收器裝置上執行之 Game Manager 狀態的物件。

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 尚未連線至接收者的 Game Manager,則會傳回 nil

- (NSInteger) maxPlayers
readnonatomicassign

接收器定義的玩家人數上限。

如果 GCKGameManagerChannel 尚未連線至接收者的 Game Manager,則會傳回 0。