示例#1
0
        public async Task <RewardCategory> CreateRewardCategorAsync(int loggedUser, CreateRewardCategoryRequest rewardCategory)
        {
            // validate admin user
            var user = await _uow.UserRepository.FindByAsync(u => u.Id == loggedUser && u.Role == RoleEnum.ADMIN);

            if (user.Count == 0)
            {
                throw new NotAllowedException(ExceptionConstants.NOT_ALLOWED);
            }

            var category = (RewardCategoryEnum)rewardCategory.Category;

            // validate category not duplicated
            var existCategory = await _uow.RewardCategoryRepository.FindBy(p => p.Category == category).CountAsync();

            if (existCategory > 0)
            {
                throw new AlreadyExistsException("The Reward Category already exist.");
            }

            var dbRewardCategory = new RewardCategory();

            dbRewardCategory.Category          = category;
            dbRewardCategory.Description       = rewardCategory.Description;
            dbRewardCategory.MaxPointsAllowed  = rewardCategory.MaxPointsAllowed;
            dbRewardCategory.PointsToDecrement = rewardCategory.PointsToDecrement;
            dbRewardCategory.PointsToIncrement = rewardCategory.PointsToIncrement;

            await _uow.RewardCategoryRepository.AddAsync(dbRewardCategory);

            await _uow.CommitAsync();

            return(dbRewardCategory);
        }
 public void LoadItem(RewardCategory rewardCategory, DReward rewardData, bool allowMemberLockOverlay = false, bool showItemName = false)
 {
     this.rewardCategory = rewardCategory;
     this.rewardData     = rewardData;
     if (rewardCategory == RewardCategory.fabrics)
     {
         loadItemIconContainer(fabricIconKey);
     }
     else if (rewardCategory == RewardCategory.partySupplies || rewardCategory == RewardCategory.consumables || rewardCategory == RewardCategory.musicTracks || rewardCategory == RewardCategory.iglooSlots || rewardCategory == RewardCategory.decorationInstances || rewardCategory == RewardCategory.decorationPurchaseRights || rewardCategory == RewardCategory.structureInstances || rewardCategory == RewardCategory.structurePurchaseRights)
     {
         loadItemIconContainer(prefabIconKey);
     }
     else
     {
         loadItemIconContainer(itemIconKey);
     }
     if (allowMemberLockOverlay)
     {
         object obj = rewardData.UnlockID;
         if (obj == null)
         {
             obj = rewardData.EquipmentRequest.definitionId;
         }
         bool flag = Service.Get <CPDataEntityCollection>().IsLocalPlayerMember() || !RewardUtils.IsRewardMemberOnly(rewardCategory, obj);
         MemberLockOverlay.SetActive(!flag);
     }
     this.showItemName = showItemName;
 }
        private static DRewardPopupScreenCount buildCountScreen(RewardCategory category, int unlockedCount)
        {
            DRewardPopupScreenCount dRewardPopupScreenCount = new DRewardPopupScreenCount();

            dRewardPopupScreenCount.CountCategory = category;
            dRewardPopupScreenCount.Count         = unlockedCount;
            return(dRewardPopupScreenCount);
        }
示例#4
0
 public void SetData(DItemRewardPopup itemRewardPopupData)
 {
     popupData = itemRewardPopupData;
     updateBackground();
     ItemNameText.text = itemRewardPopupData.ItemName;
     rewardCategory    = itemRewardPopupData.RewardCategory;
     rewardData        = itemRewardPopupData.RewardData;
     CoroutineRunner.Start(loadItem(rewardCategory, rewardData), this, "RewardPopupScreenItems.loadItem");
 }
