少年修仙传客户端代码仓库
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//--------------------------------------------------------
//    [Author]:           µÚ¶þÊÀ½ç
//    [  Date ]:           Tuesday, August 21, 2018
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
using System.Collections.Generic;
 
 
public partial class FBGeneralTrainConfig : IConfigPostProcess
{
    static Dictionary<Int2, int> mapLineInfo = new Dictionary<Int2, int>();    //mapID, lineID ¶ÔÓ¦¸±±¾ÐÅÏ¢
    static Dictionary<int, int> mapToMaxline = new Dictionary<int, int>();    //mapID:×î´óÏßID´Ó1¿ªÊ¼
    public void OnConfigParseCompleted()
    {
        mapLineInfo[new Int2(DataMapID, LineID)] = ID;
        if (mapToMaxline.ContainsKey(DataMapID))
        {
            if (mapToMaxline[DataMapID] < LineID)
            {
                mapToMaxline[DataMapID] = LineID;
            }
        }
        else
        {
            mapToMaxline[DataMapID] = LineID;
        }
    }
 
    public static FBGeneralTrainConfig GetDungeonInfo(int mapID, int npcID)
    {
        int id;
        mapLineInfo.TryGetValue(new Int2(mapID, npcID), out id);
        if (id == 0)
        {
            return null;
        }
        return Get(id);
    }
 
    public static int GetMaxLine(int mapID)
    {
        int maxLine = 0;
        mapToMaxline.TryGetValue(mapID, out maxLine);
        return maxLine;
    }
 
}