internal DestinyComponentItemResponse(
     long?characterId,
     DestinyItemComponent item,
     DestinyItemInstanceComponent instance,
     DestinyItemObjectivesComponent objectives,
     DestinyItemPerksComponent perks,
     DestinyItemRenderComponent renderData,
     DestinyItemStatsComponent stats,
     DestinyItemTalentGridComponent talentGrid,
     DestinyItemSocketsComponent sockets,
     DestinyItemReusablePlugsComponent reusablePlugs,
     DestinyItemPlugObjectivesComponent plugObjectives)
 {
     CharacterId     = characterId;
     _item           = item;
     _instance       = instance;
     _objectives     = objectives;
     _perks          = perks;
     _renderData     = renderData;
     _stats          = stats;
     _talentGrid     = talentGrid;
     _sockets        = sockets;
     _reusablePlugs  = reusablePlugs;
     _plugObjectives = plugObjectives;
 }
示例#2
0
 public Item(string baseUrl, DestinyItemComponent itemComponent, DestinyInventoryItemDefinition itemDef,
             DestinyInventoryBucketDefinition bucket, DestinyItemInstanceComponent instance = null,
             string overrideIconUrl = null)
 {
     Name       = itemDef.DisplayProperties.Name;
     PowerLevel = instance?.PrimaryStat?.Value ?? 0;
     Slot       = new ItemSlot(bucket);
     Tier       = itemDef.Inventory.TierType;
     ClassType  = itemDef.ClassType;
     Icon       = baseUrl + (overrideIconUrl ?? itemDef.DisplayProperties.Icon);
 }
示例#3
0
        private static int GetPowerLevel(DestinyItemInstanceComponent instance,
                                         DestinyInventoryBucketDefinition bucket)
        {
            if (instance is null)
            {
                return(0);
            }

            if (bucket.Hash == (uint)ItemSlot.SlotHashes.Engrams)
            {
                return(instance.ItemLevel * 10);
            }

            return(instance.PrimaryStat?.Value ?? 0);
        }
示例#4
0
 public Item(string baseUrl, DestinyItemComponent itemComponent, DestinyInventoryItemDefinition itemDef,
             DestinyInventoryBucketDefinition bucket, DestinyItemInstanceComponent instance = null,
             string overrideIconUrl = null, string watermark = null)
 {
     Name       = itemDef.DisplayProperties.Name;
     PowerLevel = GetPowerLevel(instance, bucket);
     Slot       = new ItemSlot(bucket);
     Tier       = itemDef.Inventory.TierType;
     ClassType  = itemDef.ClassType;
     Icon       = baseUrl + (overrideIconUrl ?? itemDef.DisplayProperties.Icon);
     if (!string.IsNullOrEmpty(watermark))
     {
         Watermark = baseUrl + watermark;
     }
 }
示例#5
0
 public Item(string baseUrl, DestinyInventoryItemDefinition itemDef,
             DestinyInventoryBucketDefinition bucket, long instanceId = 0,
             DestinyItemInstanceComponent instance = null,
             IEnumerable <Stat> stats = null,
             IEnumerable <SocketCategory> socketCategories = null)
     : base(baseUrl, itemDef)
 {
     PowerLevel       = instance?.PrimaryStat?.Value ?? 0;
     Slot             = new ItemSlot(bucket);
     Tier             = itemDef.Inventory.TierType;
     ClassType        = itemDef.ClassType;
     InstanceId       = instanceId;
     SocketCategories = socketCategories?.ToList() ?? Enumerable.Empty <SocketCategory>();
     Stats            = stats?.ToList() ?? Enumerable.Empty <Stat>();
 }
 public bool TryGetInstance(out DestinyItemInstanceComponent data)
 {
     data = _instance;
     return(data != null);
 }