gpg::ParticipantResults

#include <participant_results.h>

TurnBasedMatch の参加者ごとの結果に関するデータを含むデータ構造。

概要

コンストラクタとデストラクタ

ParticipantResults()
ParticipantResults(std::shared_ptr< const ParticipantResultsImpl > impl)
shared_ptr から ParticipantResultsImpl への ParticipantResults オブジェクトを構築します。
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 から ParticipantResultsImpl への ParticipantResults オブジェクトを構築します。

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 オブジェクトのゲッター関数(PlaceForParticipantMatchResultForParticipant など)を使用できるようにするには、true でなければなりません。

WithResult

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

既存のすべての結果と、この関数に渡される追加の結果データを含む新しい ParticipantResults を作成します。

結果は参加者 1 人につき 1 回のみ設定できます。複数の結果を設定しようとすると、エラーがログに記録され、ParticipantResults は変更されないままになります。この関数を使用するには、Valid が true を返す必要があります。

詳細
パラメータ
participant_id
結果を追加する MultiplayerParticipant
placing
試合内の参加者の順位。
result
試合の参加者の MatchResult

operator=

ParticipantResults & operator=(
  const ParticipantResults & copy_from
)

この ParticipantResults オブジェクトを別のオブジェクトから割り当てます。

operator=

ParticipantResults & operator=(
  ParticipantResults && move_from
)

この ParticipantResults オブジェクトを、別のオブジェクトを移動して割り当てます。