少年修仙传客户端代码仓库
client_linchunjie
2018-08-20 b78c5de93222addd09a9c5a09900ab7c1a58fff5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Collections;
using System.Collections.Generic;
using System.Text;
 
namespace TableConfig
{
    public partial class PetClassCostConfig : ConfigBase, IConfigPostProcess
    {
        private static Dictionary<string, PetClassCostConfig> t_petClssCost = new Dictionary<string, PetClassCostConfig>();
        private static Dictionary<int, List<PetClassCostConfig>> t_petClssCostDict = new Dictionary<int, List<PetClassCostConfig>>();
        public void OnConfigParseCompleted()
        {
            t_petClssCost.Add(StringUtility.Contact(PetID, Rank).ToString(), this);
            if (!t_petClssCostDict.ContainsKey(PetID))
            {
                List<PetClassCostConfig> list = new List<PetClassCostConfig>();
                list.Add(this);
                t_petClssCostDict.Add(PetID, list);
            }
            else
            {
                t_petClssCostDict[PetID].Add(this);
            }
        }
 
        public static PetClassCostConfig GetPetIdAndRank(int _PetID, int _Rank)
        {
            PetClassCostConfig _petIdAndRank = null;
            t_petClssCost.TryGetValue(StringUtility.Contact(_PetID, _Rank).ToString(), out _petIdAndRank);
            return _petIdAndRank;
        }
    }
 
 
}