示例#5
0
 private void loadItems(RewardCategory rewardCategory, DReward[] rewards)
 {
     ItemGridScaler.Init(rewards.Length);
     items = new List <RewardPopupRewardItem>();
     for (int i = 0; i < rewards.Length; i++)
     {
         CoroutineRunner.Start(loadItem(rewardCategory, rewards[i]), this, "RewardPopupScreenItems.loadItem");
     }
     CoroutineRunner.Start(doIntroCompleteDelay(), this, "RewardPopupScreenItems.doIntroCompleteDelay");
 }
示例#6
0
        public static RewardCategory GetItemRewardCategory(DisneyStoreItemData item)
        {
            List <DReward> rewards = item.GetRewards();
            RewardCategory result  = RewardCategory.equipmentInstances;

            if (rewards.Count > 0)
            {
                result = rewards[0].Category;
            }
            return(result);
        }
示例#7
0
        /// <summary>
        /// Return 0 if the reward cannot be assigned to this user due to whathever he cannot
        /// receive or loose more points in this category
        /// </summary>
        /// <param name="rewardCategory"></param>
        /// <param name="rewardAcomulate"></param>
        /// <param name="isPlus">Receive or Loose points</param>
        /// <returns>allowed points</returns>
        private async Task <int> AllowedPointsAsync(RewardCategory rewardCategory, RewardAcumulate rewardAcomulate, bool isPlus)
        {
            var currentAcumulate = rewardAcomulate.Points;
            var points           = 0;

            if (isPlus)
            {
                if (rewardCategory.MaxPointsAllowed != -1)
                {
                    var newAcumulate = currentAcumulate + rewardCategory.PointsToIncrement;
                    if (newAcumulate > rewardCategory.MaxPointsAllowed)
                    {
                        points = rewardCategory.MaxPointsAllowed - currentAcumulate;
                    }
                    else
                    {
                        points = rewardCategory.PointsToIncrement;
                    }
                }
                else
                {
                    points = rewardCategory.PointsToIncrement;
                }
            }
            else
            {
                if (currentAcumulate == 0)
                {
                    points = 0;
                }
                else
                {
                    var diff = currentAcumulate - rewardCategory.PointsToDecrement;
                    if (diff < 0)
                    {
                        points = currentAcumulate;
                    }
                    else
                    {
                        points = rewardCategory.PointsToDecrement;
                    }
                }
            }

            // Know if the total allow this reward, should only be not allowed if total gets under 0
            if (points == 0)
            {
                return(0);
            }

            var allowedPoints = await _userStatisticsService.AllowedPointsAsync(rewardAcomulate.UserId, isPlus?points : points * -1);

            return(allowedPoints);
        }
示例#8
0
    protected void setPurchaseActionText(DisneyStoreItemData item)
    {
        List <DReward> rewards  = item.GetRewards();
        RewardCategory category = rewards[0].Category;
        string         token    = "GlobalUI.Buttons.Use";

        if (category == RewardCategory.equipmentInstances)
        {
            token = "Marketplace.DisneyShop.WearButton";
        }
        PurchasedActionText.text = Service.Get <Localizer>().GetTokenTranslation(token);
    }
示例#9
0
    protected void selectTrayIcons(DisneyStoreItemData item)
    {
        List <DReward> rewards  = item.GetRewards();
        RewardCategory category = rewards[0].Category;
        int            num      = DisneyStoreUtils.IsIglooReward(item) ? 3 : Array.IndexOf(TrayIconImageSelectorCategoryIndexes, category);

        if (num != -1 || num >= TrayIconImageSelector.Sprites.Length)
        {
            TrayIconImageSelector.SelectSprite(num);
        }
        else
        {
            TrayIconImageSelector.SelectSprite(0);
        }
    }
