1
1
using LootLocker . LootLockerEnums ;
2
2
using System . Collections . Generic ;
3
+ using Unity . Plastic . Antlr3 . Runtime ;
3
4
#if UNITY_2020_2_OR_NEWER
4
5
using JetBrains . Annotations ;
5
6
#endif
@@ -15,6 +16,7 @@ public enum LootLockerCatalogEntryEntityKind
15
16
currency = 1 ,
16
17
progression_points = 2 ,
17
18
progression_reset = 3 ,
19
+ group = 4 ,
18
20
} ;
19
21
}
20
22
@@ -293,6 +295,59 @@ public class LootLockerCurrencyDetails
293
295
public string catalog_listing_id { get ; set ; }
294
296
}
295
297
298
+ public class LootLockerGroupAssociations
299
+ {
300
+ /// <summary>
301
+ /// The kind of reward, (asset / currency / group / progression points / progression reset).
302
+ /// </summary>
303
+ public LootLockerCatalogEntryEntityKind kind { get ; set ; }
304
+ /// <summary>
305
+ /// The unique id of the group that this refers to
306
+ /// </summary>
307
+ public string id { get ; set ; }
308
+ /// <summary>
309
+ /// The catalog listing id for this group detail.
310
+ /// </summary>
311
+ public string catalog_listing_id { get ; set ; }
312
+ }
313
+
314
+ public class LootLockerGroupMetadata
315
+ {
316
+ /// <summary>
317
+ /// The Key of a metadata
318
+ /// </summary>
319
+ public string key { get ; set ; }
320
+ /// <summary>
321
+ /// the Value of a metadata
322
+ /// </summary>
323
+ public string value { get ; set ; }
324
+ }
325
+
326
+ public class LootLockerGroupDetails
327
+ {
328
+ /// <summary>
329
+ /// The name of the Group.
330
+ /// </summary>
331
+ public string name { get ; set ; }
332
+ /// <summary>
333
+ /// The description of the Group.
334
+ /// </summary>
335
+ public string description { get ; set ; }
336
+ /// <summary>
337
+ /// Associations for the Group reward.
338
+ /// </summary>
339
+ public LootLockerGroupMetadata [ ] metadata { get ; set ; }
340
+ /// <summary>
341
+ /// The ID of the reward.
342
+ /// </summary>
343
+ public string id { get ; set ; }
344
+ /// <summary>
345
+ /// Associations for the Group reward.
346
+ /// </summary>
347
+ public LootLockerGroupAssociations [ ] associations { get ; set ; }
348
+
349
+ }
350
+
296
351
//==================================================
297
352
// Response Definitions
298
353
//==================================================
@@ -349,6 +404,8 @@ public class LootLockerListCatalogPricesResponse : LootLockerResponse
349
404
/// </summary>
350
405
public Dictionary < string /*catalog_listing_id*/ , LootLockerCurrencyDetails > currency_details { get ; set ; }
351
406
407
+ public Dictionary < string /*catalog_listing_id*/ , LootLockerGroupDetails > group_details { get ; set ; }
408
+
352
409
/// <summary>
353
410
/// Pagination data to use for subsequent requests
354
411
/// </summary>
@@ -394,6 +451,7 @@ private class LootLockerListCatalogItemsWithArraysResponse : LootLockerResponse
394
451
public LootLockerProgressionPointDetails [ ] progression_points_details { get ; set ; }
395
452
public LootLockerProgressionResetDetails [ ] progression_resets_details { get ; set ; }
396
453
public LootLockerCurrencyDetails [ ] currency_details { get ; set ; }
454
+ public LootLockerGroupDetails [ ] group_details { get ; set ; }
397
455
public LootLockerPaginationResponse < string > pagination { get ; set ; }
398
456
}
399
457
@@ -413,6 +471,7 @@ public LootLockerListCatalogPricesResponse(LootLockerResponse serverResponse)
413
471
catalog = parsedResponse . catalog ;
414
472
entries = parsedResponse . entries ;
415
473
pagination = parsedResponse . pagination ;
474
+
416
475
417
476
if ( parsedResponse . assets_details != null && parsedResponse . assets_details . Length > 0 )
418
477
{
@@ -451,6 +510,16 @@ public LootLockerListCatalogPricesResponse(LootLockerResponse serverResponse)
451
510
currency_details [ detail . catalog_listing_id ] = detail ;
452
511
}
453
512
}
513
+
514
+ if ( parsedResponse . group_details != null && parsedResponse . group_details . Length > 0 )
515
+ {
516
+ group_details = new Dictionary < string , LootLockerGroupDetails > ( ) ;
517
+ foreach ( var detail in parsedResponse . group_details )
518
+ {
519
+ group_details [ detail . id ] = detail ;
520
+ }
521
+ }
522
+
454
523
}
455
524
456
525
#if UNITY_2020_2_OR_NEWER
@@ -479,7 +548,9 @@ public class LootLockerInlinedCatalogEntry : LootLockerCatalogEntry
479
548
[ CanBeNull ]
480
549
public LootLockerCurrencyDetails currency_details { get ; set ; }
481
550
482
- public LootLockerInlinedCatalogEntry ( LootLockerCatalogEntry entry , [ CanBeNull ] LootLockerAssetDetails assetDetails , [ CanBeNull ] LootLockerProgressionPointDetails progressionPointDetails , [ CanBeNull ] LootLockerProgressionResetDetails progressionResetDetails , [ CanBeNull ] LootLockerCurrencyDetails currencyDetails )
551
+ public LootLockerGroupDetails group_details { get ; set ; }
552
+
553
+ public LootLockerInlinedCatalogEntry ( LootLockerCatalogEntry entry , [ CanBeNull ] LootLockerAssetDetails assetDetails , [ CanBeNull ] LootLockerProgressionPointDetails progressionPointDetails , [ CanBeNull ] LootLockerProgressionResetDetails progressionResetDetails , [ CanBeNull ] LootLockerCurrencyDetails currencyDetails , LootLockerGroupDetails groupDetails )
483
554
{
484
555
created_at = entry . created_at ;
485
556
entity_kind = entry . entity_kind ;
@@ -493,6 +564,7 @@ public LootLockerInlinedCatalogEntry(LootLockerCatalogEntry entry, [CanBeNull] L
493
564
progression_point_details = progressionPointDetails ;
494
565
progression_reset_details = progressionResetDetails ;
495
566
currency_details = currencyDetails ;
567
+ group_details = groupDetails ;
496
568
}
497
569
}
498
570
@@ -511,7 +583,8 @@ public LootLockerInlinedCatalogEntry[] GetLootLockerInlinedCatalogEntries()
511
583
LootLockerCatalogEntryEntityKind . asset == entityKind && asset_details . ContainsKey ( catalogListingID ) ? asset_details [ catalogListingID ] : null ,
512
584
LootLockerCatalogEntryEntityKind . progression_points == entityKind && progression_points_details . ContainsKey ( catalogListingID ) ? progression_points_details [ catalogListingID ] : null ,
513
585
LootLockerCatalogEntryEntityKind . progression_reset == entityKind && progression_resets_details . ContainsKey ( catalogListingID ) ? progression_resets_details [ catalogListingID ] : null ,
514
- LootLockerCatalogEntryEntityKind . currency == entityKind && currency_details . ContainsKey ( catalogListingID ) ? currency_details [ catalogListingID ] : null
586
+ LootLockerCatalogEntryEntityKind . currency == entityKind && currency_details . ContainsKey ( catalogListingID ) ? currency_details [ catalogListingID ] : null ,
587
+ LootLockerCatalogEntryEntityKind . group == entityKind && group_details . ContainsKey ( catalogListingID ) ? group_details [ catalogListingID ] : null
515
588
) ) ;
516
589
}
517
590
return inlinedEntries . ToArray ( ) ;
0 commit comments