//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
using Luban;
using SimpleJSON;
namespace cfg
{
public sealed partial class Goods : Luban.BeanBase
{
public Goods(JSONNode _buf)
{
{ if(!_buf["id"].IsNumber) { throw new SerializationException(); } Id = _buf["id"]; }
{ var __json0 = _buf["shop"]; if(!__json0.IsArray) { throw new SerializationException(); } Shop = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Shop.Add(__v0); } }
{ if(!_buf["group"].IsNumber) { throw new SerializationException(); } Group = _buf["group"]; }
{ var __json0 = _buf["items"]; if(!__json0.IsArray) { throw new SerializationException(); } Items = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Items.Add(__v0); } }
{ if(!_buf["price1"].IsNumber) { throw new SerializationException(); } Price1 = _buf["price1"]; }
{ if(!_buf["price2"].IsNumber) { throw new SerializationException(); } Price2 = _buf["price2"]; }
{ var __json0 = _buf["label"]; if(!__json0.IsArray) { throw new SerializationException(); } Label = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Label.Add(__v0); } }
{ if(!_buf["number"].IsNumber) { throw new SerializationException(); } Number = _buf["number"]; }
{ if(!_buf["disable"].IsNumber) { throw new SerializationException(); } Disable = _buf["disable"]; }
}
public static Goods DeserializeGoods(JSONNode _buf)
{
return new Goods(_buf);
}
///
/// Id
///
public readonly int Id;
///
/// 出现商店
///
public readonly System.Collections.Generic.List Shop;
///
/// 组
///
public readonly int Group;
///
/// 物品
///
public readonly System.Collections.Generic.List Items;
///
/// 银币价格
///
public readonly int Price1;
///
/// 金币价格
///
public readonly int Price2;
///
/// 标签
///
public readonly System.Collections.Generic.List Label;
///
/// 可购买数量
///
public readonly int Number;
///
/// 禁用状态
///
public readonly int Disable;
public const int __ID__ = 68986678;
public override int GetTypeId() => __ID__;
public void ResolveRef(Tables tables)
{
}
public override string ToString()
{
return "{ "
+ "id:" + Id + ","
+ "shop:" + Luban.StringUtil.CollectionToString(Shop) + ","
+ "group:" + Group + ","
+ "items:" + Luban.StringUtil.CollectionToString(Items) + ","
+ "price1:" + Price1 + ","
+ "price2:" + Price2 + ","
+ "label:" + Luban.StringUtil.CollectionToString(Label) + ","
+ "number:" + Number + ","
+ "disable:" + Disable + ","
+ "}";
}
}
}