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 consumableItemData; public string sheetName = "ConsumableItemData"; public ConsumableItemData getConsumableItemData(long key) { return consumableItemData[key]; } public List getConsumableItemData() { return consumableItemData.Values.ToList(); } public void init(Sheet data) { this.consumableItemData = new Dictionary(); foreach (var item in data.dicViewer) { ConsumableItemData consumableItemData = new ConsumableItemData(); consumableItemData.index = item.Key; consumableItemData.name = (string)item.Value["name"]; consumableItemData.item_type = (eItemType)item.Value["item_type"]; consumableItemData.reward = item.Value["reward"].ToString(); this.consumableItemData.Add(item.Key, consumableItemData); } } } }