Class Trophies
Game Jolt allows you to add trophies to your games!
Trophies come in four materials: bronze, silver, gold, and platinum. This is to reflect how difficult it is to achieve a trophy. A bronze trophy should be easy to achieve, whereas a platinum trophy should be very hard to achieve.
On Game Jolt, trophies are always listed in order from easiest to most difficult to achieve. You can also tag trophies on the site as "secret". A sercet trophy's image and description is not visible until a gamer has achieved it.Inherited Members
Namespace: GameJolt.Services
Assembly: GameJolt.dll
Syntax
public sealed class Trophies : Service
Methods
| Improve this Doc View SourceFetch(Credentials, Nullable<Boolean>, Int32[], Action<Response<Trophy[]>>)
Returns one trophy or multiple trophies, depending on the parameters passed in.
Declaration
public void Fetch(Credentials credentials, bool? achieved = default(bool? ), int[] ids = null, Action<Response<Trophy[]>> callback = null)
Parameters
Type | Name | Description |
---|---|---|
Credentials | credentials | The user's credentials for which the trophies should be fetched. |
System.Nullable<System.Boolean> | achieved | Pass in true to return only the achieved trophies for a user. Pass in false to return only trophies the user hasn't achieved. Leave blank (null) to retrieve all trophies. |
System.Int32[] | ids | You may pass an array of trophy IDs here if you want to return a subset of all the trophies.
Passing a trophy_id will ignore the |
System.Action<Response<Trophy[]>> | callback | Action that is called on completion or error. |
FetchAsync(Credentials, Nullable<Boolean>, Int32[])
Returns one trophy or multiple trophies, depending on the parameters passed in.
Declaration
public Task<Response<Trophy[]>> FetchAsync(Credentials credentials, bool? achieved = default(bool? ), int[] ids = null)
Parameters
Type | Name | Description |
---|---|---|
Credentials | credentials | The user's credentials for which the trophies should be fetched. |
System.Nullable<System.Boolean> | achieved | Pass in true to return only the achieved trophies for a user. Pass in false to return only trophies the user hasn't achieved. Leave blank (null) to retrieve all trophies. |
System.Int32[] | ids | You may pass an array of trophy IDs here if you want to return a subset of all the trophies.
Passing a trophy_id will ignore the |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Response<Trophy[]>> |
RemoveAchieved(Credentials, Int32, Action<Response>)
Remove a previously achieved trophy for a particular user.
Declaration
public void RemoveAchieved(Credentials credentials, int id, Action<Response> callback = null)
Parameters
Type | Name | Description |
---|---|---|
Credentials | credentials | The user's credentials for which the trophy should be removed. |
System.Int32 | id | The id of the trophy to remove. |
System.Action<Response> | callback | Action that is called on completion or error. |
RemoveAchievedAsync(Credentials, Int32)
Remove a previously achieved trophy for a particular user.
Declaration
public Task<Response> RemoveAchievedAsync(Credentials credentials, int id)
Parameters
Type | Name | Description |
---|---|---|
Credentials | credentials | The user's credentials for which the trophy should be removed. |
System.Int32 | id | The id of the trophy to remove. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Response> |
SetAchieved(Credentials, Int32, Action<Response>)
Sets a trophy as achieved for a particular user.
Declaration
public void SetAchieved(Credentials credentials, int id, Action<Response> callback = null)
Parameters
Type | Name | Description |
---|---|---|
Credentials | credentials | The user's credentials for which the trophy should be unlocked. |
System.Int32 | id | The id of the trophy to unlock. |
System.Action<Response> | callback | Action that is called on completion or error. |
SetAchievedAsync(Credentials, Int32)
Sets a trophy as achieved for a particular user.
Declaration
public Task<Response> SetAchievedAsync(Credentials credentials, int id)
Parameters
Type | Name | Description |
---|---|---|
Credentials | credentials | The user's credentials for which the trophy should be unlocked. |
System.Int32 | id | The id of the trophy to unlock. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Response> |