gpg::ParticipantResults

#include <participant_results.h>

TurnBasedMatch의 참가자별 결과에 관한 데이터가 포함된 데이터 구조입니다.

요약

생성자 및 소멸자

ParticipantResults()
ParticipantResults(std::shared_ptr< const ParticipantResultsImpl > impl)
shared_ptr에서 ParticipantResultsImplParticipantResults 객체를 구성합니다.
ParticipantResults(const ParticipantResults & copy_from)
기존 ParticipantResults 객체의 사본을 생성합니다.
ParticipantResults(ParticipantResults && move_from)
기존 ParticipantResults 객체를 이동합니다.

공개 함수

HasResultsForParticipant(const std::string & participant_id) const
bool
ParticipantResults 객체에 지정된 MultiplayerParticipant의 결과가 있으면 true를 반환합니다.
MatchResultForParticipant(const std::string & participant_id) const
TurnBasedMatch 내에서 지정된 참가자의 MatchResult를 반환합니다.
PlaceForParticipant(const std::string & participant_id) const
uint32_t
TurnBasedMatch 내에 지정된 참가자의 배치를 반환합니다.
Valid() const
bool
ParticipantResults 객체에 데이터가 채워져 있으면 true를 반환합니다.
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를 반환합니다.

이 함수를 사용하려면 Valid가 true를 반환해야 합니다.

MatchResultForParticipant

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

TurnBasedMatch 내에서 지정된 참가자의 MatchResult를 반환합니다.

일부 참가자에게는 MatchResult가 없을 수도 있습니다. HasResultsForParticipant가 true를 반환하지 않는 경우 이 함수는 MatchResult::NONE을 반환합니다. 이 함수를 사용하려면 Valid가 true를 반환해야 합니다.

ParticipantResults

 ParticipantResults()

ParticipantResults

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

shared_ptr에서 ParticipantResultsImplParticipantResults 객체를 구성합니다.

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을 반환합니다. 이 함수를 사용하려면 Valid가 true를 반환해야 합니다.

유효

bool Valid() const 

ParticipantResults 객체에 데이터가 채워져 있으면 true를 반환합니다.

ParticipantResults 객체의 getter 함수 (PlaceForParticipant, MatchResultForParticipant 등)를 사용하려면 true여야 합니다.

WithResult

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

모든 기존 결과와 이 함수에 전달된 추가 결과 데이터를 포함하는 새 ParticipantResults를 만듭니다.

결과는 참가자당 한 번만 설정할 수 있습니다. 결과를 두 개 이상 설정하려고 하면 오류가 로깅되고 ParticipantResults가 수정되지 않은 상태로 유지됩니다. 이 함수를 사용하려면 Valid가 true를 반환해야 합니다.

세부정보
매개변수
participant_id
결과를 추가할 MultiplayerParticipant입니다.
placing
경기에서 참가자의 순위입니다.
result
경기 내 참가자의 MatchResult입니다.

operator=

ParticipantResults & operator=(
  const ParticipantResults & copy_from
)

다른 항목에서 이 ParticipantResults 객체를 할당합니다.

operator=

ParticipantResults & operator=(
  ParticipantResults && move_from
)

다른 객체를 이동하여 이 ParticipantResults 객체를 할당합니다.