97 lines
2.5 KiB
C#
97 lines
2.5 KiB
C#
using System;
|
|
using LightProto;
|
|
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
|
|
}
|
|
} |