CTT/Server/Model/Generate/Data/Partial/TransferJobConfigCategory.C...

35 lines
1016 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using System;
using System.Collections.Generic;
namespace Cal.DataTable
{
public partial class TransferJobConfigCategory
{
public enum TransferJobType
{
None,
Skill,
Item
}
/// <summary>
/// key.key = type,key.value = element of arr,value = id
/// </summary>
private Dictionary<KeyValuePair<TransferJobType, int>, int> dic = new();
public TransferJobConfig Get(TransferJobType transferJobType,int skillIdOrItemId)
{
dic.TryGetValue(KeyValuePair.Create(transferJobType, skillIdOrItemId), out var configid);
return Get(configid);
}
public override void EndInit()
{
foreach (var config in this.dict.Values)
{
foreach (var item in config.ids)
{
dic.Add(KeyValuePair.Create((TransferJobType)config.Type, item), (int)config.Id);
}
}
}
}
}