Files
Fishing2/Assets/Scripts/Generate/Config/GoodsConfig.cs
2025-11-23 10:46:34 +08:00

101 lines
2.6 KiB
C#

using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using NBC;
using Fantasy.Serialize;
namespace NBF
{
[ProtoContract]
public sealed partial class GoodsConfig : ASerialize, IConfigTable
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public uint Type { get; set; } // 子类型
[ProtoMember(3)]
public uint[] Shop { get; set; } = Array.Empty<uint>(); // 出现商店
[ProtoMember(4)]
public uint Group { get; set; } // 组
[ProtoMember(5)]
public uint[] Items { get; set; } = Array.Empty<uint>(); // 物品
[ProtoMember(6)]
public uint Amount { get; set; } // 获得数量
[ProtoMember(7)]
public uint Price1 { get; set; } // 银币价格
[ProtoMember(8)]
public uint Price2 { get; set; } // 金币价格
[ProtoMember(9)]
public uint[] Label { get; set; } = Array.Empty<uint>(); // 标签
[ProtoMember(10)]
public uint Number { get; set; } // 可购买数量
[ProtoMember(11)]
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
}
}