gpg::MultiplayerParticipant
#include <multiplayer_participant.h>
一个包含有关多人游戏匹配中的参与者数据的数据结构。
摘要
构造函数和析构函数 |
|
---|---|
MultiplayerParticipant()
|
|
MultiplayerParticipant(std::shared_ptr< const MultiplayerParticipantImpl > impl)
|
|
MultiplayerParticipant(const MultiplayerParticipant & copy_from)
创建一个现有
MultiplayerParticipant 的副本。 |
|
MultiplayerParticipant(MultiplayerParticipant && move_from)
移动一个现有
MultiplayerParticipant 。 |
|
~MultiplayerParticipant()
|
公共函数 |
|
---|---|
AvatarUrl(ImageResolution resolution) const
|
const std::string &
返回此
MultiplayerParticipant 头像图片所在的 URL。 |
DisplayName() const
|
const std::string &
此
MultiplayerParticipant 的显示名称。 |
HasMatchResult() const
|
bool
此参与者是否在此匹配中有结果。
|
HasPlayer() const
|
bool
是否有 Player 与此
MultiplayerParticipant 关联。 |
Id() const
|
const std::string &
此
MultiplayerParticipant 的 Id 。 |
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
头像图片所在的 URL。
ImageResolution
参数指定返回图像的分辨率。对于分辨率,请指定 ICON 或 HI_RES。Valid 必须返回 true,此函数才能使用。
DisplayName
const std::string & DisplayName() const
此 MultiplayerParticipant
的显示名称。
Valid 必须返回 true,此函数才能使用。
HasMatchResult
bool HasMatchResult() const
此参与者是否在此匹配中有结果。
如果为 false,则 MatchResult 和 MatchRank 不返回有效数据。Valid 必须返回 true,此函数才能使用。
Id
const std::string & Id() const
此 MultiplayerParticipant
的 Id
。
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 )
从指向 MultiplayerParticipantImpl
的 shared_ptr
构造一个 MultiplayerParticipant
。
供 API 内部使用。
MultiplayerParticipant
MultiplayerParticipant( const MultiplayerParticipant & copy_from )
创建一个现有 MultiplayerParticipant
的副本。
MultiplayerParticipant
MultiplayerParticipant( MultiplayerParticipant && move_from )
移动一个现有 MultiplayerParticipant
。
Valid
bool Valid() const
如果此 MultiplayerParticipant
已填充数据,则返回 true。
必须返回 true,此 MultiplayerParticipant
上的 getter 函数(DisplayName
、AvatarUrl
、Id
等)才能使用。
operator=
MultiplayerParticipant & operator=( const MultiplayerParticipant & copy_from )
通过从另一个复制来为此 MultiplayerParticipant
赋值。
operator=
MultiplayerParticipant & operator=( MultiplayerParticipant && move_from )
通过将另一个 MultiplayerParticipant
移动到此对象来为其赋值。
~MultiplayerParticipant
~MultiplayerParticipant()