更新编辑器MenuItem导表与导出协议

更新编辑器MenuItem导表与导出协议
This commit is contained in:
ALEXTANGXIAO
2023-07-29 00:03:54 +08:00
parent 30192d52cf
commit 98dcb80942
29 changed files with 217 additions and 1018 deletions

View File

@@ -25,8 +25,8 @@ public sealed class Exporter
LogInfo("请输入你想要做的操作:");
LogInfo("1:导出网络协议ProtoBuf");
LogInfo("2:增量导出Excel包含常量枚举");
LogInfo("3:全量导出Excel包含常量枚举");
LogInfo("2:增量导出服务器启动Excel包含常量枚举");
LogInfo("3:全量导出服务器启动Excel包含常量枚举");
var keyChar = Console.ReadKey().KeyChar;

View File

@@ -7,46 +7,29 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
{
public sealed partial class BuffAttrConfig : Bright.Config.BeanBase
{
public BuffAttrConfig(JSONNode _json)
public BuffAttrConfig(ByteBuf _buf)
{
{ if(!_json["BuffID"].IsNumber) { throw new SerializationException(); } BuffID = _json["BuffID"]; }
{ if(!_json["name"].IsString) { throw new SerializationException(); } Name = _json["name"]; }
{ if(!_json["StackNum"].IsNumber) { throw new SerializationException(); } StackNum = _json["StackNum"]; }
{ if(!_json["DurTime"].IsNumber) { throw new SerializationException(); } DurTime = _json["DurTime"]; }
{ if(!_json["ResultType"].IsNumber) { throw new SerializationException(); } ResultType = (Battle.BuffResultType)_json["ResultType"].AsInt; }
{ if(!_json["RemoveWhenDie"].IsNumber) { throw new SerializationException(); } RemoveWhenDie = _json["RemoveWhenDie"]; }
{ if(!_json["DotDamageData"].IsObject) { throw new SerializationException(); } DotDamageData = Battle.SkillAttrDamageData.DeserializeSkillAttrDamageData(_json["DotDamageData"]); }
{ if(!_json["DotTickConfig"].IsObject) { throw new SerializationException(); } DotTickConfig = Battle.BuffDotTickConfig.DeserializeBuffDotTickConfig(_json["DotTickConfig"]); }
{ var __json0 = _json["AttrData"]; if(!__json0.IsArray) { throw new SerializationException(); } AttrData = new System.Collections.Generic.List<Battle.ResAttrImpactData>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { Battle.ResAttrImpactData __v0; { if(!__e0.IsObject) { throw new SerializationException(); } __v0 = Battle.ResAttrImpactData.DeserializeResAttrImpactData(__e0); } AttrData.Add(__v0); } }
BuffID = _buf.ReadInt();
Name = _buf.ReadString();
StackNum = _buf.ReadInt();
DurTime = _buf.ReadFloat();
ResultType = (Battle.BuffResultType)_buf.ReadInt();
RemoveWhenDie = _buf.ReadInt();
DotDamageData = Battle.SkillAttrDamageData.DeserializeSkillAttrDamageData(_buf);
DotTickConfig = Battle.BuffDotTickConfig.DeserializeBuffDotTickConfig(_buf);
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);AttrData = new System.Collections.Generic.List<Battle.ResAttrImpactData>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { Battle.ResAttrImpactData _e0; _e0 = Battle.ResAttrImpactData.DeserializeResAttrImpactData(_buf); AttrData.Add(_e0);}}
PostInit();
}
public BuffAttrConfig(int BuffID, string name, int StackNum, float DurTime, Battle.BuffResultType ResultType, int RemoveWhenDie, Battle.SkillAttrDamageData DotDamageData, Battle.BuffDotTickConfig DotTickConfig, System.Collections.Generic.List<Battle.ResAttrImpactData> AttrData )
public static BuffAttrConfig DeserializeBuffAttrConfig(ByteBuf _buf)
{
this.BuffID = BuffID;
this.Name = name;
this.StackNum = StackNum;
this.DurTime = DurTime;
this.ResultType = ResultType;
this.RemoveWhenDie = RemoveWhenDie;
this.DotDamageData = DotDamageData;
this.DotTickConfig = DotTickConfig;
this.AttrData = AttrData;
PostInit();
}
public static BuffAttrConfig DeserializeBuffAttrConfig(JSONNode _json)
{
return new Battle.BuffAttrConfig(_json);
return new Battle.BuffAttrConfig(_buf);
}
/// <summary>
@@ -113,4 +96,5 @@ public sealed partial class BuffAttrConfig : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,44 +7,28 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
{
public sealed partial class BuffConfig : Bright.Config.BeanBase
{
public BuffConfig(JSONNode _json)
public BuffConfig(ByteBuf _buf)
{
{ if(!_json["BuffID"].IsNumber) { throw new SerializationException(); } BuffID = _json["BuffID"]; }
{ if(!_json["name"].IsString) { throw new SerializationException(); } Name = _json["name"]; }
{ if(!_json["prefId"].IsNumber) { throw new SerializationException(); } PrefId = _json["prefId"]; }
{ if(!_json["desc"].IsString) { throw new SerializationException(); } Desc = _json["desc"]; }
{ if(!_json["icon"].IsString) { throw new SerializationException(); } Icon = _json["icon"]; }
{ if(!_json["TimeType"].IsNumber) { throw new SerializationException(); } TimeType = (Battle.BuffTimeType)_json["TimeType"].AsInt; }
{ if(!_json["ReplaceType"].IsNumber) { throw new SerializationException(); } ReplaceType = (Battle.BuffReplaceType)_json["ReplaceType"].AsInt; }
{ if(!_json["State"].IsObject) { throw new SerializationException(); } State = Battle.BuffTriggleState.DeserializeBuffTriggleState(_json["State"]); }
BuffID = _buf.ReadInt();
Name = _buf.ReadString();
PrefId = _buf.ReadInt();
Desc = _buf.ReadString();
Icon = _buf.ReadString();
TimeType = (Battle.BuffTimeType)_buf.ReadInt();
ReplaceType = (Battle.BuffReplaceType)_buf.ReadInt();
State = Battle.BuffTriggleState.DeserializeBuffTriggleState(_buf);
PostInit();
}
public BuffConfig(int BuffID, string name, int prefId, string desc, string icon, Battle.BuffTimeType TimeType, Battle.BuffReplaceType ReplaceType, Battle.BuffTriggleState State )
public static BuffConfig DeserializeBuffConfig(ByteBuf _buf)
{
this.BuffID = BuffID;
this.Name = name;
this.PrefId = prefId;
this.Desc = desc;
this.Icon = icon;
this.TimeType = TimeType;
this.ReplaceType = ReplaceType;
this.State = State;
PostInit();
}
public static BuffConfig DeserializeBuffConfig(JSONNode _json)
{
return new Battle.BuffConfig(_json);
return new Battle.BuffConfig(_buf);
}
/// <summary>
@@ -108,4 +92,5 @@ public sealed partial class BuffConfig : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,32 +7,22 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
{
public sealed partial class BuffDotTickConfig : Bright.Config.BeanBase
{
public BuffDotTickConfig(JSONNode _json)
public BuffDotTickConfig(ByteBuf _buf)
{
{ if(!_json["TickTime"].IsNumber) { throw new SerializationException(); } TickTime = _json["TickTime"]; }
{ if(!_json["TickWhenAdd"].IsNumber) { throw new SerializationException(); } TickWhenAdd = _json["TickWhenAdd"]; }
TickTime = _buf.ReadFloat();
TickWhenAdd = _buf.ReadInt();
PostInit();
}
public BuffDotTickConfig(float TickTime, int TickWhenAdd )
public static BuffDotTickConfig DeserializeBuffDotTickConfig(ByteBuf _buf)
{
this.TickTime = TickTime;
this.TickWhenAdd = TickWhenAdd;
PostInit();
}
public static BuffDotTickConfig DeserializeBuffDotTickConfig(JSONNode _json)
{
return new Battle.BuffDotTickConfig(_json);
return new Battle.BuffDotTickConfig(_buf);
}
public float TickTime { get; private set; }
@@ -61,4 +51,5 @@ public sealed partial class BuffDotTickConfig : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,32 +7,22 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
{
public sealed partial class BuffTriggleState : Bright.Config.BeanBase
{
public BuffTriggleState(JSONNode _json)
public BuffTriggleState(ByteBuf _buf)
{
{ if(!_json["StateID"].IsNumber) { throw new SerializationException(); } StateID = (Battle.BuffStateID)_json["StateID"].AsInt; }
{ if(!_json["StateParam"].IsNumber) { throw new SerializationException(); } StateParam = _json["StateParam"]; }
StateID = (Battle.BuffStateID)_buf.ReadInt();
StateParam = _buf.ReadFloat();
PostInit();
}
public BuffTriggleState(Battle.BuffStateID StateID, float StateParam )
public static BuffTriggleState DeserializeBuffTriggleState(ByteBuf _buf)
{
this.StateID = StateID;
this.StateParam = StateParam;
PostInit();
}
public static BuffTriggleState DeserializeBuffTriggleState(JSONNode _json)
{
return new Battle.BuffTriggleState(_json);
return new Battle.BuffTriggleState(_buf);
}
public Battle.BuffStateID StateID { get; private set; }
@@ -61,4 +51,5 @@ public sealed partial class BuffTriggleState : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,34 +7,23 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
{
public sealed partial class ResAttrImpactData : Bright.Config.BeanBase
{
public ResAttrImpactData(JSONNode _json)
public ResAttrImpactData(ByteBuf _buf)
{
{ if(!_json["DataType"].IsNumber) { throw new SerializationException(); } DataType = (Battle.ActorAttrDataType)_json["DataType"].AsInt; }
{ if(!_json["AddType"].IsNumber) { throw new SerializationException(); } AddType = (Battle.ActorAttrAddType)_json["AddType"].AsInt; }
{ if(!_json["Value"].IsNumber) { throw new SerializationException(); } Value = _json["Value"]; }
DataType = (Battle.ActorAttrDataType)_buf.ReadInt();
AddType = (Battle.ActorAttrAddType)_buf.ReadInt();
Value = _buf.ReadFloat();
PostInit();
}
public ResAttrImpactData(Battle.ActorAttrDataType DataType, Battle.ActorAttrAddType AddType, float Value )
public static ResAttrImpactData DeserializeResAttrImpactData(ByteBuf _buf)
{
this.DataType = DataType;
this.AddType = AddType;
this.Value = Value;
PostInit();
}
public static ResAttrImpactData DeserializeResAttrImpactData(JSONNode _json)
{
return new Battle.ResAttrImpactData(_json);
return new Battle.ResAttrImpactData(_buf);
}
public Battle.ActorAttrDataType DataType { get; private set; }
@@ -65,4 +54,5 @@ public sealed partial class ResAttrImpactData : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,40 +7,26 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
{
public sealed partial class SkillAttrDamageData : Bright.Config.BeanBase
{
public SkillAttrDamageData(JSONNode _json)
public SkillAttrDamageData(ByteBuf _buf)
{
{ if(!_json["MagicType"].IsNumber) { throw new SerializationException(); } MagicType = (Battle.SkillMagicType)_json["MagicType"].AsInt; }
{ if(!_json["AttrType"].IsNumber) { throw new SerializationException(); } AttrType = (Battle.SkillAttrDamageType)_json["AttrType"].AsInt; }
{ if(!_json["Param1"].IsNumber) { throw new SerializationException(); } Param1 = _json["Param1"]; }
{ if(!_json["Param2"].IsNumber) { throw new SerializationException(); } Param2 = _json["Param2"]; }
{ if(!_json["Param3"].IsNumber) { throw new SerializationException(); } Param3 = _json["Param3"]; }
{ if(!_json["MaxLimit"].IsNumber) { throw new SerializationException(); } MaxLimit = _json["MaxLimit"]; }
MagicType = (Battle.SkillMagicType)_buf.ReadInt();
AttrType = (Battle.SkillAttrDamageType)_buf.ReadInt();
Param1 = _buf.ReadFloat();
Param2 = _buf.ReadFloat();
Param3 = _buf.ReadFloat();
MaxLimit = _buf.ReadFloat();
PostInit();
}
public SkillAttrDamageData(Battle.SkillMagicType MagicType, Battle.SkillAttrDamageType AttrType, float Param1, float Param2, float Param3, float MaxLimit )
public static SkillAttrDamageData DeserializeSkillAttrDamageData(ByteBuf _buf)
{
this.MagicType = MagicType;
this.AttrType = AttrType;
this.Param1 = Param1;
this.Param2 = Param2;
this.Param3 = Param3;
this.MaxLimit = MaxLimit;
PostInit();
}
public static SkillAttrDamageData DeserializeSkillAttrDamageData(JSONNode _json)
{
return new Battle.SkillAttrDamageData(_json);
return new Battle.SkillAttrDamageData(_buf);
}
public Battle.SkillMagicType MagicType { get; private set; }
@@ -77,4 +63,5 @@ public sealed partial class SkillAttrDamageData : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,50 +7,31 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
{
public sealed partial class SkillBaseConfig : Bright.Config.BeanBase
{
public SkillBaseConfig(JSONNode _json)
public SkillBaseConfig(ByteBuf _buf)
{
{ if(!_json["id"].IsNumber) { throw new SerializationException(); } Id = _json["id"]; }
{ if(!_json["name"].IsString) { throw new SerializationException(); } Name = _json["name"]; }
{ if(!_json["SkillDispID"].IsNumber) { throw new SerializationException(); } SkillDispID = _json["SkillDispID"]; }
{ if(!_json["SkillType"].IsNumber) { throw new SerializationException(); } SkillType = _json["SkillType"]; }
{ if(!_json["desc"].IsString) { throw new SerializationException(); } Desc = _json["desc"]; }
{ if(!_json["CostMP"].IsNumber) { throw new SerializationException(); } CostMP = _json["CostMP"]; }
{ if(!_json["GCDID"].IsNumber) { throw new SerializationException(); } GCDID = _json["GCDID"]; }
{ if(!_json["SkillCD"].IsNumber) { throw new SerializationException(); } SkillCD = _json["SkillCD"]; }
{ if(!_json["IsRepeatTrigger"].IsBoolean) { throw new SerializationException(); } IsRepeatTrigger = _json["IsRepeatTrigger"]; }
{ var __json0 = _json["BuffID"]; if(!__json0.IsArray) { throw new SerializationException(); } BuffID = new System.Collections.Generic.List<int>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } BuffID.Add(__v0); } }
{ var __json0 = _json["AttrDamageData"]; if(!__json0.IsArray) { throw new SerializationException(); } AttrDamageData = new System.Collections.Generic.List<Battle.SkillAttrDamageData>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { Battle.SkillAttrDamageData __v0; { if(!__e0.IsObject) { throw new SerializationException(); } __v0 = Battle.SkillAttrDamageData.DeserializeSkillAttrDamageData(__e0); } AttrDamageData.Add(__v0); } }
Id = _buf.ReadInt();
Name = _buf.ReadString();
SkillDispID = _buf.ReadInt();
SkillType = _buf.ReadInt();
Desc = _buf.ReadString();
CostMP = _buf.ReadInt();
GCDID = _buf.ReadInt();
SkillCD = _buf.ReadFloat();
IsRepeatTrigger = _buf.ReadBool();
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);BuffID = new System.Collections.Generic.List<int>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { int _e0; _e0 = _buf.ReadInt(); BuffID.Add(_e0);}}
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);AttrDamageData = new System.Collections.Generic.List<Battle.SkillAttrDamageData>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { Battle.SkillAttrDamageData _e0; _e0 = Battle.SkillAttrDamageData.DeserializeSkillAttrDamageData(_buf); AttrDamageData.Add(_e0);}}
PostInit();
}
public SkillBaseConfig(int id, string name, int SkillDispID, int SkillType, string desc, int CostMP, int GCDID, float SkillCD, bool IsRepeatTrigger, System.Collections.Generic.List<int> BuffID, System.Collections.Generic.List<Battle.SkillAttrDamageData> AttrDamageData )
public static SkillBaseConfig DeserializeSkillBaseConfig(ByteBuf _buf)
{
this.Id = id;
this.Name = name;
this.SkillDispID = SkillDispID;
this.SkillType = SkillType;
this.Desc = desc;
this.CostMP = CostMP;
this.GCDID = GCDID;
this.SkillCD = SkillCD;
this.IsRepeatTrigger = IsRepeatTrigger;
this.BuffID = BuffID;
this.AttrDamageData = AttrDamageData;
PostInit();
}
public static SkillBaseConfig DeserializeSkillBaseConfig(JSONNode _json)
{
return new Battle.SkillBaseConfig(_json);
return new Battle.SkillBaseConfig(_buf);
}
/// <summary>
@@ -129,4 +110,5 @@ public sealed partial class SkillBaseConfig : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,26 +7,25 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
public sealed partial class TbBuff
{
public partial class TbBuff
{
private readonly Dictionary<int, Battle.BuffConfig> _dataMap;
private readonly List<Battle.BuffConfig> _dataList;
public TbBuff(JSONNode _json)
public TbBuff(ByteBuf _buf)
{
_dataMap = new Dictionary<int, Battle.BuffConfig>();
_dataList = new List<Battle.BuffConfig>();
foreach(JSONNode _row in _json.Children)
for(int n = _buf.ReadSize() ; n > 0 ; --n)
{
var _v = Battle.BuffConfig.DeserializeBuffConfig(_row);
Battle.BuffConfig _v;
_v = Battle.BuffConfig.DeserializeBuffConfig(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.BuffID, _v);
}
@@ -57,7 +56,6 @@ public sealed partial class TbBuff
}
}
partial void PostInit();
partial void PostResolve();
}

View File

@@ -7,26 +7,25 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
public sealed partial class TbBuffAttr
{
public partial class TbBuffAttr
{
private readonly Dictionary<int, Battle.BuffAttrConfig> _dataMap;
private readonly List<Battle.BuffAttrConfig> _dataList;
public TbBuffAttr(JSONNode _json)
public TbBuffAttr(ByteBuf _buf)
{
_dataMap = new Dictionary<int, Battle.BuffAttrConfig>();
_dataList = new List<Battle.BuffAttrConfig>();
foreach(JSONNode _row in _json.Children)
for(int n = _buf.ReadSize() ; n > 0 ; --n)
{
var _v = Battle.BuffAttrConfig.DeserializeBuffAttrConfig(_row);
Battle.BuffAttrConfig _v;
_v = Battle.BuffAttrConfig.DeserializeBuffAttrConfig(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.BuffID, _v);
}
@@ -57,7 +56,6 @@ public sealed partial class TbBuffAttr
}
}
partial void PostInit();
partial void PostResolve();
}

View File

@@ -7,26 +7,25 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.Battle
{
public sealed partial class TbSkill
{
public partial class TbSkill
{
private readonly Dictionary<int, Battle.SkillBaseConfig> _dataMap;
private readonly List<Battle.SkillBaseConfig> _dataList;
public TbSkill(JSONNode _json)
public TbSkill(ByteBuf _buf)
{
_dataMap = new Dictionary<int, Battle.SkillBaseConfig>();
_dataList = new List<Battle.SkillBaseConfig>();
foreach(JSONNode _row in _json.Children)
for(int n = _buf.ReadSize() ; n > 0 ; --n)
{
var _v = Battle.SkillBaseConfig.DeserializeSkillBaseConfig(_row);
Battle.SkillBaseConfig _v;
_v = Battle.SkillBaseConfig.DeserializeSkillBaseConfig(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.Id, _v);
}
@@ -57,7 +56,6 @@ public sealed partial class TbSkill
}
}
partial void PostInit();
partial void PostResolve();
}

View File

@@ -6,20 +6,19 @@
// </auto-generated>
//------------------------------------------------------------------------------
using Bright.Serialization;
using SimpleJSON;
namespace GameConfig
{
public sealed partial class Tables
public partial class Tables
{
public item.TbItem TbItem {get; }
public Battle.TbSkill TbSkill {get; }
public Battle.TbBuff TbBuff {get; }
public Battle.TbBuffAttr TbBuffAttr {get; }
public Tables(System.Func<string, JSONNode> loader)
public Tables(System.Func<string, ByteBuf> loader)
{
var tables = new System.Collections.Generic.Dictionary<string, object>();
TbItem = new item.TbItem(loader("item_tbitem"));
@@ -30,8 +29,8 @@ public sealed partial class Tables
tables.Add("Battle.TbBuff", TbBuff);
TbBuffAttr = new Battle.TbBuffAttr(loader("battle_tbbuffattr"));
tables.Add("Battle.TbBuffAttr", TbBuffAttr);
PostInit();
PostInit();
TbItem.Resolve(tables);
TbSkill.Resolve(tables);
TbBuff.Resolve(tables);

View File

@@ -7,50 +7,31 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.item
{
{
public sealed partial class Item : Bright.Config.BeanBase
{
public Item(JSONNode _json)
public Item(ByteBuf _buf)
{
{ if(!_json["id"].IsNumber) { throw new SerializationException(); } Id = _json["id"]; }
{ if(!_json["name"].IsString) { throw new SerializationException(); } Name = _json["name"]; }
{ if(!_json["desc"].IsString) { throw new SerializationException(); } Desc = _json["desc"]; }
{ if(!_json["price"].IsNumber) { throw new SerializationException(); } Price = _json["price"]; }
{ if(!_json["upgrade_to_item_id"].IsNumber) { throw new SerializationException(); } UpgradeToItemId = _json["upgrade_to_item_id"]; }
{ var _j = _json["expire_time"]; if (_j.Tag != JSONNodeType.None && _j.Tag != JSONNodeType.NullValue) { { if(!_j.IsNumber) { throw new SerializationException(); } ExpireTime = _j; } } else { ExpireTime = null; } }
{ if(!_json["batch_useable"].IsBoolean) { throw new SerializationException(); } BatchUseable = _json["batch_useable"]; }
{ if(!_json["quality"].IsNumber) { throw new SerializationException(); } Quality = (item.EQuality)_json["quality"].AsInt; }
{ if(!_json["exchange_stream"].IsObject) { throw new SerializationException(); } ExchangeStream = item.ItemExchange.DeserializeItemExchange(_json["exchange_stream"]); }
{ var __json0 = _json["exchange_list"]; if(!__json0.IsArray) { throw new SerializationException(); } ExchangeList = new System.Collections.Generic.List<item.ItemExchange>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { item.ItemExchange __v0; { if(!__e0.IsObject) { throw new SerializationException(); } __v0 = item.ItemExchange.DeserializeItemExchange(__e0); } ExchangeList.Add(__v0); } }
{ if(!_json["exchange_column"].IsObject) { throw new SerializationException(); } ExchangeColumn = item.ItemExchange.DeserializeItemExchange(_json["exchange_column"]); }
Id = _buf.ReadInt();
Name = _buf.ReadString();
Desc = _buf.ReadString();
Price = _buf.ReadInt();
UpgradeToItemId = _buf.ReadInt();
if(_buf.ReadBool()){ ExpireTime = _buf.ReadInt(); } else { ExpireTime = null; }
BatchUseable = _buf.ReadBool();
Quality = (item.EQuality)_buf.ReadInt();
ExchangeStream = item.ItemExchange.DeserializeItemExchange(_buf);
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);ExchangeList = new System.Collections.Generic.List<item.ItemExchange>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { item.ItemExchange _e0; _e0 = item.ItemExchange.DeserializeItemExchange(_buf); ExchangeList.Add(_e0);}}
ExchangeColumn = item.ItemExchange.DeserializeItemExchange(_buf);
PostInit();
}
public Item(int id, string name, string desc, int price, int upgrade_to_item_id, int? expire_time, bool batch_useable, item.EQuality quality, item.ItemExchange exchange_stream, System.Collections.Generic.List<item.ItemExchange> exchange_list, item.ItemExchange exchange_column )
public static Item DeserializeItem(ByteBuf _buf)
{
this.Id = id;
this.Name = name;
this.Desc = desc;
this.Price = price;
this.UpgradeToItemId = upgrade_to_item_id;
this.ExpireTime = expire_time;
this.BatchUseable = batch_useable;
this.Quality = quality;
this.ExchangeStream = exchange_stream;
this.ExchangeList = exchange_list;
this.ExchangeColumn = exchange_column;
PostInit();
}
public static Item DeserializeItem(JSONNode _json)
{
return new item.Item(_json);
return new item.Item(_buf);
}
/// <summary>
@@ -135,4 +116,5 @@ public sealed partial class Item : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,32 +7,22 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.item
{
{
public sealed partial class ItemExchange : Bright.Config.BeanBase
{
public ItemExchange(JSONNode _json)
public ItemExchange(ByteBuf _buf)
{
{ if(!_json["id"].IsNumber) { throw new SerializationException(); } Id = _json["id"]; }
{ if(!_json["num"].IsNumber) { throw new SerializationException(); } Num = _json["num"]; }
Id = _buf.ReadInt();
Num = _buf.ReadInt();
PostInit();
}
public ItemExchange(int id, int num )
public static ItemExchange DeserializeItemExchange(ByteBuf _buf)
{
this.Id = id;
this.Num = num;
PostInit();
}
public static ItemExchange DeserializeItemExchange(JSONNode _json)
{
return new item.ItemExchange(_json);
return new item.ItemExchange(_buf);
}
/// <summary>
@@ -67,4 +57,5 @@ public sealed partial class ItemExchange : Bright.Config.BeanBase
partial void PostInit();
partial void PostResolve();
}
}
}

View File

@@ -7,26 +7,25 @@
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace GameConfig.item
{
public sealed partial class TbItem
{
public partial class TbItem
{
private readonly Dictionary<int, item.Item> _dataMap;
private readonly List<item.Item> _dataList;
public TbItem(JSONNode _json)
public TbItem(ByteBuf _buf)
{
_dataMap = new Dictionary<int, item.Item>();
_dataList = new List<item.Item>();
foreach(JSONNode _row in _json.Children)
for(int n = _buf.ReadSize() ; n > 0 ; --n)
{
var _v = item.Item.DeserializeItem(_row);
item.Item _v;
_v = item.Item.DeserializeItem(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.Id, _v);
}
@@ -57,7 +56,6 @@ public sealed partial class TbItem
}
}
partial void PostInit();
partial void PostResolve();
}