gpg::ParticipantResults

#include <participant_results.h>

โครงสร้างข้อมูลที่มีข้อมูลเกี่ยวกับผลลัพธ์ต่อผู้เข้าร่วมสำหรับ TurnBasedMatch

สรุป

ผู้ผลิตและผู้ทำลาย

ParticipantResults()
ParticipantResults(std::shared_ptr< const ParticipantResultsImpl > impl)
สร้างออบเจ็กต์ ParticipantResults จาก shared_ptr ไปยัง ParticipantResultsImpl
ParticipantResults(const ParticipantResults & copy_from)
สร้างสำเนาของออบเจ็กต์ ParticipantResults ที่มีอยู่
ParticipantResults(ParticipantResults && move_from)
ย้ายออบเจ็กต์ ParticipantResults ที่มีอยู่

ฟังก์ชันสาธารณะ

HasResultsForParticipant(const std::string & participant_id) const
bool
แสดงผลเป็น "จริง" หากออบเจ็กต์ ParticipantResults นี้มีผลลัพธ์สำหรับ MultiplayerParticipant ที่ระบุ
MatchResultForParticipant(const std::string & participant_id) const
แสดงผล MatchResult ของผู้เข้าร่วมที่ระบุภายใน TurnBasedMatch
PlaceForParticipant(const std::string & participant_id) const
uint32_t
แสดงผลตำแหน่งของผู้เข้าร่วมที่ระบุภายใน TurnBasedMatch
Valid() const
bool
แสดงค่า "จริง" หากออบเจ็กต์ ParticipantResults นี้ป้อนข้อมูล
WithResult(const std::string & participant_id, uint32_t placing, MatchResult result) const
สร้าง ParticipantResults ใหม่ที่มีผลลัพธ์ที่มีอยู่ทั้งหมดและข้อมูลผลลัพธ์เพิ่มเติมที่ส่งผ่านไปยังฟังก์ชันนี้
operator=(const ParticipantResults & copy_from)
กำหนดออบเจ็กต์ ParticipantResults นี้จากออบเจ็กต์อื่น
operator=(ParticipantResults && move_from)
กำหนดออบเจ็กต์ ParticipantResults นี้โดยย้ายออบเจ็กต์อื่นเข้าไป

ฟังก์ชันสาธารณะ

HasResultsForParticipant

bool HasResultsForParticipant(
  const std::string & participant_id
) const 

แสดงผลเป็น "จริง" หากออบเจ็กต์ ParticipantResults นี้มีผลลัพธ์สำหรับ MultiplayerParticipant ที่ระบุ

ค่าถูกต้องจะต้องแสดงผลเป็น true เพื่อให้ฟังก์ชันนี้ใช้งานได้

MatchResultForParticipant

MatchResult MatchResultForParticipant(
  const std::string & participant_id
) const 

แสดงผล MatchResult ของผู้เข้าร่วมที่ระบุภายใน TurnBasedMatch

โปรดทราบว่าผู้เข้าร่วมบางคนอาจไม่มีผลลัพธ์ Match หาก HasResultsForParticipant ไม่แสดงผลเป็น "จริง" ฟังก์ชันนี้จะแสดง MatchResult::NONE ค่าถูกต้องจะต้องแสดงผลเป็น true เพื่อให้ฟังก์ชันนี้ใช้งานได้

ParticipantResults

 ParticipantResults()

ParticipantResults

 ParticipantResults(
  std::shared_ptr< const ParticipantResultsImpl > impl
)

สร้างออบเจ็กต์ ParticipantResults จาก shared_ptr ไปยัง ParticipantResultsImpl

มีไว้เพื่อใช้ภายในโดย API

ParticipantResults

 ParticipantResults(
  const ParticipantResults & copy_from
)

สร้างสำเนาของออบเจ็กต์ ParticipantResults ที่มีอยู่

ParticipantResults

 ParticipantResults(
  ParticipantResults && move_from
)

ย้ายออบเจ็กต์ ParticipantResults ที่มีอยู่

PlaceForParticipant

uint32_t PlaceForParticipant(
  const std::string & participant_id
) const 

แสดงผลตำแหน่งของผู้เข้าร่วมที่ระบุภายใน TurnBasedMatch

โปรดทราบว่าผู้เข้าร่วมบางคนอาจไม่ได้รับผลลัพธ์ หาก HasResultsForParticipant ไม่แสดงผลเป็น "จริง" ฟังก์ชันนี้จะแสดงผลเป็น 0 สำหรับผู้เล่นที่ยังไม่ได้จัดอันดับ ค่าถูกต้องจะต้องแสดงผลเป็น true เพื่อให้ฟังก์ชันนี้ใช้งานได้

ถูกต้อง

bool Valid() const 

แสดงค่า "จริง" หากออบเจ็กต์ ParticipantResults นี้ป้อนข้อมูล

ต้องเป็น "จริง" เพื่อให้ฟังก์ชัน Getter (PlaceForParticipant, MatchResultForParticipant ฯลฯ) ในออบเจ็กต์ ParticipantResults นี้ใช้งานได้

WithResult

ParticipantResults WithResult(
  const std::string & participant_id,
  uint32_t placing,
  MatchResult result
) const 

สร้าง ParticipantResults ใหม่ที่มีผลลัพธ์ที่มีอยู่ทั้งหมดและข้อมูลผลลัพธ์เพิ่มเติมที่ส่งผ่านไปยังฟังก์ชันนี้

โปรดทราบว่าผลลัพธ์จะตั้งได้เพียงครั้งเดียวต่อผู้เข้าร่วม 1 คน การพยายามตั้งค่าผลลัพธ์มากกว่า 1 รายการจะบันทึกข้อผิดพลาดและคง ParticipantResults ไว้โดยไม่มีการแก้ไข ค่าถูกต้องจะต้องแสดงผลเป็น true เพื่อให้ฟังก์ชันนี้ใช้งานได้

รายละเอียด
พารามิเตอร์
participant_id
MultiplayerParticipant ที่จะเพิ่มผลลัพธ์
placing
ตำแหน่งของผู้เข้าร่วมการแข่งขัน
result
MatchResult สำหรับผู้เข้าร่วมภายในการแข่งขัน

operator=

ParticipantResults & operator=(
  const ParticipantResults & copy_from
)

กำหนดออบเจ็กต์ ParticipantResults นี้จากออบเจ็กต์อื่น

operator=

ParticipantResults & operator=(
  ParticipantResults && move_from
)

กำหนดออบเจ็กต์ ParticipantResults นี้โดยย้ายออบเจ็กต์อื่นเข้าไป