示例#10
0
        private IEnumerator loadItem(RewardCategory rewardCategory, DReward reward)
        {
            AssetRequest <GameObject> assetRequest = Content.LoadAsync(RewardPopupConstants.RewardPopupItemContentKey);

            yield return(assetRequest);

            GameObject itemGO = UnityEngine.Object.Instantiate(assetRequest.Asset);

            itemGO.transform.SetParent(ItemPanel, worldPositionStays: false);
            item = itemGO.GetComponent <RewardPopupRewardItem>();
            RewardPopupRewardItem rewardPopupRewardItem = item;

            rewardPopupRewardItem.IconLoadCompleteAction = (Action <RewardPopupRewardItem>)Delegate.Combine(rewardPopupRewardItem.IconLoadCompleteAction, new Action <RewardPopupRewardItem>(OnItemLoadComplete));
            item.LoadItem(rewardCategory, reward);
        }
示例#11
0
        private IEnumerator loadItem(RewardCategory rewardCategory, DReward reward)
        {
            AssetRequest <GameObject> assetRequest = Content.LoadAsync(RewardPopupConstants.RewardPopupItemContentKey);

            yield return(assetRequest);

            GameObject itemGO = Object.Instantiate(assetRequest.Asset);

            itemGO.transform.SetParent(ItemParentTransform, worldPositionStays: false);
            itemGO.transform.SetSiblingIndex(0);
            RewardPopupRewardItem item = itemGO.GetComponent <RewardPopupRewardItem>();

            items.Add(item);
            item.LoadItem(rewardCategory, reward);
        }
 public void OnUseItClicked()
 {
     if (currentState == ConfirmationState.Complete)
     {
         List <DReward> rewards  = item.GetRewards();
         RewardCategory category = rewards[0].Category;
         if (category == RewardCategory.durables || category == RewardCategory.consumables)
         {
             equipProp(rewards[0]);
         }
         else
         {
             jumpToClothingDesigner(rewards[0]);
         }
         logUseItem();
     }
 }
        private static DRewardPopupScreenItems buildItemScreenFromIList(RewardCategory category, IList unlockedItems, DRewardPopup popupData)
        {
            DRewardPopupScreenItems dRewardPopupScreenItems = new DRewardPopupScreenItems();

            DReward[] array = new DReward[unlockedItems.Count];
            for (int i = 0; i < unlockedItems.Count; i++)
            {
                DReward dReward = new DReward();
                dReward.UnlockID = unlockedItems[i];
                array[i]         = dReward;
                dReward.Category = category;
            }
            dRewardPopupScreenItems.ItemCategory    = category;
            dRewardPopupScreenItems.Rewards         = array;
            dRewardPopupScreenItems.RewardPopupType = popupData.PopupType;
            return(dRewardPopupScreenItems);
        }
        private IEnumerator tweenIconToTray()
        {
            currentState = ConfirmationState.Animating;
            DisneyStoreTrayAnimator animator = storeController.GetTrayAnimator();
            RewardCategory          category = DisneyStoreUtils.GetItemRewardCategory(item);
            Transform tweenDestination       = animator.MyPenguinDestination;

            if (category == RewardCategory.consumables)
            {
                tweenDestination = animator.ToyboxDestination;
            }
            animator.TweenToTray(tweenDestination, IconImage.transform);
            yield return(new WaitForSeconds(animator.TweenTime));

            storeFranchise.HideConfirmation();
            yield return(null);
        }
示例#15
0
        private void showPriceTag(DisneyStoreItemData item)
        {
            PriceTagSpriteSelector.gameObject.SetActive(value: true);
            RewardCategory itemRewardCategory = DisneyStoreUtils.GetItemRewardCategory(item);

            if (DisneyStoreUtils.IsIglooReward(itemRewardCategory))
            {
                PriceTagSpriteSelector.SelectSprite(2);
            }
            else if (itemRewardCategory == RewardCategory.consumables)
            {
                PriceTagSpriteSelector.SelectSprite(1);
            }
            else
            {
                PriceTagSpriteSelector.SelectSprite(0);
            }
        }
