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 的头像图片所在的网址。 |
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 关联的播放器。 |
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,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 )
构造从 shared_ptr
到 MultiplayerParticipantImpl
的 MultiplayerParticipant
。
供 API 内部使用。
MultiplayerParticipant
MultiplayerParticipant( const MultiplayerParticipant & copy_from )
创建现有 MultiplayerParticipant
的副本。
MultiplayerParticipant
MultiplayerParticipant( MultiplayerParticipant && move_from )
移动现有的 MultiplayerParticipant
。
有效
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()