gpg::Achievement

#include <achievement.h>

单一数据结构,可用于访问特定成就的状态数据。

摘要

数据包括两类:特定于用户(例如用户是否解锁成就等)和全局数据(例如成就名称)。

构造函数和析构函数

Achievement()
Achievement(std::shared_ptr< const AchievementImpl > impl)
构造从 shared_ptrAchievementImplAchievement,供 API 内部使用。
Achievement(const Achievement & copy_from)
创建现有成就的副本。
Achievement(Achievement && move_from)
移动现有的成就
~Achievement()

公共函数

CurrentSteps() const
uint32_t
返回玩家解锁增量成就所经过的步骤。
Description() const
const std::string &
返回成就的简要说明。
Id() const
const std::string &
返回 Google Play Developer Console 事先生成的唯一字符串。
LastModified() const <ph type="x-smartling-placeholder"></ph> 已弃用。首选 LastModifiedTime。
LastModifiedTime() const
返回上次修改条目的时间(以自 Unix 纪元以来的毫秒数表示)。
Name() const
const std::string &
返回成就的简称。
RevealedIconUrl() const
const std::string &
返回指向此成就的已显图标图片的网址。
State() const
返回成就状态:HIDDENREVEALEDUNLOCKED
TotalSteps() const
uint32_t
返回玩家解锁指定增量成就所需的总步骤数。
Type() const
返回成就类型:INCREMENTALSTANDARD
UnlockedIconUrl() const
const std::string &
返回指向此成就的已解锁图标图片的网址。
Valid() const
bool
如果返回的成就中填充了数据并同时显示成功响应状态,则返回 true;false。
XP() const
uint64_t
该成就所授予的经验值数量。
operator=(const Achievement & copy_from)
通过复制其他成就来分配此成就
operator=(Achievement && move_from)
只需将另一项成就移入该成就中,即可分配该成就。

公共函数

成就

 Achievement()

成就

 Achievement(
  std::shared_ptr< const AchievementImpl > impl
)

构造从 shared_ptrAchievementImplAchievement,供 API 内部使用。

成就

 Achievement(
  const Achievement & copy_from
)

创建现有成就的副本。

成就

 Achievement(
  Achievement && move_from
)

移动现有的成就

CurrentSteps

uint32_t CurrentSteps() const 

返回玩家解锁增量成就所经过的步骤。

只有当 Achievement::Valid() 返回 true 时,才能调用该函数。

说明

const std::string & Description() const 

返回成就的简要说明。

通常会告知玩家如何获得该成就。不得超过 500 个字符。只有当 Achievement::Valid() 返回 true 时,才能调用该函数。

ID

const std::string & Id() const 

返回 Google Play Developer Console 事先生成的唯一字符串。

可用它来指代游戏客户端中的成就。只有当 Achievement::Valid() 返回 true 时,才能调用该函数。

LastModified

Timestamp LastModified() const 

<ph type="x-smartling-placeholder"></ph> 已弃用。首选 LastModifiedTime。

LastModifiedTime

Timestamp LastModifiedTime() const 

返回上次修改条目的时间(以自 Unix 纪元以来的毫秒数表示)。

只有当 Achievement::Valid() 返回 true 时,才能调用该函数。

名称

const std::string & Name() const 

返回成就的简称。

不能超过 100 个字符。只有当 Achievement::Valid() 返回 true 时,才能调用该函数。

RevealedIconUrl

const std::string & RevealedIconUrl() const 

返回指向此成就的已显图标图片的网址。

此图标应在显示成就但尚未解锁时显示。只有当 Achievement::Valid() 返回 true 时,才能调用此函数。

AchievementState State() const 

返回成就状态:HIDDENREVEALEDUNLOCKED

只有当 Achievement::Valid() 返回 true 时,才能调用该函数。如需了解详情,请点击此处

TotalSteps

uint32_t TotalSteps() const 

返回玩家解锁指定增量成就所需的总步骤数。

只有当 Achievement::Valid() 返回 true 时,才能调用该函数。

类型

AchievementType Type() const 

返回成就类型:INCREMENTALSTANDARD

只有当 Achievement::Valid() 返回 true 时,才能调用该函数。如需了解详情,请点击此处

UnlockedIconUrl

const std::string & UnlockedIconUrl() const 

返回指向此成就的已解锁图标图片的网址。

此图标会在成就已解锁(也因此也随之显示)时显示。只有当 Achievement::Valid() 返回 true 时,才能调用此函数。

有效

bool Valid() const 

如果返回的成就中填充了数据并同时显示成功响应状态,则返回 true;false。

此成就(ID、名称、说明等)上的 getter 函数必须设为 true 才可使用。

XP

uint64_t XP() const 

该成就所授予的经验值数量。

只有当 Achievement::Valid() 返回 true 时,才能调用该函数。

operator=

Achievement & operator=(
  const Achievement & copy_from
)

通过复制其他成就来分配此成就

operator=

Achievement & operator=(
  Achievement && move_from
)

只需将另一项成就移入该成就中,即可分配该成就。

~Achievement

 ~Achievement()