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 ที่กำหนด

ฟังก์ชันใช้งานได้จะต้องคืนค่า "จริง" เพื่อให้ฟังก์ชันนี้ใช้งานได้

MatchResultForParticipant

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

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

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

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 สำหรับผู้เล่นที่ยังไม่ได้จัดอันดับ ฟังก์ชันใช้งานได้จะต้องคืนค่า "จริง" เพื่อให้ฟังก์ชันนี้ใช้งานได้

ใช้งานได้

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 ฟังก์ชันใช้งานได้จะต้องคืนค่า "จริง" เพื่อให้ฟังก์ชันนี้ใช้งานได้

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

โอเปอเรเตอร์=

ParticipantResults & operator=(
  const ParticipantResults & copy_from
)

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

โอเปอเรเตอร์=

ParticipantResults & operator=(
  ParticipantResults && move_from
)

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