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
تعرض القيمة 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 

تعرض القيمة "صحيح" إذا كان كائن 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.

مخصص للاستخدام الداخلي من خلال واجهة برمجة التطبيقات.

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 

تعرض القيمة true إذا تمت تعبئة كائن ParticipantResults ببيانات.

يجب أن تكون القيمة صحيحة حتى تصبح دوال getter (PlaceForParticipant وMatchResultForParticipant وما إلى ذلك...) في كائن ParticipantResults هذا قابلة للاستخدام.

WithResult

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

تنشئ ParticipantResults جديدة تحتوي على جميع النتائج الحالية وبيانات النتائج الإضافية التي يتم تمريرها إلى هذه الدالة.

لاحظ أنه لا يمكن تحديد النتيجة سوى مرة واحدة لكل مشارك. ستؤدي محاولة ضبط أكثر من نتيجة واحدة إلى تسجيل خطأ وترك ParticipantResults بدون تعديل. صالحة يجب أن تعرض القيمة "صحيح" لهذه الدالة لتكون قابلة للاستخدام.

التفاصيل
المعلمات
participant_id
تمثّل هذه السمة MultiplayerParticipant المطلوب إضافة نتيجة إليها.
placing
ترتيب المشارك في المباراة.
result
تمثّل هذه السمة MatchResult للمشارك في المباراة.

operator=

ParticipantResults & operator=(
  const ParticipantResults & copy_from
)

يعيّن كائن ParticipantResults هذا من عنصر آخر.

operator=

ParticipantResults & operator=(
  ParticipantResults && move_from
)

يعيّن كائن ParticipantResults هذا من خلال نقل عنصر آخر إليه.