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
与此 MultiplayerParticipant 关联的 Player
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 关联的 Player

ValidHasPlayer 都必须返回 true,该函数才可用。

状态

ParticipantStatus Status() const 

MultiplayerParticipant 相对于匹配的状态。

Valid 必须返回 true,此函数才可用。

有效

bool Valid() const 

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

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

运算符=

MultiplayerParticipant & operator=(
  const MultiplayerParticipant & copy_from
)

通过从其他实例复制来分配此MultiplayerParticipant

运算符=

MultiplayerParticipant & operator=(
  MultiplayerParticipant && move_from
)

通过将另一个对象移入MultiplayerParticipant来分配此对象。

~多人游戏参与者

 ~MultiplayerParticipant()