示例#16
0
        public static bool IsIglooReward(RewardCategory rewardCategory)
        {
            bool result = false;

            switch (rewardCategory)
            {
            case RewardCategory.lots:
            case RewardCategory.structureInstances:
            case RewardCategory.structurePurchaseRights:
            case RewardCategory.decorationInstances:
            case RewardCategory.decorationPurchaseRights:
            case RewardCategory.lighting:
            case RewardCategory.musicTracks:
            case RewardCategory.iglooSlots:
                result = true;
                break;
            }
            return(result);
        }
示例#17
0
    protected string getMembershipDisclaimerTokenForRewardCategory(RewardCategory category)
    {
        switch (category)
        {
        case RewardCategory.equipmentTemplates:
        case RewardCategory.fabrics:
        case RewardCategory.decals:
            return("memberdisclaimer.text");

        case RewardCategory.partySupplies:
            return("GlobalUI.PartySupplies.Empty");

        case RewardCategory.durables:
            return("ExchangeEmpty.EmptyMessage.HeaderText.Gear");

        case RewardCategory.tubes:
            return("MemberNotification.RewardScreen.Tubes");

        case RewardCategory.decorationPurchaseRights:
            return("MemberNotification.RewardScreen.Igloos.Items");

        case RewardCategory.lots:
            return("MemberNotification.RewardScreen.Igloos.Locations");

        case RewardCategory.structurePurchaseRights:
            return("MemberNotification.RewardScreen.Igloos.Buildings");

        case RewardCategory.musicTracks:
            return("MemberNotification.RewardScreen.Igloos.Music");

        case RewardCategory.lighting:
            return("MemberNotification.RewardScreen.Igloos.Lighting");

        case RewardCategory.iglooSlots:
            return("MemberNotification.RewardScreen.Igloos.Slots");

        default:
            return("Membership.LockedReward");
        }
    }
        private static DRewardPopupScreenItems buildItemScreenFromDictionary(RewardCategory category, IDictionary unlockedItems, DRewardPopup popupData)
        {
            DRewardPopupScreenItems dRewardPopupScreenItems = new DRewardPopupScreenItems();

            DReward[]             array      = new DReward[unlockedItems.Count];
            int                   num        = 0;
            IDictionaryEnumerator enumerator = unlockedItems.GetEnumerator();

            while (enumerator.MoveNext())
            {
                DReward dReward = new DReward();
                dReward.UnlockID = enumerator.Key;
                dReward.Data     = enumerator.Value;
                dReward.Category = category;
                array[num]       = dReward;
                num++;
            }
            dRewardPopupScreenItems.ItemCategory    = category;
            dRewardPopupScreenItems.Rewards         = array;
            dRewardPopupScreenItems.RewardPopupType = popupData.PopupType;
            return(dRewardPopupScreenItems);
        }
示例#19
0
        /// <summary>
        /// Init acumulate if the user have no one for this category
        /// </summary>
        /// <param name="user"></param>
        /// <param name="rewardCategory"></param>
        /// <returns></returns>
        private async Task <RewardAcumulate> GetOrCreateRewardAcomulate(User user, RewardCategory rewardCategory)
        {
            var acumulate = await _uow.RewardAcumulateRepository.GetAll()
                            .Where(d => d.UserId == user.Id && d.RewardCategoryId == rewardCategory.Id)
                            .FirstOrDefaultAsync();

            if (acumulate == null)
            {
                acumulate = new RewardAcumulate
                {
                    RewardCategory = rewardCategory,
                    User           = user,
                    Points         = 0,
                    CreatedAt      = DateTime.UtcNow,
                    ModifiedAt     = DateTime.UtcNow
                };

                await _uow.RewardAcumulateRepository.AddAsync(acumulate);
            }

            return(acumulate);
        }
    private void onRewardItemLoaded(string path, GameObject prefab)
    {
        List <DReward> list = new List <DReward>();

        foreach (IRewardable item in chestReward)
        {
            if (!item.IsEmpty() && Enum.IsDefined(typeof(RewardCategory), item.RewardType))
            {
                RewardCategory category = (RewardCategory)Enum.Parse(typeof(RewardCategory), item.RewardType);
                Type           type     = item.Reward.GetType();
                if (item is EquipmentInstanceReward)
                {
                    EquipmentInstanceReward equipmentInstanceReward = (EquipmentInstanceReward)item;
                    for (int i = 0; i < equipmentInstanceReward.EquipmentInstances.Count; i++)
                    {
                        DReward dReward = new DReward();
                        dReward.Category         = RewardCategory.equipmentInstances;
                        dReward.EquipmentRequest = equipmentInstanceReward.EquipmentInstances[i];
                        list.Add(dReward);
                    }
                }
                else if (typeof(IList).IsAssignableFrom(type))
                {
                    IList list2 = item.Reward as IList;
                    if (list2 != null && list2.Count > 0)
                    {
                        for (int j = 0; j < list2.Count; j++)
                        {
                            DReward dReward2 = new DReward();
                            dReward2.UnlockID = list2[j];
                            dReward2.Category = category;
                            list.Add(dReward2);
                        }
                    }
                }
                else if (typeof(IDictionary).IsAssignableFrom(type))
                {
                    IDictionary dictionary = item.Reward as IDictionary;
                    if (dictionary != null && dictionary.Count > 0)
                    {
                        IDictionaryEnumerator enumerator2 = dictionary.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            DReward dReward2 = new DReward();
                            dReward2.UnlockID = enumerator2.Key;
                            dReward2.Data     = enumerator2.Value;
                            dReward2.Category = category;
                            list.Add(dReward2);
                        }
                    }
                }
            }
        }
        for (int j = 0; j < list.Count; j++)
        {
            createRewardItem(list[j], prefab);
        }
        float num = (list.Count > 2) ? ExtraItemCellSize : defaultCellSize;

        RewardContainer.GetComponent <GridLayoutGroup>().cellSize = new Vector2(num, num);
        logRewardBI(list);
    }
    public IRewardIconRenderer GetRewardIconRenderer(RewardCategory category)
    {
        switch (category)
        {
        case RewardCategory.equipmentTemplates:
            return(new RewardIconRenderer_Equipment());

        case RewardCategory.lots:
            return(new RewardIconRenderer_Lot());

        case RewardCategory.lighting:
            return(new RewardIconRenderer_Lighting());

        case RewardCategory.musicTracks:
            return(new RewardIconRenderer_MusicTracks());

        case RewardCategory.iglooSlots:
            return(new RewardIconRenderer_IglooSlots());

        case RewardCategory.decorationInstances:
        case RewardCategory.decorationPurchaseRights:
            return(new RewardIconRenderer_Decoration());

        case RewardCategory.structureInstances:
        case RewardCategory.structurePurchaseRights:
            return(new RewardIconRenderer_Structure());

        case RewardCategory.sizzleClips:
            return(new RewardIconRenderer_SizzleClips());

        case RewardCategory.decals:
            return(new RewardIconRenderer_Decal());

        case RewardCategory.fabrics:
            return(new RewardIconRenderer_Pattern());

        case RewardCategory.colourPacks:
            return(new RewardIconRenderer_ColourPack());

        case RewardCategory.equipmentInstances:
            return(new RewardIconRenderer_EquipmentInstance());

        case RewardCategory.genericSprite:
            return(new RewardIconRenderer_Sprite());

        case RewardCategory.genericModel:
            return(new RewardIconRenderer_Model());

        case RewardCategory.durables:
            return(new RewardIconRenderer_Durable());

        case RewardCategory.emotePacks:
            return(new RewardIconRenderer_Emote());

        case RewardCategory.partySupplies:
            return(new RewardIconRenderer_PartySupplies());

        case RewardCategory.consumables:
            return(new RewardIconRenderer_ConsumableInstance());

        case RewardCategory.tubes:
            return(new RewardIconRenderer_Tube());

        default:
            return(new RewardIconRenderer_Equipment());
        }
    }
