Achievement

public interfaceAchievementimplementsFreezable<Achievement> Parcelable
Known Indirect Subclasses

Data interface for retrieving achievement information.

Nested Class Summary

@interface Achievement.AchievementState Achievement state.
@interface Achievement.AchievementType Achievement type.

Constant Summary

int STATE_HIDDEN Constant returned by getState()indicating a hidden achievement.
int STATE_REVEALED Constant returned by getState()indicating a revealed achievement.
int STATE_UNLOCKED Constant returned by getState()indicating an unlocked achievement.
int TYPE_INCREMENTAL Constant returned by getType()indicating an incremental achievement.
int TYPE_STANDARD Constant returned by getType()indicating a standard achievement.

Inherited Constant Summary

Public Method Summary

abstractString
getAchievementId()
Retrieves the ID of this achievement.
abstract int
getCurrentSteps()
Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for TYPE_INCREMENTALachievement types.
abstractString
getDescription()
Retrieves the description for this achievement.
abstract void
getDescription(CharArrayBuffer dataOut)
Loads the achievement description into the givenCharArrayBuffer.
abstract void
getFormattedCurrentSteps(CharArrayBuffer dataOut)
Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the givenCharArrayBuffer.
abstractString
getFormattedCurrentSteps()
Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for TYPE_INCREMENTALachievement types.
abstract void
getFormattedTotalSteps(CharArrayBuffer dataOut)
Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the givenCharArrayBuffer; only applicable for TYPE_INCREMENTALachievement types.
abstractString
getFormattedTotalSteps()
Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for TYPE_INCREMENTALachievement types.
abstract long
getLastUpdatedTimestamp()
Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated.
abstract void
getName(CharArrayBuffer dataOut)
Loads the achievement name into the givenCharArrayBuffer.
abstractString
getName()
Retrieves the name of this achievement.
abstractPlayer
getPlayer()
Retrieves the player information associated with this achievement.
abstractUri
getRevealedImageUri()
Retrieves a URI that can be used to load the achievement's revealed image icon.
abstract int
getState()
Returns the Achievement.AchievementStateof the achievement.
abstract int
getTotalSteps()
Retrieves the total number of steps necessary to unlock this achievement; only applicable for TYPE_INCREMENTALachievement types.
abstract int
getType()
Returns the Achievement.AchievementTypeof this achievement.
abstractUri
getUnlockedImageUri()
Retrieves a URI that can be used to load the achievement's unlocked image icon.
abstract long
getXpValue()
Retrieves the XP value of this achievement.

Inherited Method Summary

Constants

public static final int STATE_HIDDEN

Constant returned by getState()indicating a hidden achievement.

Constant Value:2

public static final int STATE_REVEALED

Constant returned by getState()indicating a revealed achievement.

Constant Value:1

public static final int STATE_UNLOCKED

Constant returned by getState()indicating an unlocked achievement.

Constant Value:0

public static final int TYPE_INCREMENTAL

Constant returned by getType()indicating an incremental achievement.

Constant Value:1

public static final int TYPE_STANDARD

Constant returned by getType()indicating a standard achievement.

Constant Value:0

Public Methods

public abstractStringgetAchievementId()

Retrieves the ID of this achievement.

Returns
  • The achievement ID.

public abstract intgetCurrentSteps()

Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for TYPE_INCREMENTALachievement types.

Returns
  • The number of steps this user has gone toward unlocking this achievement.

public abstractStringgetDescription()

Retrieves the description for this achievement.

Returns
  • The achievement description.

public abstract voidgetDescription(CharArrayBuffer dataOut)

Loads the achievement description into the givenCharArrayBuffer.

Parameters
dataOut The buffer to load the data into.

public abstract voidgetFormattedCurrentSteps(CharArrayBuffer dataOut)

Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the givenCharArrayBuffer.

Parameters
dataOut The buffer to load the data into.

public abstractStringgetFormattedCurrentSteps()

Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for TYPE_INCREMENTALachievement types.

Returns
  • The formatted number of steps this user has gone toward unlocking this achievement ornullif this information is unavailable.

public abstract voidgetFormattedTotalSteps(CharArrayBuffer dataOut)

Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the givenCharArrayBuffer; only applicable for TYPE_INCREMENTALachievement types.

Parameters
dataOut The buffer to load the data into.

public abstractStringgetFormattedTotalSteps()

Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for TYPE_INCREMENTALachievement types.

Returns
  • The total number of steps necessary to unlock this achievement or nullif this information is unavailable.

public abstract longgetLastUpdatedTimestamp()

Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated. If the achievement has never been updated, this will return -1.

Returns
  • Timestamp at which this achievement was last updated.

public abstract voidgetName(CharArrayBuffer dataOut)

Loads the achievement name into the givenCharArrayBuffer.

Parameters
dataOut The buffer to load the data into.

public abstractStringgetName()

Retrieves the name of this achievement.

Returns
  • The achievement name.

public abstractPlayer getPlayer()

Retrieves the player information associated with this achievement.

Note that this object is a volatile representation, so it is not safe to cache the output of this directly. Instead, cache the result ofFreezable.freeze().

Returns
  • The player associated with this achievement.

public abstractUrigetRevealedImageUri()

Retrieves a URI that can be used to load the achievement's revealed image icon. Returns null if the achievement has no revealed image.

To retrieve the Image from theUri,use ImageManager.

Returns
  • The image URI for the achievement's revealed image icon, or null if the achievement has no revealed image.

public abstract intgetState()

Returns the Achievement.AchievementStateof the achievement.

public abstract intgetTotalSteps()

Retrieves the total number of steps necessary to unlock this achievement; only applicable for TYPE_INCREMENTALachievement types.

Returns
  • The total number of steps necessary to unlock this achievement.

public abstract intgetType()

Returns the Achievement.AchievementTypeof this achievement.

public abstractUrigetUnlockedImageUri()

Retrieves a URI that can be used to load the achievement's unlocked image icon. Returns null if the achievement has no unlocked image.

To retrieve the Image from theUri,use ImageManager.

Returns
  • The image URI for the achievement's unlocked image icon, or null if the achievement has no unlocked image.

public abstract longgetXpValue()

Retrieves the XP value of this achievement.

Returns
  • XP value given to players for unlocking this achievement.