//------------------------------------------------------------------------------
//
// 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 Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace ET.Editor.UnitConfig
{
public sealed partial class UnitBaseConfig : Bright.Config.EditorBeanBase
{
public UnitBaseConfig()
{
Name = "";
SkillList = new System.Collections.Generic.List();
}
public override void LoadJson(SimpleJSON.JSONObject _json)
{
{
var _fieldJson = _json["Id"];
if (_fieldJson != null)
{
if(!_fieldJson.IsNumber) { throw new SerializationException(); } Id = _fieldJson;
}
}
{
var _fieldJson = _json["Name"];
if (_fieldJson != null)
{
if(!_fieldJson.IsString) { throw new SerializationException(); } Name = _fieldJson;
}
}
{
var _fieldJson = _json["SkillList"];
if (_fieldJson != null)
{
if(!_fieldJson.IsArray) { throw new SerializationException(); } SkillList = new System.Collections.Generic.List(); foreach(JSONNode __e in _fieldJson.Children) { int __v; if(!__e.IsNumber) { throw new SerializationException(); } __v = __e; SkillList.Add(__v); }
}
}
{
var _fieldJson = _json["AttributeConfigId"];
if (_fieldJson != null)
{
if(!_fieldJson.IsNumber) { throw new SerializationException(); } AttributeConfigId = _fieldJson;
}
}
}
public override void SaveJson(SimpleJSON.JSONObject _json)
{
{
_json["Id"] = new JSONNumber(Id);
}
{
if (Name == null) { throw new System.ArgumentNullException(); }
_json["Name"] = new JSONString(Name);
}
{
if (SkillList == null) { throw new System.ArgumentNullException(); }
{ var __cjson = new JSONArray(); foreach(var _e in SkillList) { __cjson["null"] = new JSONNumber(_e); } _json["SkillList"] = __cjson; }
}
{
_json["AttributeConfigId"] = new JSONNumber(AttributeConfigId);
}
}
public static UnitBaseConfig LoadJsonUnitBaseConfig(SimpleJSON.JSONNode _json)
{
UnitBaseConfig obj = new UnitConfig.UnitBaseConfig();
obj.LoadJson((SimpleJSON.JSONObject)_json);
return obj;
}
public static void SaveJsonUnitBaseConfig(UnitBaseConfig _obj, SimpleJSON.JSONNode _json)
{
_obj.SaveJson((SimpleJSON.JSONObject)_json);
}
///
/// Id
///
public int Id { get; set; }
///
/// 英雄名
///
public string Name { get; set; }
///
/// 技能列表
///
public System.Collections.Generic.List SkillList { get; set; }
///
/// 属性配置Id
///
public int AttributeConfigId { get; set; }
}
}