示例#22
0
        private async Task GetCreateRewardCategoryByCategorySaveAsync(RewardCategoryEnum category)
        {
            var rewardCategory = await _uow.RewardCategoryRepository.GetAll().Where(d => d.Category == category)
                                 .FirstOrDefaultAsync();

            if (rewardCategory == null)
            {
                rewardCategory = new RewardCategory
                {
                    Category          = category,
                    Description       = "",
                    MaxPointsAllowed  = -1,
                    PointsToDecrement = 0,
                    PointsToIncrement = 5,
                };

                switch (category)
                {
                case RewardCategoryEnum.POLL_ANSWERED:
                    rewardCategory.PointsToIncrement = 10;
                    rewardCategory.MaxPointsAllowed  = 30;
                    break;

                case RewardCategoryEnum.EAT_CREATED:
                    break;

                case RewardCategoryEnum.EAT_BALANCED_CREATED:
                    rewardCategory.PointsToIncrement = 10;
                    break;

                case RewardCategoryEnum.EAT_CREATED_STREAK:
                    rewardCategory.PointsToIncrement = 30;
                    rewardCategory.PointsToDecrement = 30;

                    break;

                case RewardCategoryEnum.EAT_BALANCED_CREATED_STREAK:
                    rewardCategory.PointsToIncrement = 40;
                    rewardCategory.PointsToDecrement = 40;
                    break;

                case RewardCategoryEnum.DISH_BUILT:
                    rewardCategory.PointsToIncrement = 10;
                    break;

                case RewardCategoryEnum.NEW_REFERAL:
                    rewardCategory.PointsToIncrement = 25;
                    break;

                case RewardCategoryEnum.CUT_POINT_REACHED:
                    rewardCategory.PointsToIncrement = 20;
                    break;

                case RewardCategoryEnum.SOLO_QUESTION_ANSWERED:
                    rewardCategory.PointsToIncrement = 0;
                    rewardCategory.PointsToDecrement = 0;
                    break;

                default:
                    break;
                }

                await _uow.RewardCategoryRepository.AddAsync(rewardCategory);
            }
        }
示例#23
0
    public static bool IsRewardMemberOnly(RewardCategory category, object definitionId)
    {
        try
        {
            switch (category)
            {
            case RewardCategory.equipmentInstances:
            case RewardCategory.equipmentTemplates:
                return(IsMemberLockableItemMemberOnly <TemplateDefinition, int>(int.Parse(definitionId.ToString()), allowNonMemberTemplateCreation: true));

            case RewardCategory.decorationInstances:
            case RewardCategory.decorationPurchaseRights:
                return(IsMemberLockableItemMemberOnly <DecorationDefinition, int>(int.Parse(definitionId.ToString())));

            case RewardCategory.structureInstances:
            case RewardCategory.structurePurchaseRights:
                return(IsMemberLockableItemMemberOnly <StructureDefinition, int>(int.Parse(definitionId.ToString())));

            case RewardCategory.lots:
                return(IsMemberLockableItemMemberOnly <LotDefinition, string>(definitionId.ToString()));

            case RewardCategory.lighting:
                return(IsMemberLockableItemMemberOnly <LightingDefinition, int>(int.Parse(definitionId.ToString())));

            case RewardCategory.musicTracks:
                return(IsMemberLockableItemMemberOnly <MusicTrackDefinition, int>(int.Parse(definitionId.ToString())));

            case RewardCategory.fabrics:
                return(IsMemberLockableItemMemberOnly <FabricDefinition, int>(int.Parse(definitionId.ToString())));

            case RewardCategory.decals:
                return(IsMemberLockableItemMemberOnly <DecalDefinition, int>(int.Parse(definitionId.ToString())));

            case RewardCategory.emotePacks:
                return(IsMemberLockableItemMemberOnly <EmoteDefinition, string>(definitionId.ToString()));

            case RewardCategory.sizzleClips:
                return(IsMemberLockableItemMemberOnly <SizzleClipDefinition, int>(int.Parse(definitionId.ToString())));

            case RewardCategory.tubes:
                return(IsMemberLockableItemMemberOnly <TubeDefinition, int>(int.Parse(definitionId.ToString())));

            case RewardCategory.durables:
            case RewardCategory.partySupplies:
            {
                int itemId = int.Parse(definitionId.ToString());
                return(IsMemberLockableItemMemberOnly <PropDefinition, int>(itemId));
            }

            case RewardCategory.consumables:
            {
                int consumableIdByServerName = GetConsumableIdByServerName(definitionId.ToString());
                return(IsMemberLockableItemMemberOnly <PropDefinition, int>(consumableIdByServerName));
            }

            default:
                return(true);
            }
        }
        catch (Exception)
        {
            return(true);
        }
    }
