using System.Collections.Generic; 
 | 
using UnityEngine; 
 | 
  
 | 
public partial class HeroTalentConfig : ConfigBase<int, HeroTalentConfig> 
 | 
{ 
 | 
    // public int Quality; 
 | 
    // public int AttrID; 
 | 
  
 | 
    // Quality, List<HeroTalentConfig> 
 | 
    public static Dictionary<int, List<HeroTalentConfig>> configDics = new Dictionary<int, List<HeroTalentConfig>>(); 
 | 
  
 | 
    protected override void OnConfigParseCompleted() 
 | 
    { 
 | 
        base.OnConfigParseCompleted(); 
 | 
  
 | 
        List<HeroTalentConfig> list = null; 
 | 
        if (!configDics.TryGetValue(Quality, out list)) 
 | 
        { 
 | 
            list = new List<HeroTalentConfig>(); 
 | 
            configDics.Add(Quality, list); 
 | 
        } 
 | 
        list.Add(this); 
 | 
    } 
 | 
  
 | 
    public static List<HeroTalentConfig> GetTalentListByQuality(int quality) 
 | 
    { 
 | 
        List<HeroTalentConfig> list = null; 
 | 
        if (configDics.TryGetValue(quality, out list)) 
 | 
        { 
 | 
            return list; 
 | 
        } 
 | 
        return null; 
 | 
    } 
 | 
  
 | 
    /// <summary> 
 | 
    /// 所有品质的列表按AttrID升序排序(需在所有配置加载完后调用一次) 
 | 
    /// </summary> 
 | 
    public static void SortAllByAttrID() 
 | 
    { 
 | 
        foreach (var pair in configDics) 
 | 
        { 
 | 
            pair.Value.Sort((a, b) => a.AttrID.CompareTo(b.AttrID)); 
 | 
        } 
 | 
    } 
 | 
  
 | 
    protected override void AllConfigLoadFinish() 
 | 
    {    
 | 
        base.AllConfigLoadFinish(); 
 | 
        //  排序 
 | 
        SortAllByAttrID(); 
 | 
    } 
 | 
} 
 |