Skip to content

Commit 9caa082

Browse files
kristijan-ujevicMikkel Sørensen
authored andcommitted
Implement GetProgressionTier method
1 parent d7cc9f8 commit 9caa082

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

Runtime/Client/LootLockerEndPoints.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ public class LootLockerEndPoints
227227
public static EndPointClass getAllProgressions = new EndPointClass("progressions", LootLockerHTTPMethod.GET);
228228
public static EndPointClass getSingleProgression = new EndPointClass("progressions/{0}", LootLockerHTTPMethod.GET);
229229
public static EndPointClass getProgressionTiers = new EndPointClass("progressions/{0}/tiers", LootLockerHTTPMethod.GET);
230+
public static EndPointClass getProgressionTier = new EndPointClass("progressions/{0}/tiers/{1}", LootLockerHTTPMethod.GET);
230231

231232
// Drop Tables
232233
[Header("Drop Tables")]

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3976,6 +3976,25 @@ public static void GetProgressionTiers(string progressionKey, Action<LootLockerP
39763976
{
39773977
GetProgressionTiers(progressionKey, -1, null, onComplete);
39783978
}
3979+
3980+
/// <summary>
3981+
/// Returns a single progression tier for the specified progression.
3982+
/// </summary>
3983+
/// <param name="progressionKey">Progression key</param>
3984+
/// <param name="step">Step of the progression tier that is being fetched</param>
3985+
/// <param name="onComplete">onComplete Action for handling the response of type LootLockerProgressionTierResponse</param>
3986+
public static void GetProgressionTier(string progressionKey, ulong step, Action<LootLockerProgressionTierResponse> onComplete)
3987+
{
3988+
if (!CheckInitialized())
3989+
{
3990+
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerProgressionTierResponse>());
3991+
return;
3992+
}
3993+
3994+
var endpoint = string.Format(LootLockerEndPoints.getProgressionTier.endPoint, progressionKey, step);
3995+
3996+
LootLockerServerRequest.CallAPI(endpoint, LootLockerHTTPMethod.GET, onComplete: (serverResponse) => { LootLockerResponse.Deserialize(onComplete, serverResponse); });
3997+
}
39793998

39803999
#endregion
39814000

Runtime/Game/Requests/ProgressionsRequest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,16 @@ public class LootLockerPaginatedProgressionTiersResponse : LootLockerResponse
173173

174174
public class LootLockerProgressionTier
175175
{
176-
public string id { get; set; }
177176
public ulong step { get; set; }
178177
public ulong points_threshold { get; set; }
179178
public LootLockerRewards rewards { get; set; }
180179
}
181180
}
181+
182+
public class LootLockerProgressionTierResponse : LootLockerResponse
183+
{
184+
public ulong step { get; set; }
185+
public ulong points_threshold { get; set; }
186+
public LootLockerRewards rewards { get; set; }
187+
}
182188
}

0 commit comments

Comments
 (0)