52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using Server.Git;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Server.SQL
|
|
{
|
|
public class ShopItemData
|
|
{
|
|
[Key]
|
|
public long index { get; set; }
|
|
public eBuyType buy_type { get; set; }
|
|
public int buy { get; set; }
|
|
public long reward { get; set; }
|
|
}
|
|
|
|
public enum eBuyType
|
|
{
|
|
gold = 1,
|
|
cash,
|
|
money
|
|
}
|
|
|
|
public class ShopItemDataExcel
|
|
{
|
|
private Dictionary<long, ShopItemData> shopItemData;
|
|
|
|
public string sheetName = "ShopItemData";
|
|
|
|
public ShopItemData getShopItemData(long key)
|
|
{
|
|
return shopItemData[key];
|
|
}
|
|
|
|
public List<ShopItemData> getShopItemData()
|
|
{
|
|
return shopItemData.Values.ToList();
|
|
}
|
|
public void init(Sheet data)
|
|
{
|
|
this.shopItemData = new Dictionary<long, ShopItemData>();
|
|
foreach (var item in data.dicViewer)
|
|
{
|
|
ShopItemData shopItemData = new ShopItemData();
|
|
shopItemData.index = item.Key;
|
|
shopItemData.buy_type = (eBuyType)item.Value["buy_type"];
|
|
shopItemData.buy = (int)item.Value["buy"];
|
|
shopItemData.reward = (long)item.Value["reward"];
|
|
this.shopItemData.Add(item.Key, shopItemData);
|
|
}
|
|
}
|
|
}
|
|
}
|