gpg::Achievement

#include <achievement.h>

A single data structure which allows you to access data about the status of a specific achievement.

Summary

Data comprise two types: user-specific (e.g., whether the user has unlocked the achievement, etc.) and global (e.g., achievement name).

Constructors and Destructors

Achievement()
Achievement(std::shared_ptr< const AchievementImpl > impl)
Constructs an Achievement from a shared_ptr to an AchievementImpl.Intended for internal use by the API.
Achievement(const Achievement & copy_from)
Creates a copy of an existing Achievement.
Achievement(Achievement && move_from)
Moves an existing Achievement.
~Achievement()

Public functions

CurrentSteps() const
uint32_t
Returns the number of steps the player has taken toward unlocking an incremental achievement.
Description() const
const std::string &
Returns a concise description of your achievement.
Id() const
const std::string &
Returns the unique string that the Google Play Developer Console generated beforehand.
LastModified() const Deprecated. Prefer LastModifiedTime.
LastModifiedTime() const
Returns time at which the entry was last modified (expressed as milliseconds since the Unix epoch).
Name() const
const std::string &
Returns the short name of the achievement.
RevealedIconUrl() const
const std::string &
Returns the URL leading to the image of the revealed icon for this Achievement.
State() const
Returns the achievement state: HIDDEN, REVEALED, or UNLOCKED.
TotalSteps() const
uint32_t
Returns the number of steps required, in total, for the player to unlock a given incremental achievement.
Type() const
Returns the achievement type: INCREMENTAL or STANDARD.
UnlockedIconUrl() const
const std::string &
Returns the URL leading to the image of the unlocked icon for this Achievement.
Valid() const
bool
Returns true when the returned achievement is populated with data and is accompanied by a successful response status; false for an unpopulated user-created achievement or for a populated one accompanied by an unsuccessful response status.
XP() const
uint64_t
The number of experience points awarded by this achievement.
operator=(const Achievement & copy_from)
Assigns this Achievement by copying from another one.
operator=(Achievement && move_from)
Assigns this Achievement by moving another one into it.

Public functions

Achievement

 Achievement()

Achievement

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

Constructs an Achievement from a shared_ptr to an AchievementImpl.Intended for internal use by the API.

Achievement

 Achievement(
  const Achievement & copy_from
)

Creates a copy of an existing Achievement.

Achievement

 Achievement(
  Achievement && move_from
)

Moves an existing Achievement.

CurrentSteps

uint32_t CurrentSteps() const 

Returns the number of steps the player has taken toward unlocking an incremental achievement.

It can only be called when Achievement::Valid() returns true.

Description

const std::string & Description() const 

Returns a concise description of your achievement.

Usually tells player how to earn the achievement. Up to 500 characters. It can only be called when Achievement::Valid() returns true.

Id

const std::string & Id() const 

Returns the unique string that the Google Play Developer Console generated beforehand.

Use it to refer to an achievement in your game client. It can only be called when Achievement::Valid() returns true.

LastModified

Timestamp LastModified() const 

Deprecated. Prefer LastModifiedTime.

LastModifiedTime

Timestamp LastModifiedTime() const 

Returns time at which the entry was last modified (expressed as milliseconds since the Unix epoch).

It can only be called when Achievement::Valid() returns true.

Name

const std::string & Name() const 

Returns the short name of the achievement.

Up to 100 characters. It can only be called when Achievement::Valid() returns true.

RevealedIconUrl

const std::string & RevealedIconUrl() const 

Returns the URL leading to the image of the revealed icon for this Achievement.

This icon is intended to be shown when the Achievement has been revealed, but not yet unlocked. This function can only be called when Achievement::Valid() returns true.

State

AchievementState State() const 

Returns the achievement state: HIDDEN, REVEALED, or UNLOCKED.

It can only be called when Achievement::Valid() returns true. More information is available here.

TotalSteps

uint32_t TotalSteps() const 

Returns the number of steps required, in total, for the player to unlock a given incremental achievement.

It can only be called when Achievement::Valid() returns true.

Type

AchievementType Type() const 

Returns the achievement type: INCREMENTAL or STANDARD.

It can only be called when Achievement::Valid() returns true. More information is available here.

UnlockedIconUrl

const std::string & UnlockedIconUrl() const 

Returns the URL leading to the image of the unlocked icon for this Achievement.

This icon is intended to be shown when the Achievement has been unlocked (and hence also revealed). This function can only be called when Achievement::Valid() returns true.

Valid

bool Valid() const 

Returns true when the returned achievement is populated with data and is accompanied by a successful response status; false for an unpopulated user-created achievement or for a populated one accompanied by an unsuccessful response status.

It must be true for the getter functions on this achievement (id, Name, Description, etc.) to be usable.

XP

uint64_t XP() const 

The number of experience points awarded by this achievement.

It can only be called when Achievement::Valid() returns true.

operator=

Achievement & operator=(
  const Achievement & copy_from
)

Assigns this Achievement by copying from another one.

operator=

Achievement & operator=(
  Achievement && move_from
)

Assigns this Achievement by moving another one into it.

~Achievement

 ~Achievement()

傳送您對下列選項的寶貴意見...

這個網頁
Play Games Services for C++
Play Games Services for C++