协议新增
This commit is contained in:
97
Entity/Generate/ConfigTable/Entity/GoodsConfig.cs
Normal file
97
Entity/Generate/ConfigTable/Entity/GoodsConfig.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
using Fantasy;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
using Fantasy.Serialize;
|
||||
using NBF.ConfigTable;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
[ProtoContract]
|
||||
public sealed partial class GoodsConfig : ASerialize, IConfigTable
|
||||
{
|
||||
|
||||
[ProtoMember(1)]
|
||||
public uint Id { get; set; } // Id
|
||||
[ProtoMember(2)]
|
||||
public uint[] Shop { get; set; } = Array.Empty<uint>(); // 出现商店
|
||||
[ProtoMember(3)]
|
||||
public uint Group { get; set; } // 组
|
||||
[ProtoMember(4)]
|
||||
public string[] Items { get; set; } = Array.Empty<string>(); // 物品
|
||||
[ProtoMember(5)]
|
||||
public uint Price1 { get; set; } // 银币价格
|
||||
[ProtoMember(6)]
|
||||
public uint Price2 { get; set; } // 金币价格
|
||||
[ProtoMember(7)]
|
||||
public uint[] Label { get; set; } = Array.Empty<uint>(); // 标签
|
||||
[ProtoMember(8)]
|
||||
public uint Number { get; set; } // 可购买数量
|
||||
[ProtoMember(9)]
|
||||
public uint Disable { get; set; } // 禁用状态
|
||||
[ProtoIgnore]
|
||||
public uint Key => Id;
|
||||
|
||||
#region Static
|
||||
|
||||
private static ConfigContext<GoodsConfig> Context => ConfigTableHelper.Table<GoodsConfig>();
|
||||
|
||||
public static GoodsConfig Get(uint key)
|
||||
{
|
||||
return Context.Get(key);
|
||||
}
|
||||
|
||||
public static GoodsConfig Get(Predicate<GoodsConfig> match)
|
||||
{
|
||||
return Context.Get(match);
|
||||
}
|
||||
|
||||
public static GoodsConfig Fist()
|
||||
{
|
||||
return Context.Fist();
|
||||
}
|
||||
|
||||
public static GoodsConfig Last()
|
||||
{
|
||||
return Context.Last();
|
||||
}
|
||||
|
||||
public static GoodsConfig Fist(Predicate<GoodsConfig> match)
|
||||
{
|
||||
return Context.Fist(match);
|
||||
}
|
||||
|
||||
public static GoodsConfig Last(Predicate<GoodsConfig> match)
|
||||
{
|
||||
return Context.Last(match);
|
||||
}
|
||||
|
||||
public static int Count()
|
||||
{
|
||||
return Context.Count();
|
||||
}
|
||||
|
||||
public static int Count(Func<GoodsConfig, bool> predicate)
|
||||
{
|
||||
return Context.Count(predicate);
|
||||
}
|
||||
|
||||
public static List<GoodsConfig> GetList()
|
||||
{
|
||||
return Context.GetList();
|
||||
}
|
||||
|
||||
public static List<GoodsConfig> GetList(Predicate<GoodsConfig> match)
|
||||
{
|
||||
return Context.GetList(match);
|
||||
}
|
||||
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||
{
|
||||
ConfigTableHelper.ParseLine<GoodsConfig>(arr);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -31,9 +31,7 @@ namespace NBF
|
||||
[ProtoMember(8)]
|
||||
public uint Max { get; set; } // 最大堆叠数量
|
||||
[ProtoMember(9)]
|
||||
public uint AutoUse { get; set; } // 获得自动使用
|
||||
[ProtoMember(10)]
|
||||
public uint Deal { get; set; } // 交易类型
|
||||
public uint AutoUse { get; set; } // 获得自动使用
|
||||
[ProtoIgnore]
|
||||
public uint Key => Id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user