少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
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
using System.Collections;
using System.Collections.Generic;
using System.Text;
 
public partial class PetClassCostConfig : 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;
    }
}