public static IAsyncResult GetAll(string gameId, string privateKey, string username, string userToken, TrophyFilter filter, Action <Trophy[]> callback) { return(BeginGetAll(gameId, privateKey, username, userToken, filter, result => callback(EndGetAll(result)))); }
public static IAsyncResult BeginGetAll(string gameId, string privateKey, string username, string userToken, TrophyFilter filter = TrophyFilter.All, AsyncCallback callback = null, object asyncState = null) { var request = TrophyRequestFactory.CreateGetRequest(gameId, privateKey, username, userToken, filter); return(request.Begin(callback, asyncState)); }
public static Trophy[] GetAll(string gameId, string privateKey, string username, string userToken, TrophyFilter filter = TrophyFilter.All) { var request = TrophyRequestFactory.CreateGetRequest(gameId, privateKey, username, userToken, filter); return(request.Process(null)); }
public static JsonRequest <Trophy[], TrophyResult> CreateGetRequest(string gameId, string publicKey, string username, string userToken, TrophyFilter filter) { var request = new JsonRequest <Trophy[], TrophyResult>(gameId, publicKey, Constants.TrophyUrls.GetUrl, RequestParameter.CreateUsername(username), RequestParameter.CreateUserToken(userToken)); switch (filter) { case TrophyFilter.Achieved: { request.Parameters.Add("achieved", true); break; } case TrophyFilter.Unachieved: { request.Parameters.Add("unachieved", false); break; } } return(request); }