50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using Server.Git;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Server.SQL
|
|
{
|
|
public class ConsumableItemData
|
|
{
|
|
[Key]
|
|
public long index { get; set; }
|
|
public string name { get; set; }
|
|
public eItemType item_type { get; set; }
|
|
public string reward { get; set; }
|
|
}
|
|
|
|
public enum eItemType
|
|
{
|
|
exp = 1,
|
|
package,
|
|
random
|
|
}
|
|
|
|
public class ConsumableItemDataExcel
|
|
{
|
|
private Dictionary<long, ConsumableItemData> consumableItemData;
|
|
|
|
public string sheetName = "ConsumableItemData";
|
|
|
|
public ConsumableItemData getConsumableItemData(long key)
|
|
{
|
|
return consumableItemData[key];
|
|
}
|
|
|
|
public List<ConsumableItemData> getConsumableItemData()
|
|
{
|
|
return consumableItemData.Values.ToList();
|
|
}
|
|
public void init(sheet data)
|
|
{
|
|
this.consumableItemData = new Dictionary<long, ConsumableItemData>();
|
|
foreach (var item in data.dicViewer)
|
|
{
|
|
//ConsumableItemData ConsumableItemData = new ConsumableItemData();
|
|
//ConsumableItemData.index = item.Key;
|
|
//ConsumableItemData.part = (int)item.Value["part"];
|
|
//this.ConsumableItemData.Add(item.Key, ConsumableItemData);
|
|
}
|
|
}
|
|
}
|
|
}
|