gpg:: ParticipantResults
#include <participant_results.h>
מבנה נתונים שמכיל נתונים על התוצאות לכל משתתף עבור TurnBasedMatch
.
סיכום
בונים והורסים |
|
---|---|
ParticipantResults()
|
|
ParticipantResults(std::shared_ptr< const ParticipantResultsImpl > impl)
|
|
ParticipantResults(const ParticipantResults & copy_from)
יוצר עותק של אובייקט
ParticipantResults קיים. |
|
ParticipantResults(ParticipantResults && move_from)
העברת אובייקט
ParticipantResults קיים. |
תפקידים ציבוריים |
|
---|---|
HasResultsForParticipant(const std::string & participant_id) const
|
bool
הפונקציה מחזירה את הערך True אם לאובייקט
ParticipantResults יש תוצאה ל-MultiplayerParticipant הנתון. |
MatchResultForParticipant(const std::string & participant_id) const
|
הפונקציה מחזירה את הערך
MatchResult עבור המשתתף שצוין בתוך TurnBasedMatch . |
PlaceForParticipant(const std::string & participant_id) const
|
uint32_t
מחזירה את המיקום של המשתתף שצוין בתוך
TurnBasedMatch . |
Valid() const
|
bool
הפונקציה מחזירה את הערך True אם האובייקט
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
הפונקציה מחזירה את הערך True אם לאובייקט ParticipantResults
יש תוצאה ל-MultiplayerParticipant
הנתון.
כדי שיהיה אפשר להשתמש בפונקציה הזו, הערך תקין חייב להחזיר true.
MatchResultForParticipant
MatchResult MatchResultForParticipant( const std::string & participant_id ) const
הפונקציה מחזירה את הערך MatchResult
עבור המשתתף שצוין בתוך TurnBasedMatch
.
לתשומת ליבכם: יכול להיות שלא לכל המשתתפים תהיה Match result. אם HasResultsForParticipant לא תחזיר TRUE, הפונקציה הזו תחזיר 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 לא מחזיר True, הפונקציה הזו תחזיר 0 לשחקן שעדיין לא מדורג. כדי שיהיה אפשר להשתמש בפונקציה הזו, הערך תקין חייב להחזיר true.
נתונים תקפים
bool Valid() const
הפונקציה מחזירה את הערך True אם האובייקט ParticipantResults
מאוכלס בנתונים.
הערך חייב להיות true כדי שניתן יהיה להשתמש בפונקציות geter (PlaceForParticipant
, MatchResultForParticipant
וכו'...) באובייקט ParticipantResults
הזה.
WithResult
ParticipantResults WithResult( const std::string & participant_id, uint32_t placing, MatchResult result ) const
הפונקציה יוצרת ParticipantResults
חדש שמכיל את כל התוצאות הקיימות ואת נתוני התוצאות הנוספים שמועברים לפונקציה הזו.
שימו לב שאפשר להגדיר תוצאה לכל משתתף רק פעם אחת. ניסיון להגדיר יותר מתוצאה אחת יוביל לשגיאה, והמערכת תשאיר את ParticipantResults
ללא שינוי. כדי שיהיה אפשר להשתמש בפונקציה הזו, הערך תקין חייב להחזיר true.
פרטים | |||||||
---|---|---|---|---|---|---|---|
פרמטרים |
|
אופרטור=
ParticipantResults & operator=( const ParticipantResults & copy_from )
הפונקציה מקצה את האובייקט ParticipantResults
הזה מאובייקט אחר.
אופרטור=
ParticipantResults & operator=( ParticipantResults && move_from )
הפונקציה הזאת מקצה את האובייקט ParticipantResults
על ידי העברה של אובייקט אחר אליו.