gpg::
  #include <turn_based_match.h>
  包含 TurnBasedMatch 目前狀態相關資料的資料結構。
摘要
| 建構函式和解構函式 | |
|---|---|
| TurnBasedMatch() | |
| TurnBasedMatch(std::shared_ptr< const TurnBasedMatchImpl > impl) | |
| TurnBasedMatch(const TurnBasedMatch & copy_from)建立現有「 TurnBasedMatch」的副本。 | |
| TurnBasedMatch(TurnBasedMatch && move_from)移動現有的  TurnBasedMatch。 | 
| 公開函式 | |
|---|---|
| AutomatchingSlotsAvailable() const  | uint32_t傳回比對可用的自動配對版位數量。 | 
| CreatingParticipant() const  | 傳回建立此比對的參與者。 | 
| CreationTime() const  | std::chrono::milliseconds傳回此  TurnBasedMatch was created的時間 (以 Unix 紀元以來的毫秒數表示)。 | 
| Data() const  | const std::vector< uint8_t > &如果  HasData()為 true,則傳回比對資料。 | 
| Description() const  | const std::string &傳回由伺服器產生的比對狀態摘要。 | 
| HasData() const  | bool如果此物件含有您在上一個轉彎處設定的資料,則為 True。 | 
| HasPreviousMatchData() const  | bool如果這是重新比對的第一次回合,則為 True,且之前 Valid 的資料必須傳回 true,這個函式才可供使用。 | 
| HasRematchId() const  | bool如果這個比對項目已重新配對,則傳回 true。 | 
| Id() const  | const std::string &傳回專門用來識別此  TurnBasedMatch的 ID。 | 
| LastUpdateTime() const  | 傳回上次更新  TurnBasedMatch的時間 (以 Unix 紀元以來的毫秒數表示)。 | 
| LastUpdatingParticipant() const  | 傳回最近更新此對戰的參與者。 | 
| Number() const  | uint32_t以數字表示在重新比對之前,之前有多少相符項目。 | 
| ParticipantResults() const  | const gpg::ParticipantResults &傳回比對結果。 | 
| Participants() const  | const std::vector< MultiplayerParticipant > &這場比賽中所有參與者的向量。 | 
| PendingParticipant() const  | 傳回輪到要更新此對戰的參與者。 | 
| PreviousMatchData() const  | const std::vector< uint8_t > &先前比對資料 (如果為 HasPreviousMatchData())。 | 
| RematchId() const  | const std::string &傳回要重新比對的相符項目 ID (如有)。 | 
| Status() const  | 傳回本機參與者的對戰狀態。 | 
| SuggestedNextParticipant() const  | 輔助函式,從已加入會議、可邀請和自動配對的參與者組合中,挑選有效的參與者。 | 
| Valid() const  | bool如果這個  TurnBasedMatch填入資料,則傳回 true。 | 
| Variant() const  | uint32_t傳回遊戲專屬的變化版本 ID,遊戲可用來識別不同遊戲模式。 | 
| Version() const  | uint32_t嚴格遞增的 ID,每當比對結果修改時,就會更新這個 ID。 | 
| operator=(const TurnBasedMatch & copy_from) | 透過複製另一個項目來指派此 TurnBasedMatch。 | 
| operator=(TurnBasedMatch && move_from) | 透過移動另一個項目來指派 TurnBasedMatch。 | 
公開函式
AutomatchingSlotsAvailable
uint32_t AutomatchingSlotsAvailable() const
傳回比對可用的自動配對版位數量。
這個數字等於建立對戰的自動配對運算單元數量,減去已透過自動配對功能加入的參與者人數。Valid 必須傳回 true,這個函式才能使用。
CreatingParticipant
MultiplayerParticipant CreatingParticipant() const
傳回建立此比對的參與者。
Valid 必須傳回 true,這個函式才能使用。
CreationTime
std::chrono::milliseconds CreationTime() const
傳回此 TurnBasedMatch was created 的時間 (以 Unix 紀元以來的毫秒數表示)。
Valid 必須傳回 true,這個函式才能使用。
資料
const std::vector< uint8_t > & Data() const
HasPreviousMatchData
bool HasPreviousMatchData() const
如果這是重新比對的第一次回合,則為 True,且之前 Valid 的資料必須傳回 true,這個函式才可供使用。
HasRematchId
bool HasRematchId() const
如果這個比對項目已重新配對,則傳回 true。
ID
const std::string & Id() const
傳回專門用來識別此 TurnBasedMatch 的 ID。
稍後如要擷取這個相符項目,請與 TurnBasedMultiplayerManager::FetchMatch 搭配使用。Valid 必須傳回 true,這個函式才能使用。
LastUpdateTime
Timestamp LastUpdateTime() const
傳回上次更新 TurnBasedMatch 的時間 (以 Unix 紀元以來的毫秒數表示)。
Valid 必須傳回 true,這個函式才能使用。
LastUpdatingParticipant
MultiplayerParticipant LastUpdatingParticipant() const
傳回最近更新此對戰的參與者。
Valid 必須傳回 true,這個函式才能使用。
數字
uint32_t Number() const
以數字表示在重新比對之前,之前有多少相符項目。
在第一個相符項目設為 1,每次重新對戰時加 1。
ParticipantResults
const gpg::ParticipantResults & ParticipantResults() const
傳回比對結果。
您可以透過 TurnBasedMultiplayerManager::TakeMyTurn、TurnBasedMultiplayerManager::FinishDuringMyTurn 和其他相關函式設定結果。一律使用 ParticipantResults().WithResult(...) 建立與任何現有物件一致的新 ParticipantResults 物件。Valid 必須傳回 true,這個函式才能使用。
參與者
const std::vector< MultiplayerParticipant > & Participants() const
這場比賽中所有參與者的向量。
Valid 必須傳回 true,這個函式才能使用。
PendingParticipant
MultiplayerParticipant PendingParticipant() const
傳回輪到要更新此對戰的參與者。
Valid 必須傳回 true,這個函式才能使用。
PreviousMatchData
const std::vector< uint8_t > & PreviousMatchData() const
先前比對資料 (如果為 HasPreviousMatchData())。
只有在 Valid 傳回 true 時才能呼叫。
RematchId
const std::string & RematchId() const
傳回要重新比對的相符項目 ID (如有)。
SuggestedNextParticipant
MultiplayerParticipant SuggestedNextParticipant() const
輔助函式,從已加入會議、可邀請和自動配對的參與者組合中,挑選有效的參與者。
如果一律使用這個函式來選取下一位參與者,系統會依序播放所有參與者,必要時重複進行。只有在 Status() 為 MatchStatus::MY_TURN 時才需要呼叫此函式,因為這個函式的結果只使用了一次。如果呼叫不正確,這個函式會傳回無效的參與者 (MultiplayerParticipant::Valid() == false)。
TurnBasedMatch
TurnBasedMatch()
TurnBasedMatch
TurnBasedMatch( std::shared_ptr< const TurnBasedMatchImpl > impl )
從 shared_ptr 建構 TurnBasedMatch 至 TurnBasedMatchImpl。
適用於 API 的內部使用。
有效
bool Valid() const
如果這個 TurnBasedMatch 填入資料,則傳回 true。
針對 TurnBasedMatch 物件 (Id、CreationTime 等) 中的 getter 函式,必須傳回 true。
版本
uint32_t Version() const
嚴格遞增的 ID,每次比對符合項目時就會更新。
operator=
TurnBasedMatch & operator=( const TurnBasedMatch & copy_from )
透過複製另一個項目來指派此TurnBasedMatch。
