//--------------------------------------------------------
|
// [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;
|
}
|
|
}
|