Files
Fishing2Server/Entity/Generate/ConfigTable/Entity/InitConfig.cs
2026-01-18 16:37:46 +08:00

83 lines
1.9 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 InitConfig : ASerialize, IConfigTable
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public int Amount { get; set; } // 数量
[ProtoIgnore]
public uint Key => Id;
#region Static
private static ConfigContext<InitConfig> Context => ConfigTableHelper.Table<InitConfig>();
public static InitConfig Get(uint key)
{
return Context.Get(key);
}
public static InitConfig Get(Predicate<InitConfig> match)
{
return Context.Get(match);
}
public static InitConfig Fist()
{
return Context.Fist();
}
public static InitConfig Last()
{
return Context.Last();
}
public static InitConfig Fist(Predicate<InitConfig> match)
{
return Context.Fist(match);
}
public static InitConfig Last(Predicate<InitConfig> match)
{
return Context.Last(match);
}
public static int Count()
{
return Context.Count();
}
public static int Count(Func<InitConfig, bool> predicate)
{
return Context.Count(predicate);
}
public static List<InitConfig> GetList()
{
return Context.GetList();
}
public static List<InitConfig> GetList(Predicate<InitConfig> match)
{
return Context.GetList(match);
}
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
{
ConfigTableHelper.ParseLine<InitConfig>(arr);
}
#endregion
}
}