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 回だけ設定できます。複数の結果を設定しようとすると、エラーがログに記録され、ParticipantResults は変更されないままになります。この関数を使用できるようにするには、Valid が true を返す必要があります。

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

演算子=

ParticipantResults & operator=(
  const ParticipantResults & copy_from
)

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

演算子=

ParticipantResults & operator=(
  ParticipantResults && move_from
)

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