示例#24
0
    public static string GetUnlockText(RewardCategory category)
    {
        Localizer localizer        = Service.Get <Localizer>();
        string    tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.Items");

        switch (category)
        {
        case RewardCategory.decals:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.Decals");
            break;

        case RewardCategory.sizzleClips:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.Animations");
            break;

        case RewardCategory.equipmentInstances:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.SpecialItems");
            break;

        case RewardCategory.fabrics:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.Fabrics");
            break;

        case RewardCategory.equipmentTemplates:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.Templates");
            break;

        case RewardCategory.savedOutfitSlots:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.OutfitSlots");
            break;

        case RewardCategory.emotePacks:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.Emotes");
            break;

        case RewardCategory.durables:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.Gear");
            break;

        case RewardCategory.partySupplies:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.PartySupplies");
            break;

        case RewardCategory.tubes:
            tokenTranslation = localizer.GetTokenTranslation("RewardScreen.UnlockedText.Tubes");
            break;

        case RewardCategory.lots:
            tokenTranslation = localizer.GetTokenTranslation("Rewards.Igloos.Lots");
            break;

        case RewardCategory.lighting:
            tokenTranslation = localizer.GetTokenTranslation("Rewards.Igloos.Lighting");
            break;

        case RewardCategory.musicTracks:
            tokenTranslation = localizer.GetTokenTranslation("Rewards.Igloos.Effects");
            break;

        case RewardCategory.iglooSlots:
            tokenTranslation = localizer.GetTokenTranslation("Rewards.Igloos.IglooSlot");
            break;

        case RewardCategory.decorationInstances:
            tokenTranslation = localizer.GetTokenTranslation("Rewards.Igloos.Items");
            break;

        case RewardCategory.decorationPurchaseRights:
            tokenTranslation = localizer.GetTokenTranslation("Rewards.Igloos.ItemsAvailable");
            break;

        case RewardCategory.structureInstances:
            tokenTranslation = localizer.GetTokenTranslation("Rewards.Igloos.Structures");
            break;

        case RewardCategory.structurePurchaseRights:
            tokenTranslation = localizer.GetTokenTranslation("Rewards.Igloos.StructuresAvailable");
            break;
        }
        return(tokenTranslation);
    }
        private static List <DRewardPopupScreen> buildItemScreens(DRewardPopup popupData, bool checkForNonMemberScreens)
        {
            List <DRewardPopupScreen> list = new List <DRewardPopupScreen>();
            Type typeFromHandle            = typeof(IList);
            Type typeFromHandle2           = typeof(int);
            Type typeFromHandle3           = typeof(IDictionary);

            foreach (IRewardable rewardDatum in popupData.RewardData)
            {
                if (rewardDatum is EquipmentInstanceReward || rewardDatum.IsEmpty() || !Enum.IsDefined(typeof(RewardCategory), rewardDatum.RewardType))
                {
                    continue;
                }
                RewardCategory rewardCategory = (RewardCategory)Enum.Parse(typeof(RewardCategory), rewardDatum.RewardType);
                Type           type           = rewardDatum.Reward.GetType();
                if (rewardCategory == RewardCategory.iglooSlots)
                {
                    int num = (int)rewardDatum.Reward;
                    if (num > 0)
                    {
                        DRewardPopupScreenItems dRewardPopupScreenItems = new DRewardPopupScreenItems();
                        DReward[] rewards = new DReward[num];
                        for (int i = 0; i < num; i++)
                        {
                            DReward dReward = new DReward();
                            dReward.Category = rewardCategory;
                        }
                        dRewardPopupScreenItems.ItemCategory    = rewardCategory;
                        dRewardPopupScreenItems.Rewards         = rewards;
                        dRewardPopupScreenItems.RewardPopupType = popupData.PopupType;
                        list.Add(dRewardPopupScreenItems);
                    }
                }
                else if (typeFromHandle.IsAssignableFrom(type))
                {
                    IList list2 = rewardDatum.Reward as IList;
                    if (list2 == null || list2.Count <= 0)
                    {
                        continue;
                    }
                    bool isRewardsAllNonMember = false;
                    DRewardPopupScreenItems dRewardPopupScreenItems = buildItemScreenFromIList(rewardCategory, list2, popupData);
                    if (checkForNonMemberScreens)
                    {
                        for (int i = 0; i < dRewardPopupScreenItems.Rewards.Length; i++)
                        {
                            if (RewardUtils.IsRewardMemberOnly(rewardCategory, dRewardPopupScreenItems.Rewards[i].UnlockID))
                            {
                                isRewardsAllNonMember = false;
                                break;
                            }
                            isRewardsAllNonMember = true;
                        }
                    }
                    dRewardPopupScreenItems.IsRewardsAllNonMember = isRewardsAllNonMember;
                    list.Add(dRewardPopupScreenItems);
                }
                else if (typeFromHandle3.IsAssignableFrom(type))
                {
                    IDictionary dictionary = rewardDatum.Reward as IDictionary;
                    if (dictionary == null || dictionary.Count <= 0)
                    {
                        continue;
                    }
                    bool isRewardsAllNonMember = false;
                    DRewardPopupScreenItems dRewardPopupScreenItems = buildItemScreenFromDictionary(rewardCategory, dictionary, popupData);
                    if (checkForNonMemberScreens)
                    {
                        for (int i = 0; i < dRewardPopupScreenItems.Rewards.Length; i++)
                        {
                            if (RewardUtils.IsRewardMemberOnly(rewardCategory, dRewardPopupScreenItems.Rewards[i].UnlockID))
                            {
                                isRewardsAllNonMember = false;
                                break;
                            }
                            isRewardsAllNonMember = true;
                        }
                    }
                    dRewardPopupScreenItems.IsRewardsAllNonMember = isRewardsAllNonMember;
                    list.Add(dRewardPopupScreenItems);
                }
                else if (type.Equals(typeFromHandle2))
                {
                    int num = (int)rewardDatum.Reward;
                    if (num > 0)
                    {
                        list.Add(buildCountScreen(rewardCategory, num));
                    }
                }
            }
            list.Sort(delegate(DRewardPopupScreen p1, DRewardPopupScreen p2)
            {
                RewardCategory rewardCategory2 = ((!(p1 is DRewardPopupScreenItems)) ? ((DRewardPopupScreenCount)p1).CountCategory : ((DRewardPopupScreenItems)p1).ItemCategory);
                RewardCategory rewardCategory3 = ((!(p2 is DRewardPopupScreenItems)) ? ((DRewardPopupScreenCount)p2).CountCategory : ((DRewardPopupScreenItems)p2).ItemCategory);
                return(rewardCategory2.CompareTo(rewardCategory3));
            });
            return(list);
        }