public UnlockDefinition(RewardThemeDefinition themeDefinition, StaticGameDataDefinition[] definitions) { ThemeDefinition = themeDefinition; Definitions = definitions; }
private void setUpItemGroup(ItemGroup itemGroup, int level, SpriteContentKey mascotIconContentKey = null, RewardThemeDefinition themeDefinition = null) { if (level > -1) { itemGroup.Level = level; } if (mascotIconContentKey != null) { if (!string.IsNullOrEmpty(mascotIconContentKey.Key)) { itemGroup.MascotIconContentKey = mascotIconContentKey; } else { Log.LogError(this, "Mascot icon content key was null"); } } if (themeDefinition != null) { if (!string.IsNullOrEmpty(themeDefinition.ShortThemeToken)) { itemGroup.LocalizedThemeName = localizer.GetTokenTranslation(themeDefinition.ShortThemeToken); } else if (!string.IsNullOrEmpty(themeDefinition.LongThemeToken)) { itemGroup.LocalizedThemeName = localizer.GetTokenTranslation(themeDefinition.LongThemeToken); } if (themeDefinition.ThemeIconContentKey != null && !string.IsNullOrEmpty(themeDefinition.ThemeIconContentKey.Key)) { itemGroup.ThemeIconContentKey = themeDefinition.ThemeIconContentKey; } } }
private void addItems(T[] items, ItemGroup.LockedState lockedState, int level, SpriteContentKey mascotIconContentKey = null, RewardThemeDefinition themeDefinition = null) { if (!GroupAllUnlockedItems || lockedState != 0) { createItemGroup(items, lockedState, level, mascotIconContentKey, themeDefinition); } else { unlockedItemsList.AddRange(items); } }
protected void createItemGroup(T[] items, ItemGroup.LockedState lockedState, int level, SpriteContentKey mascotIconContentKey, RewardThemeDefinition themeDefinition, bool displayBeforeUnlocks = false) { if (spacingRulesMap.ContainsKey(items.Length)) { items = spacingRulesMap[items.Length].CreateSpacing(items); } ItemGroup itemGroup = new ItemGroup(items, lockedState); setUpItemGroup(itemGroup, level, mascotIconContentKey, themeDefinition); if (lockedState != 0) { if (displayBeforeUnlocks) { lastUnlockedIndex++; itemGroups.Insert(0, itemGroup); } else { itemGroups.Add(itemGroup); } } else { lastUnlockedIndex++; itemGroups.Insert(lastUnlockedIndex, itemGroup); } }
private void parseRewardDefinition(T[] unlocks, bool isMember, SpriteContentKey mascotIconContentKey, RewardThemeDefinition themeDefinition) { T[] array = filterDefinitions(unlocks); if (array == null || array.Length <= 0) { return; } bool flag = false; bool flag2 = false; for (int i = 0; i < array.Length; i++) { if (!progressionService.IsUnlocked(array[i], UnlockCategory)) { flag = true; } if (!isMember && array[i].IsMemberOnly) { flag2 = true; break; } } ItemGroup.LockedState lockedState = (flag2 ? ItemGroup.LockedState.MemberLocked : (flag ? ItemGroup.LockedState.MascotLocked : ItemGroup.LockedState.Unlocked)); addItems(array, lockedState, -1, mascotIconContentKey, themeDefinition); removeUnlocksFromRewardSet(array); }