Beispiel #1
0
 private void addBreadCrumbsForReward <TItemDefinition, URewardable, VIdType>(Reward reward, PersistentBreadcrumbTypeDefinitionKey singleBreadcrumbId, StaticBreadcrumbDefinitionKey groupBreadcrumbId) where TItemDefinition : IMemberLocked where URewardable : AbstractListReward <VIdType>
 {
     if (reward.TryGetValue(out URewardable rewardable) && !rewardable.IsEmpty())
     {
         bool           flag = false;
         List <VIdType> list = (List <VIdType>)rewardable.Reward;
         foreach (VIdType item in list)
         {
             if (dataEntityCollection.IsLocalPlayerMember() || !RewardUtils.IsMemberLockableItemMemberOnly <TItemDefinition, VIdType>(item))
             {
                 notificationBreadcrumbController.AddPersistentBreadcrumb(singleBreadcrumbId, item.ToString());
                 flag = true;
             }
         }
         if (flag)
         {
             notificationBreadcrumbController.AddBreadcrumb(groupBreadcrumbId);
         }
     }
 }
Beispiel #2
0
    private void addBreadcrumbsForReward(Reward reward)
    {
        addBreadCrumbsForReward <PropDefinition, DurableReward, int>(reward, breadcrumbIdentifiers.GearType, breadcrumbIdentifiers.Gear);
        addBreadCrumbsForReward <TemplateDefinition, EquipmentTemplateReward, int>(reward, breadcrumbIdentifiers.TemplateType, breadcrumbIdentifiers.Template);
        addBreadCrumbsForReward <FabricDefinition, FabricReward, int>(reward, breadcrumbIdentifiers.FabricType, breadcrumbIdentifiers.Fabric);
        addBreadCrumbsForReward <DecalDefinition, DecalReward, int>(reward, breadcrumbIdentifiers.DecalType, breadcrumbIdentifiers.Decal);
        addBreadCrumbsForReward <TubeDefinition, TubeReward, int>(reward, breadcrumbIdentifiers.TubeType, breadcrumbIdentifiers.Tube);
        addBreadCrumbsForReward <DecorationDefinition, DecorationReward, int>(reward, breadcrumbIdentifiers.DecorationType, breadcrumbIdentifiers.Decoration);
        addBreadCrumbsForReward <StructureDefinition, StructureReward, int>(reward, breadcrumbIdentifiers.StructureType, breadcrumbIdentifiers.Structure);
        addBreadCrumbsForReward <MusicTrackDefinition, MusicTrackReward, int>(reward, breadcrumbIdentifiers.MusicTrackType, breadcrumbIdentifiers.MusicTrack);
        addBreadCrumbsForReward <LightingDefinition, LightingReward, int>(reward, breadcrumbIdentifiers.LightingType, breadcrumbIdentifiers.Lighting);
        if (reward.TryGetValue(out EquipmentInstanceReward rewardable) && !rewardable.IsEmpty())
        {
            bool flag = false;
            for (int i = 0; i < rewardable.EquipmentInstances.Count; i++)
            {
                if (dataEntityCollection.IsLocalPlayerMember() || !RewardUtils.IsMemberLockableItemMemberOnly <TemplateDefinition, int>(rewardable.EquipmentInstances[i].definitionId))
                {
                    NotificationBreadcrumbController      obj           = notificationBreadcrumbController;
                    PersistentBreadcrumbTypeDefinitionKey inventoryType = breadcrumbIdentifiers.InventoryType;
                    long equipmentId = rewardable.EquipmentInstances[i].equipmentId;
                    obj.AddPersistentBreadcrumb(inventoryType, equipmentId.ToString());
                    flag = true;
                }
            }
            if (flag)
            {
                notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.Inventory);
            }
        }
        if (!reward.TryGetValue(out ConsumableInstanceReward rewardable2) || rewardable2.IsEmpty())
        {
            return;
        }
        Dictionary <string, int> .Enumerator enumerator = rewardable2.Consumables.GetEnumerator();
        bool flag2 = false;
        bool flag3 = false;

        while (enumerator.MoveNext())
        {
            if (dataEntityCollection.IsLocalPlayerMember() || !RewardUtils.IsMemberLockableItemMemberOnly <PropDefinition, int>(RewardUtils.GetConsumableIdByServerName(enumerator.Current.Key)))
            {
                PersistentBreadcrumbTypeDefinitionKey type;
                if (RewardUtils.IsConsumablePartyGame(enumerator.Current.Key))
                {
                    type  = breadcrumbIdentifiers.PartyGameType;
                    flag3 = true;
                }
                else
                {
                    type  = breadcrumbIdentifiers.ConsumableType;
                    flag2 = true;
                }
                notificationBreadcrumbController.AddPersistentBreadcrumb(type, RewardUtils.GetConsumableIdByServerName(enumerator.Current.Key).ToString());
            }
        }
        if (flag2)
        {
            notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.Consumable);
        }
        if (flag3)
        {
            notificationBreadcrumbController.AddBreadcrumb(breadcrumbIdentifiers.PartyGame);
        }
    }