| //-------------------------------------------------------- | 
| //    [Author]:           YYL | 
| //    [  Date ]:           2025年6月13日 | 
| //-------------------------------------------------------- | 
|   | 
| using System.Collections.Generic; | 
|   | 
|   | 
| public partial class HeroAwakeConfig : ConfigBase<int, HeroAwakeConfig> | 
| { | 
|     // public int HeroID; | 
|     // public int AwakeLV; | 
|   | 
|     // HeroID, Dictionary<AwakeLV, HeroAwakeConfig> | 
|     public static Dictionary<int, Dictionary<int, HeroAwakeConfig>> configDics = new Dictionary<int, Dictionary<int, HeroAwakeConfig>>(); | 
|   | 
|     protected override void OnConfigParseCompleted() | 
|     { | 
|         base.OnConfigParseCompleted(); | 
|   | 
|         Dictionary<int, HeroAwakeConfig> tempDic = null; | 
|   | 
|         if (!configDics.TryGetValue(HeroID, out tempDic)) | 
|         { | 
|             tempDic = new Dictionary<int, HeroAwakeConfig>(); | 
|             configDics.Add(HeroID, tempDic); | 
|         } | 
|   | 
|         tempDic[AwakeLV] = this; | 
|     } | 
|   | 
|     public static HeroAwakeConfig GetHeroAwakeConfig(int heroID, int awakeLv) | 
|     { | 
|         Dictionary<int, HeroAwakeConfig> tempDic = null; | 
|   | 
|         if (!configDics.TryGetValue(heroID, out tempDic)) | 
|         { | 
|             return null; | 
|         } | 
|   | 
|         HeroAwakeConfig config = null; | 
|         tempDic.TryGetValue(awakeLv, out config); | 
|   | 
|         return config; | 
|     } | 
|   | 
|     public static bool CanAwake(int heroID, int awakeLv) | 
|     { | 
|         return GetHeroAwakeConfig(heroID, awakeLv) != null; | 
|     } | 
|   | 
|     //解锁指定天赋槽位需要的觉醒等级 | 
|     public static int GetAwakeLVByUnLockGiftIndex(int heroID, int index) | 
|     { | 
|         Dictionary<int, HeroAwakeConfig> tempDic = null; | 
|         if (!configDics.TryGetValue(heroID, out tempDic)) | 
|         { | 
|             return 0; | 
|         } | 
|   | 
|         foreach (var item in tempDic) | 
|         { | 
|             if (item.Value.UnlockTalentSlot == index + 1) | 
|             { | 
|                 return item.Key; | 
|             } | 
|         } | 
|         return 0; | 
|     } | 
|   | 
|      | 
|     public static int GetMaxAwakeLV(int heroID) | 
|     { | 
|         Dictionary<int, HeroAwakeConfig> tempDic = null; | 
|         if (!configDics.TryGetValue(heroID, out tempDic)) | 
|         { | 
|             return 0; | 
|         } | 
|         return tempDic.Count; | 
|     } | 
| } |