重新导表
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -17,8 +17,6 @@ namespace NBF
|
|||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public uint Id { get; set; } // Id
|
public uint Id { get; set; } // Id
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
public uint ItemId { get; set; } // 物品Id
|
|
||||||
[ProtoMember(3)]
|
|
||||||
public int Amount { get; set; } // 数量
|
public int Amount { get; set; } // 数量
|
||||||
[ProtoIgnore]
|
[ProtoIgnore]
|
||||||
public uint Key => Id;
|
public uint Key => Id;
|
||||||
|
|||||||
85
Entity/Generate/ConfigTable/Entity/RodRingConfig.cs
Normal file
85
Entity/Generate/ConfigTable/Entity/RodRingConfig.cs
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
using System;
|
||||||
|
using ProtoBuf;
|
||||||
|
using Fantasy;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using Fantasy.Serialize;
|
||||||
|
using Fantasy.ConfigTable;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[ProtoContract]
|
||||||
|
public sealed partial class RodRingConfig : ASerialize, IProto, IConfigTable
|
||||||
|
{
|
||||||
|
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public uint Id { get; set; } // Id
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public string Model { get; set; } // 模型
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public uint Strength { get; set; } // 强度
|
||||||
|
[ProtoIgnore]
|
||||||
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<RodRingConfig> Context => ConfigTableHelper.Table<RodRingConfig>();
|
||||||
|
|
||||||
|
public static RodRingConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodRingConfig Get(Predicate<RodRingConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodRingConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodRingConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodRingConfig Fist(Predicate<RodRingConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodRingConfig Last(Predicate<RodRingConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<RodRingConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<RodRingConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<RodRingConfig> GetList(Predicate<RodRingConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<RodRingConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -162,20 +162,20 @@ public static class PlayerManageComponentSystem
|
|||||||
addDic = new Dictionary<ItemBasicType, Dictionary<uint, int>>();
|
addDic = new Dictionary<ItemBasicType, Dictionary<uint, int>>();
|
||||||
foreach (var initConfig in list)
|
foreach (var initConfig in list)
|
||||||
{
|
{
|
||||||
var itemType = ItemHelper.GetType(initConfig.ItemId);
|
var itemType = ItemHelper.GetType(initConfig.Id);
|
||||||
if (!addDic.TryGetValue(itemType, out var dic))
|
if (!addDic.TryGetValue(itemType, out var dic))
|
||||||
{
|
{
|
||||||
dic = new Dictionary<uint, int>();
|
dic = new Dictionary<uint, int>();
|
||||||
addDic.Add(itemType, dic);
|
addDic.Add(itemType, dic);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dic.ContainsKey(initConfig.ItemId))
|
if (!dic.ContainsKey(initConfig.Id))
|
||||||
{
|
{
|
||||||
dic.Add(initConfig.ItemId, initConfig.Amount);
|
dic.Add(initConfig.Id, initConfig.Amount);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dic[initConfig.ItemId] += initConfig.Amount;
|
dic[initConfig.Id] += initConfig.Amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user