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

يُرجى العلم أنّه قد لا تظهر نتيجة MatchResult لدى بعض المشاركين، فإذا لم تكن قيمة HasResultsForParticipant صحيحة، ستعرض هذه الدالة MatchResult::NONE. يجب أن تعرض الحالة صالحة القيمة true لتكون هذه الدالة قابلة للاستخدام.

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 للاعب لم يتم ترتيبه بعد. يجب أن تعرض الحالة صالحة القيمة true لتكون هذه الدالة قابلة للاستخدام.

صالحة

bool Valid() const 

تعرِض القيمة "صحيح" إذا تمت تعبئة عنصر ParticipantResults هذا بالبيانات.

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

WithResult

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

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

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

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

r=or

ParticipantResults & operator=(
  const ParticipantResults & copy_from
)

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

r=or

ParticipantResults & operator=(
  ParticipantResults && move_from
)

تحدّد هذه السمة كائن ParticipantResults هذا من خلال نقل عنصر آخر إليه.