| | |
| | | using System.Collections.Generic; |
| | | public partial class ADAwardConfig : ConfigBase<int, ADAwardConfig> |
| | | { |
| | | private static Dictionary<int, int> idDict = new Dictionary<int, int>(); |
| | | private static Dictionary<Int2, ADAwardConfig> idDict = new Dictionary<Int2, ADAwardConfig>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | idDict[ADMapID] = ADID; |
| | | |
| | | idDict[new Int2(ADAwardType, ADAwardValue)] = this; |
| | | } |
| | | public static bool TryGetADIDByADMapID(int ADMapID, out int ADID) |
| | | |
| | | public static bool TryGetADIDByTypeValue(int type, int value, out ADAwardConfig config) |
| | | { |
| | | return idDict.TryGetValue(ADMapID, out ADID) && ADID > 0; |
| | | if (idDict.TryGetValue(new Int2(type, value), out config)) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |