少年修仙传客户端代码仓库
hch
3 天以前 600733c8f592cb9e65f2b7a3e110ac1d686e6bfe
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//--------------------------------------------------------
//    [Author]:           Alee
//    [  Date ]:           2021年7月1日
//--------------------------------------------------------
 
using LitJson;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
//分部类
public partial class ILShentongLVConfig : IConfigPostProcess
{
    public static Dictionary<int, int> shentongLVConfig = new Dictionary<int, int>();
    public static Dictionary<int, List<Int2>> useItemDict = new Dictionary<int, List<Int2>>();
    public static List<int> needItemIDs = new List<int>(); //不重复的物品ID
    public void OnConfigParseCompleted()
    {
        var key = ShentongID * 10000 + ShentongClassLV * 100 + ShentongLV;
        shentongLVConfig[key] = ID;
        var items = JsonMapper.ToObject<int[][]>(LVLightNeedItem);
        List<Int2> tmp = new List<Int2>();
        for (int i = 0; i < items.Length; i++)
        {
            var itemID = items[i][0];
            tmp.Add(new Int2(itemID, items[i][1]));
            if (!needItemIDs.Contains(itemID))
            {
                needItemIDs.Add(itemID);
            }
        }
        useItemDict[ID] = tmp;
    }
 
    public static int GetShentongLVID(int id, int classLV, int lv)
    {
        var key = id * 10000 + classLV * 100 + lv;
        if (shentongLVConfig.ContainsKey(key))
            return shentongLVConfig[key];
 
        return -1;
    }
 
    public static List<Int2> GetUseItems(int id)
    {
        return useItemDict[id];
    }
 
 
}