Skip to content

Commit a61dffa

Browse files
Mikkel Sørensenkirre-bylund
authored andcommitted
Reduced code by reusing types
1 parent b1e279d commit a61dffa

File tree

2 files changed

+9
-45
lines changed

2 files changed

+9
-45
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5618,11 +5618,12 @@ public static void ListEntitlements(Action<LootLockerEntitlementHistoryResponse>
56185618
}
56195619

56205620
/// <summary>
5621-
/// Get a single entitlement
5621+
/// Get a single entitlement, with information about its current status
5622+
/// Use this to retrieve information on entitlements the player has received regardless of their origin (for example as an effect of progression, purchases, or leaderboard rewards)
56225623
/// </summary>
56235624
/// <param name="entitlementId"></param>
56245625
/// <param name="onComplete"></param>
5625-
public static void GetSingleEntitlement(string entitlementId, Action<LootLockerSingleEntitlementResponse> onComplete)
5626+
public static void GetEntitlement(string entitlementId, Action<LootLockerSingleEntitlementResponse> onComplete)
56265627
{
56275628
if (!CheckInitialized())
56285629
{

Runtime/Game/Requests/EntitlementRequests.cs

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -195,64 +195,27 @@ public class LootLockerSingleEntitlementResponse : LootLockerResponse
195195
/// <summary>
196196
/// When this entitlement listing was created
197197
/// </summary>
198-
public string created_at { get; set; }
198+
public string Created_at { get; set; }
199199
/// <summary>
200200
/// The type this entitlement is example is a one time purchase
201201
/// </summary>
202-
public string type { get; set; }
202+
public LootLockerEntitlementHistoryListingType Type { get; set; } = LootLockerEntitlementHistoryListingType.Undefined;
203203
/// <summary>
204204
/// The status of the entitlement, (pending, active, canceled)
205205
/// </summary>
206-
public string status { get; set; }
206+
public LootLockerEntitlementHistoryListingStatus Status { get; set; } = LootLockerEntitlementHistoryListingStatus.None;
207207
/// <summary>
208208
/// The store connected to the entitlement
209209
/// </summary>
210-
public string store { get; set; }
210+
public LootLockerEntitlementHistoryListingStore Store { get; set; } = LootLockerEntitlementHistoryListingStore.None;
211211
/// <summary>
212212
/// An array of the items connected to this entitlement
213213
/// </summary>
214-
public LootLockerSingleEntitlementItem[] items { get; set; }
214+
public LootLockerEntitlementHistoryItem[] Items { get; set; }
215215
/// <summary>
216216
/// Metadata of the entitlement
217217
/// </summary>
218-
public MetadataEntry[] metadata { get; set; }
219-
220-
}
218+
public LootLockerEntitlementHistoryMetadata[] Metadata { get; set; }
221219

222-
public class MetadataEntry
223-
{
224-
public string key { get; set; }
225-
public string value { get; set; }
226-
}
227-
/// <summary>
228-
/// Details of the entitlement item
229-
/// </summary>
230-
public class LootLockerSingleEntitlementItem
231-
{
232-
/// <summary>
233-
/// When this entitlement item listing was created
234-
/// </summary>
235-
public string created_at { get; set; }
236-
/// <summary>
237-
/// What type of reward (currency, asset, progression points, progression reset, etc.)
238-
/// </summary>
239-
public string reward_kind { get; set; }
240-
/// <summary>
241-
/// The id of the entitlement item
242-
/// </summary>
243-
public string id { get; set; }
244-
/// <summary>
245-
/// The reward id of the entitlement item
246-
/// </summary>
247-
public string reward_id { get; set; }
248-
/// <summary>
249-
/// The id of the catalog which contains the item
250-
/// </summary>
251-
public string catalog_id { get; set; }
252-
/// <summary>
253-
/// If the item is purchasable
254-
/// </summary>
255-
public bool purchasable { get; set; }
256220
}
257-
258221
}

0 commit comments

Comments
 (0)