GCKPlayerInfo 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
表示单个玩家的数据。
- Deprecated:
- 游戏管理器 API 不再受支持,并且将在未来的版本中移除。
此类继承 NSObject。
|
(instancetype) | - init |
| 默认初始化程序不可用。更多…
|
|
如果此播放器是在此发送设备上创建的,则为 true。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003eGCKPlayerInfo\u003c/code\u003e class represents data for a single player in a game session, including player ID, state, and custom data.\u003c/p\u003e\n"],["\u003cp\u003eThis class is part of the Game Manager API, which is deprecated and will be removed in a future release.\u003c/p\u003e\n"],["\u003cp\u003ePlayers have properties such as \u003ccode\u003eplayerID\u003c/code\u003e, \u003ccode\u003eplayerState\u003c/code\u003e, \u003ccode\u003eplayerData\u003c/code\u003e, \u003ccode\u003eisConnected\u003c/code\u003e, and \u003ccode\u003eisControllable\u003c/code\u003e that provide information about their status and connection.\u003c/p\u003e\n"],["\u003cp\u003eA player is considered connected if their \u003ccode\u003eplayerState\u003c/code\u003e is \u003ccode\u003eAvailable\u003c/code\u003e, \u003ccode\u003eReady\u003c/code\u003e, \u003ccode\u003eIdle\u003c/code\u003e, or \u003ccode\u003ePlaying\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eisControllable\u003c/code\u003e indicates if the player was created on the current sender device.\u003c/p\u003e\n"]]],[],null,["# GCKPlayerInfo Class\n\n[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKPlayerInfo Class Reference \n\nOverview\n--------\n\nRepresents data for a single player.\n\n**[Deprecated:](/cast/v3/reference/ios/deprecated#_deprecated000034)**\n: The Game Manager API is no longer supported and will be removed in a future release.\n\nInherits NSObject.\n\n|----------------|------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (instancetype) | - [init](/cast/v3/reference/ios/interface_g_c_k_player_info#a89f3be2a574f25fdc46c6e5d7dd4d573) |\n| | Default initializer is not available. [More...](#a89f3be2a574f25fdc46c6e5d7dd4d573) |\n| ||\n\n|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| Property Summary ---------------- ||\n| NSString \\* | [playerID](/cast/v3/reference/ios/interface_g_c_k_player_info#a44a8551b19bb66ee6b1530a6c9830ce3) |\n| | The unique string identifier of this player. [More...](#a44a8551b19bb66ee6b1530a6c9830ce3) |\n| ||\n| [GCKPlayerState](/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6) | [playerState](/cast/v3/reference/ios/interface_g_c_k_player_info#a2f8fa3a0d0dce2d25d02b064ce56f7c5) |\n| | The current state of the player. [More...](#a2f8fa3a0d0dce2d25d02b064ce56f7c5) |\n| ||\n| id | [playerData](/cast/v3/reference/ios/interface_g_c_k_player_info#a2bf6c1907bdb9c3199555c368555c66e) |\n| | Player-specific data defined by the game. [More...](#a2bf6c1907bdb9c3199555c368555c66e) |\n| ||\n| BOOL | [isConnected](/cast/v3/reference/ios/interface_g_c_k_player_info#ad78f0b377f667d189ad2cbcac3f26023) |\n| | True if this player is in a connected state. [More...](#ad78f0b377f667d189ad2cbcac3f26023) |\n| ||\n| BOOL | [isControllable](/cast/v3/reference/ios/interface_g_c_k_player_info#a28257a72c946d2296617e619390be34c) |\n| | True if this player is was created on this sender device. [More...](#a28257a72c946d2296617e619390be34c) |\n| ||\n\nMethod Detail\n-------------\n\n|-----------------------|---|---|---|\n| - (instancetype) init | | | |\n\nDefault initializer is not available.\n\nProperty Detail\n---------------\n\n|---------------------------------------------------------|-------------------|\n| |-------------------------| | - (NSString\\*) playerID | | readnonatomiccopy |\n\nThe unique string identifier of this player. \n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|\n| |------------------------------------------------------------------------------------------------------------------| | - ([GCKPlayerState](/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6)) playerState | | readnonatomicassign |\n\nThe current state of the player. \n\n|---------------------------------------------|-------------------|\n| |-------------------| | - (id) playerData | | readnonatomiccopy |\n\nPlayer-specific data defined by the game.\n\nThis data is persisted while the game is running. Will be either an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. \n\n|---------------------------------------------------|---------------------|\n| |----------------------| | - (BOOL) isConnected | | readnonatomicassign |\n\nTrue if this player is in a connected state.\n\nA player is considered to be in a connected state if the associated [GCKPlayerInfo::playerState](/cast/v3/reference/ios/interface_g_c_k_player_info#a2f8fa3a0d0dce2d25d02b064ce56f7c5 \"The current state of the player. \") is one of [GCKPlayerStateAvailable](/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa45be92bf9f623b97cd1451ba70b17fc), [GCKPlayerStateReady](/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6a67c467391f891b6ca8cf79f1ce10b561), [GCKPlayerStateIdle](/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6af675a8e49374d9b30e18589adbf4a687), or [GCKPlayerStatePlaying](/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa01672db33b85b34abc2d7f21518eb1a). \n\n|---------------------------------------------------------|---------------------|\n| |-------------------------| | - (BOOL) isControllable | | readnonatomicassign |\n\nTrue if this player is was created on this sender device."]]