@@ -255,37 +255,50 @@ public class LootLockerListCatalogsResponse : LootLockerResponse
255
255
}
256
256
257
257
/// <summary>
258
- /// </summary>
258
+ /// </summary>
259
259
public class LootLockerListCatalogPricesResponse : LootLockerResponse
260
260
{
261
261
/// <summary>
262
- /// Details about the catalog that the prices is in
263
- /// </summary>
262
+ /// Details about the catalog that the prices is in
263
+ /// </summary>
264
264
public LootLockerCatalog catalog { get ; set ; }
265
265
266
266
/// <summary>
267
- /// A list of entries available in this catalog
268
- /// </summary>
267
+ /// A list of entries available in this catalog
268
+ /// </summary>
269
269
public LootLockerCatalogEntry [ ] entries { get ; set ; }
270
+
270
271
/// <summary>
271
- /// Lookup map for details about entities of entity type assets
272
- /// </summary>
272
+ /// Lookup map for details about entities of entity type assets
273
+ /// </summary>
273
274
public Dictionary < string /*grouping_key*/ , LootLockerAssetDetails > asset_details { get ; set ; }
275
+
274
276
/// <summary>
275
- /// Lookup map for details about entities of entity type progression_points
276
- /// </summary>
277
- public Dictionary < string /*grouping_key*/ , LootLockerProgressionPointDetails > progression_points_details { get ; set ; }
277
+ /// Lookup map for details about entities of entity type progression_points
278
+ /// </summary>
279
+ public Dictionary < string /*grouping_key*/ , LootLockerProgressionPointDetails > progression_points_details
280
+ {
281
+ get ;
282
+ set ;
283
+ }
284
+
278
285
/// <summary>
279
- /// Lookup map for details about entities of entity type progression_reset
280
- /// </summary>
281
- public Dictionary < string /*grouping_key*/ , LootLockerProgressionResetDetails > progression_resets_details { get ; set ; }
286
+ /// Lookup map for details about entities of entity type progression_reset
287
+ /// </summary>
288
+ public Dictionary < string /*grouping_key*/ , LootLockerProgressionResetDetails > progression_resets_details
289
+ {
290
+ get ;
291
+ set ;
292
+ }
293
+
282
294
/// <summary>
283
- /// Lookup map for details about entities of entity type currency
284
- /// </summary>
295
+ /// Lookup map for details about entities of entity type currency
296
+ /// </summary>
285
297
public Dictionary < string /*grouping_key*/ , LootLockerCurrencyDetails > currency_details { get ; set ; }
298
+
286
299
/// <summary>
287
- /// Pagination data to use for subsequent requests
288
- /// </summary>
300
+ /// Pagination data to use for subsequent requests
301
+ /// </summary>
289
302
public LootLockerCatalogPagination pagination { get ; set ; }
290
303
291
304
public void AppendCatalogItems ( LootLockerListCatalogPricesResponse catalogPrices )
@@ -298,32 +311,33 @@ public void AppendCatalogItems(LootLockerListCatalogPricesResponse catalogPrices
298
311
299
312
foreach ( var assetDetail in catalogPrices . asset_details )
300
313
{
301
- asset_details . Add ( assetDetail . Key , assetDetail . Value ) ;
314
+ asset_details . Add ( assetDetail . Key , assetDetail . Value ) ;
302
315
}
316
+
303
317
foreach ( var progressionPointDetail in catalogPrices . progression_points_details )
304
318
{
305
319
progression_points_details . Add ( progressionPointDetail . Key , progressionPointDetail . Value ) ;
306
320
}
321
+
307
322
foreach ( var progressionResetDetail in catalogPrices . progression_resets_details )
308
323
{
309
324
progression_resets_details . Add ( progressionResetDetail . Key , progressionResetDetail . Value ) ;
310
325
}
326
+
311
327
foreach ( var currencyDetail in catalogPrices . currency_details )
312
328
{
313
329
currency_details . Add ( currencyDetail . Key , currencyDetail . Value ) ;
314
330
}
315
331
}
316
332
317
- public LootLockerListCatalogPricesResponse ( )
318
- {
319
- }
333
+ public LootLockerListCatalogPricesResponse ( ) { }
320
334
321
- /// This is the way that the response actually looks, but we don't want to expose it, hence the conversion
335
+ /// This is the way that the response actually looks, but we don't want to expose it, hence the conversion
322
336
private class LootLockerListCatalogItemsWithArraysResponse : LootLockerResponse
323
337
{
324
338
public LootLockerCatalog catalog { get ; set ; }
325
339
public LootLockerCatalogEntry [ ] entries { get ; set ; }
326
- public LootLockerAssetDetails [ ] asset_details { get ; set ; }
340
+ public LootLockerAssetDetails [ ] assets_details { get ; set ; }
327
341
public LootLockerProgressionPointDetails [ ] progression_points_details { get ; set ; }
328
342
public LootLockerProgressionResetDetails [ ] progression_resets_details { get ; set ; }
329
343
public LootLockerCurrencyDetails [ ] currency_details { get ; set ; }
@@ -332,34 +346,47 @@ private class LootLockerListCatalogItemsWithArraysResponse : LootLockerResponse
332
346
333
347
public LootLockerListCatalogPricesResponse ( LootLockerResponse serverResponse )
334
348
{
335
- LootLockerListCatalogItemsWithArraysResponse parsedResponse = Deserialize < LootLockerListCatalogItemsWithArraysResponse > ( serverResponse ) ;
349
+ LootLockerListCatalogItemsWithArraysResponse parsedResponse =
350
+ Deserialize < LootLockerListCatalogItemsWithArraysResponse > ( serverResponse ) ;
351
+ success = parsedResponse . success ;
352
+ statusCode = parsedResponse . statusCode ;
353
+ text = parsedResponse . text ;
354
+ errorData = parsedResponse . errorData ;
355
+ if ( ! success )
356
+ {
357
+ return ;
358
+ }
359
+
336
360
catalog = parsedResponse . catalog ;
337
361
entries = parsedResponse . entries ;
362
+ pagination = parsedResponse . pagination ;
338
363
339
- if ( parsedResponse . asset_details != null && parsedResponse . asset_details . Length > 0 )
364
+ if ( parsedResponse . assets_details != null && parsedResponse . assets_details . Length > 0 )
340
365
{
341
366
asset_details = new Dictionary < string , LootLockerAssetDetails > ( ) ;
342
- foreach ( var assetDetail in parsedResponse . asset_details )
367
+ foreach ( var assetDetail in parsedResponse . assets_details )
343
368
{
344
- asset_details . Add ( assetDetail . id , assetDetail ) ;
369
+ asset_details [ assetDetail . grouping_key ] = assetDetail ;
345
370
}
346
371
}
347
372
348
- if ( parsedResponse . progression_points_details != null && parsedResponse . progression_points_details . Length > 0 )
373
+ if ( parsedResponse . progression_points_details != null &&
374
+ parsedResponse . progression_points_details . Length > 0 )
349
375
{
350
376
progression_points_details = new Dictionary < string , LootLockerProgressionPointDetails > ( ) ;
351
377
foreach ( var detail in parsedResponse . progression_points_details )
352
378
{
353
- progression_points_details . Add ( detail . id , detail ) ;
379
+ progression_points_details [ detail . grouping_key ] = detail ;
354
380
}
355
381
}
356
382
357
- if ( parsedResponse . progression_resets_details != null && parsedResponse . progression_resets_details . Length > 0 )
383
+ if ( parsedResponse . progression_resets_details != null &&
384
+ parsedResponse . progression_resets_details . Length > 0 )
358
385
{
359
386
progression_resets_details = new Dictionary < string , LootLockerProgressionResetDetails > ( ) ;
360
387
foreach ( var detail in parsedResponse . progression_resets_details )
361
388
{
362
- progression_resets_details . Add ( detail . id , detail ) ;
389
+ progression_resets_details [ detail . grouping_key ] = detail ;
363
390
}
364
391
}
365
392
@@ -368,31 +395,31 @@ public LootLockerListCatalogPricesResponse(LootLockerResponse serverResponse)
368
395
currency_details = new Dictionary < string , LootLockerCurrencyDetails > ( ) ;
369
396
foreach ( var detail in parsedResponse . currency_details )
370
397
{
371
- currency_details . Add ( detail . id , detail ) ;
398
+ currency_details [ detail . grouping_key ] = detail ;
372
399
}
373
400
}
374
401
}
375
402
376
403
#if UNITY_2020_2_OR_NEWER
377
404
/// <summary>
378
- /// </summary>
405
+ /// </summary>
379
406
public class LootLockerInlinedCatalogEntry : LootLockerCatalogEntry
380
407
{
381
408
/// <summary>
382
- /// Asset details inlined for this catalog entry, will be null if the entity_kind is not asset
383
- /// </summary>
409
+ /// Asset details inlined for this catalog entry, will be null if the entity_kind is not asset
410
+ /// </summary>
384
411
public LootLockerAssetDetails ? asset_details { get ; set ; }
385
412
/// <summary>
386
- /// Progression point details inlined for this catalog entry, will be null if the entity_kind is not progression_points
387
- /// </summary>
413
+ /// Progression point details inlined for this catalog entry, will be null if the entity_kind is not progression_points
414
+ /// </summary>
388
415
public LootLockerProgressionPointDetails ? progression_point_details { get ; set ; }
389
416
/// <summary>
390
- /// Progression reset details inlined for this catalog entry, will be null if the entity_kind is not progression_reset
391
- /// </summary>
417
+ /// Progression reset details inlined for this catalog entry, will be null if the entity_kind is not progression_reset
418
+ /// </summary>
392
419
public LootLockerProgressionResetDetails ? progression_reset_details { get ; set ; }
393
420
/// <summary>
394
- /// Currency details inlined for this catalog entry, will be null if the entity_kind is not currency
395
- /// </summary>
421
+ /// Currency details inlined for this catalog entry, will be null if the entity_kind is not currency
422
+ /// </summary>
396
423
public LootLockerCurrencyDetails ? currency_details { get ; set ; }
397
424
398
425
public LootLockerInlinedCatalogEntry ( LootLockerCatalogEntry entry , [ CanBeNull ] LootLockerAssetDetails assetDetails , [ CanBeNull ] LootLockerProgressionPointDetails progressionPointDetails , [ CanBeNull ] LootLockerProgressionResetDetails progressionResetDetails , [ CanBeNull ] LootLockerCurrencyDetails currencyDetails )
@@ -412,8 +439,8 @@ public LootLockerInlinedCatalogEntry(LootLockerCatalogEntry entry, [CanBeNull] L
412
439
}
413
440
414
441
/// <summary>
415
- /// Get all the entries with details inlined into the entries themselves
416
- /// </summary>
442
+ /// Get all the entries with details inlined into the entries themselves
443
+ /// </summary>
417
444
public LootLockerInlinedCatalogEntry [ ] GetLootLockerInlinedCatalogEntries ( )
418
445
{
419
446
List < LootLockerInlinedCatalogEntry > inlinedEntries = new List < LootLockerInlinedCatalogEntry > ( ) ;
0 commit comments