com.annahid.libs.artenus.unified
GameServices
Interface for classes that provide game services, such as achievements and leaderboards. An
implementation of unified services should provide an implementation of this interface if it
supports game services.
See Also:
public interface GameServices
Method Summary
Modifier and Type | Method and Description |
---|---|
public void | ensureAchievements(List<String> achievementIds) Ensures that all the achievements in a given list are unlocked. |
public void | incrementAchievement(String achievementId, int amount, int max) Increments a progressive achievement. |
public boolean | isAchievementUnlocked(String achievementId) Indicates whether an achievement is unlocked (achieved). |
public void | revealAchievement(String achievementId) Reveals a hidden achievement. |
public void | showAchievements() Displays an achievements dialog. |
public void | showLeaderboard() Displays all leaderboards associated with this game. |
public void | showLeaderboard(String lbId) Displays the desired leaderboard. |
public void | submitScore(String lbId, int score, Object payload) Submits a score to a given leaderboard. |
public boolean | supportsAchievements() Indicates whether this GameServices supports achievements. |
public void | unlockAchievement(String achievementId) Unlocks an achievement and considers it as achieved. |
Method Detail
ensureAchievements | ||
---|---|---|
public void ensureAchievements( List<String> achievementIds ) Ensures that all the achievements in a given list are unlocked. This method will unlock any
achievement in the list that is not unlocked. For other items, it has no effect. Parameters:
|
incrementAchievement | ||||||
---|---|---|---|---|---|---|
public void incrementAchievement( String achievementId, int amount, int max ) Increments a progressive achievement. Once the progress is complete,
the achievement will be unlocked. Parameters:
|
isAchievementUnlocked | ||
---|---|---|
public boolean isAchievementUnlocked( String achievementId ) Indicates whether an achievement is unlocked (achieved). Depending on the app-store, there
may be a loading delay before this method returns up-to-date results for all achievements. Parameters:
Returns:
true if the achievement is unlocked, false otherwise |
revealAchievement | ||
---|---|---|
public void revealAchievement( String achievementId ) Reveals a hidden achievement. This is different from unlocking, as it is still going to be
displayed as not achieved. Some providers do not support this function, in which case this
method will have no effect. Parameters:
|
showAchievements |
---|
public void showAchievements() Displays an achievements dialog. |
showLeaderboard |
---|
public void showLeaderboard() Displays all leaderboards associated with this game. |
showLeaderboard | ||
---|---|---|
public void showLeaderboard( String lbId ) Displays the desired leaderboard. Parameters:
|
submitScore | ||||||
---|---|---|---|---|---|---|
public void submitScore( String lbId, int score, Object payload ) Submits a score to a given leaderboard. Parameters:
|
supportsAchievements |
---|
public boolean supportsAchievements() Indicates whether this GameServices supports achievements. Returns:
true if achievements are supported, and false otherwise |
unlockAchievement | ||
---|---|---|
public void unlockAchievement( String achievementId ) Unlocks an achievement and considers it as achieved. Parameters:
|