using System.Collections.Generic; public partial class ActHeroAppearStarConfig : ConfigBase { // 升星礼包模版ID: 奖励记录索引 :配置ID private static Dictionary> infoDict = new(); // 升星礼包模版ID List<奖励记录索引> private static Dictionary> sortDict = new(); protected override void OnConfigParseCompleted() { if (!infoDict.TryGetValue(StarTempID, out var dict)) { dict = new Dictionary(); infoDict[StarTempID] = dict; } dict[AwardIndex] = ID; } private static void LoadSortList() { if (!sortDict.IsNullOrEmpty()) return; foreach (var kvp in infoDict) { int starTempID = kvp.Key; List list = new List(kvp.Value.Keys); list.Sort(); sortDict[starTempID] = list; } } public static List GetAwardIndexSortList(int starTempID) { LoadSortList(); sortDict.TryGetValue(starTempID, out var list); List res = new List(); int heroId = HeroDebutManager.Instance.GetCurrentDisplayStarUpHeroId(); int nowStar = HeroDebutManager.Instance.GetNowHeroMaxStarCnt(heroId); for (int i = HeroDebutManager.Instance.seeArr.Length - 1; i >= 0; i--) { int[] info = HeroDebutManager.Instance.seeArr[i]; int needStar = info[0]; int seeStar = info[1]; if (nowStar >= needStar) { for (int j = 0; j < seeStar; j++) { if (j >= list.Count) continue; var config = GetConfig(starTempID, list[j]); if (config == null) continue; int tempStar = config.NeedStar; if (tempStar > seeStar) continue; res.Add(list[j]); } return res; } } return null; } public static Dictionary GetAwardIndexDict(int starTempID) { infoDict.TryGetValue(starTempID, out var dict); return dict; } public static int GetID(int starTempID, int awardIndex) { var dict = GetAwardIndexDict(starTempID); if (dict == null) return 0; dict.TryGetValue(awardIndex, out var id); return id; } public static ActHeroAppearStarConfig GetConfig(int starTempID, int awardIndex) { int id = GetID(starTempID, awardIndex); return Get(id); } }