少年修仙传客户端代码仓库
hch
2025-04-03 c154ac0832fe4379a00d3e1cda700e7d2a7383c7
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
50
51
using System.Collections.Generic;
 
public partial class PersonalBossConfig : IConfigPostProcess
{
    // ¾³½ç bossNPCID
    private static Dictionary<int, int> realmDict = new Dictionary<int, int>();
    // lineid bossNPCID
    private static Dictionary<int, int> lineIdDict = new Dictionary<int, int>();
    public void OnConfigParseCompleted()
    {
 
    }
 
    //»ñÈ¡¾³½ç¶ÔÓ¦µÄbossNPCID×Öµä
    public static Dictionary<int, int> GetNPCIDDictForRealm()
    {
        if (realmDict.IsNullOrEmpty())
        {
            var keyList = GetKeys();
            for (int i = 0; i < keyList.Count; i++)
            {
                int npcID = int.Parse(keyList[i]);
                //NPC±íÀïûÓÐÕâ¸öid
                if (!NPCConfig.Has(npcID))
                    continue;
                int realmLv = NPCConfig.Get(npcID).Realm;
                //¾³½ç±íÖÐûÓÐÕâ¸öLV
                if (!RealmConfig.Has(realmLv))
                    continue;
                realmDict[realmLv] = npcID;
            }
        }
        return realmDict;
    }
 
    //»ñÈ¡lineid¶ÔÓ¦µÄbossNPCID×Öµä
    public static Dictionary<int, int> GetNPCIDDictForLineId()
    {
        if (lineIdDict.IsNullOrEmpty())
        {
            var keyList = GetKeys();
            Dictionary<int, int> tempDict = new Dictionary<int, int>();
            for (int i = 0; i < keyList.Count; i++)
            {
                int npcID = int.Parse(keyList[i]);
                lineIdDict[Get(npcID).lineId] = npcID;
            }
        }
        return lineIdDict;
    }
}