gpg::MultiplayerParticipant

#include <multiplayer_participant.h>

一种数据结构,包含多人游戏对局中某位参与者的相关数据。

摘要

构造函数和析构函数

MultiplayerParticipant()
MultiplayerParticipant(std::shared_ptr< const MultiplayerParticipantImpl > impl)
构造从 shared_ptrMultiplayerParticipantImplMultiplayerParticipant
MultiplayerParticipant(const MultiplayerParticipant & copy_from)
创建现有 MultiplayerParticipant 的副本。
MultiplayerParticipant(MultiplayerParticipant && move_from)
移动现有的 MultiplayerParticipant
~MultiplayerParticipant()

公共函数

AvatarUrl(ImageResolution resolution) const
const std::string &
返回此 MultiplayerParticipant 的头像图片所在的网址。
DisplayName() const
const std::string &
MultiplayerParticipant 的显示名。
HasMatchResult() const
bool
此参与者是否有此对局的结果。
HasPlayer() const
bool
某个 Player 是否与此 MultiplayerParticipant 相关联。
Id() const
const std::string &
IsConnectedToRoom() const
bool
此参与者是否已连接到 RealTimeRoom
MatchRank() const
uint32_t
MultiplayerParticipant 在其匹配项中的排名。
MatchResult() const
MultiplayerParticipant 的匹配结果。
Player() const
Status() const
MultiplayerParticipant 相对于匹配的状态。
Valid() const
bool
如果此 MultiplayerParticipant 中填充了数据,则返回 true。
operator=(const MultiplayerParticipant & copy_from)
通过从另一网络MultiplayerParticipant复制来分配此内容。
operator=(MultiplayerParticipant && move_from)
通过将另一个 MultiplayerParticipant 移到该文件夹中指定该元素。

公共函数

AvatarUrl

const std::string & AvatarUrl(
  ImageResolution resolution
) const 

返回此 MultiplayerParticipant 的头像图片所在的网址。

ImageResolution 参数用于指定所返回图片的分辨率。为分辨率指定 ICON 或 HI_RES。Valid 必须返回 true 才可用。

DisplayName

const std::string & DisplayName() const 

MultiplayerParticipant 的显示名。

Valid 必须返回 true 才可用。

HasMatchResult

bool HasMatchResult() const 

此参与者是否有此对局的结果。

如果为 false,MatchResultMatchRank 将不会返回有效数据。Valid 必须返回 true 才可用。

HasPlayer

bool HasPlayer() const 

某个 Player 是否与此 MultiplayerParticipant 相关联。

Valid 必须返回 true 才可用。

ID

const std::string & Id() const 

MultiplayerParticipantId

Id 仅在单个匹配的范围内有效,与 Player::Id() 不同。Valid 必须返回 true 才可用。

IsConnectedToRoom

bool IsConnectedToRoom() const 

此参与者是否已连接到 RealTimeRoom

如果这是TurnBasedMatch的参与者,则始终为 false。

MatchRank

uint32_t MatchRank() const 

MultiplayerParticipant 在其匹配项中的排名。

Valid 必须返回 true 才可用。如果 HasMatchResult() 未返回 true,则此函数返回 0。

MatchResult

gpg::MatchResult MatchResult() const 

MultiplayerParticipant 的匹配结果。

Valid 必须返回 true 才可用。如果 HasMatchResult() 未返回 true,则此函数会返回 MatchResult::None

MultiplayerParticipant

 MultiplayerParticipant()

MultiplayerParticipant

 MultiplayerParticipant(
  std::shared_ptr< const MultiplayerParticipantImpl > impl
)

构造从 shared_ptrMultiplayerParticipantImplMultiplayerParticipant

供 API 内部使用。

MultiplayerParticipant

 MultiplayerParticipant(
  const MultiplayerParticipant & copy_from
)

创建现有 MultiplayerParticipant 的副本。

MultiplayerParticipant

 MultiplayerParticipant(
  MultiplayerParticipant && move_from
)

移动现有的 MultiplayerParticipant

玩家

gpg::Player Player() const 

与此 MultiplayerParticipant 关联的播放器

ValidHasPlayer 都必须返回 true,才能使用此函数。

状态

ParticipantStatus Status() const 

MultiplayerParticipant 相对于匹配的状态。

Valid 必须返回 true 才可用。

有效

bool Valid() const 

如果此 MultiplayerParticipant 中填充了数据,则返回 true。

必须为 true,此 MultiplayerParticipant 上的 getter 函数(DisplayNameAvatarUrlId 等)才可用。

operator=

MultiplayerParticipant & operator=(
  const MultiplayerParticipant & copy_from
)

通过从另一网络MultiplayerParticipant复制来分配此内容。

operator=

MultiplayerParticipant & operator=(
  MultiplayerParticipant && move_from
)

通过将另一个 MultiplayerParticipant 移到该文件夹中指定该元素。

~多人游戏参与者

 ~MultiplayerParticipant()