//------------------------------------------------------------------------------
//
// 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 cfg
{
public sealed partial class SingleEnemyConfig : Bright.Config.BeanBase
{
public SingleEnemyConfig(JSONNode _json)
{
{ if(!_json["ID"].IsNumber) { throw new SerializationException(); } ID = _json["ID"]; }
{ if(!_json["EnemyPrefab"].IsString) { throw new SerializationException(); } EnemyPrefab = _json["EnemyPrefab"]; }
{ if(!_json["HP"].IsNumber) { throw new SerializationException(); } HP = _json["HP"]; }
{ var __json0 = _json["Attack1"]; if(!__json0.IsArray) { throw new SerializationException(); } Attack1 = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Attack1.Add(__v0); } }
{ var __json0 = _json["Attack2"]; if(!__json0.IsArray) { throw new SerializationException(); } Attack2 = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Attack2.Add(__v0); } }
{ if(!_json["SortingOrder"].IsNumber) { throw new SerializationException(); } SortingOrder = _json["SortingOrder"]; }
PostInit();
}
public SingleEnemyConfig(int ID, string EnemyPrefab, int HP, System.Collections.Generic.List Attack1, System.Collections.Generic.List Attack2, int SortingOrder )
{
this.ID = ID;
this.EnemyPrefab = EnemyPrefab;
this.HP = HP;
this.Attack1 = Attack1;
this.Attack2 = Attack2;
this.SortingOrder = SortingOrder;
PostInit();
}
public static SingleEnemyConfig DeserializeSingleEnemyConfig(JSONNode _json)
{
return new SingleEnemyConfig(_json);
}
///
/// 怪物ID
///
public int ID { get; private set; }
///
/// 怪物Prefab
///
public string EnemyPrefab { get; private set; }
///
/// 基础血量
///
public int HP { get; private set; }
///
/// Attack1攻击力
///
public System.Collections.Generic.List Attack1 { get; private set; }
///
/// Attack2攻击力
///
public System.Collections.Generic.List Attack2 { get; private set; }
///
/// 基础显示层级(1000递增)
///
public int SortingOrder { get; private set; }
public const int __ID__ = 491839330;
public override int GetTypeId() => __ID__;
public void Resolve(Dictionary _tables)
{
PostResolve();
}
public void TranslateText(System.Func translator)
{
}
public override string ToString()
{
return "{ "
+ "ID:" + ID + ","
+ "EnemyPrefab:" + EnemyPrefab + ","
+ "HP:" + HP + ","
+ "Attack1:" + Bright.Common.StringUtil.CollectionToString(Attack1) + ","
+ "Attack2:" + Bright.Common.StringUtil.CollectionToString(Attack2) + ","
+ "SortingOrder:" + SortingOrder + ","
+ "}";
}
partial void PostInit();
partial void PostResolve();
}
}