SingleEnemyConfig.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Changes to this file may cause incorrect behavior and will be lost if
  5. // the code is regenerated.
  6. // </auto-generated>
  7. //------------------------------------------------------------------------------
  8. using Bright.Serialization;
  9. using System.Collections.Generic;
  10. using SimpleJSON;
  11. namespace cfg
  12. {
  13. public sealed partial class SingleEnemyConfig : Bright.Config.BeanBase
  14. {
  15. public SingleEnemyConfig(JSONNode _json)
  16. {
  17. { if(!_json["ID"].IsNumber) { throw new SerializationException(); } ID = _json["ID"]; }
  18. { if(!_json["EnemyPrefab"].IsString) { throw new SerializationException(); } EnemyPrefab = _json["EnemyPrefab"]; }
  19. { if(!_json["HP"].IsNumber) { throw new SerializationException(); } HP = _json["HP"]; }
  20. { var __json0 = _json["Attack1"]; if(!__json0.IsArray) { throw new SerializationException(); } Attack1 = new System.Collections.Generic.List<int>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Attack1.Add(__v0); } }
  21. { var __json0 = _json["Attack2"]; if(!__json0.IsArray) { throw new SerializationException(); } Attack2 = new System.Collections.Generic.List<int>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Attack2.Add(__v0); } }
  22. PostInit();
  23. }
  24. public SingleEnemyConfig(int ID, string EnemyPrefab, int HP, System.Collections.Generic.List<int> Attack1, System.Collections.Generic.List<int> Attack2 )
  25. {
  26. this.ID = ID;
  27. this.EnemyPrefab = EnemyPrefab;
  28. this.HP = HP;
  29. this.Attack1 = Attack1;
  30. this.Attack2 = Attack2;
  31. PostInit();
  32. }
  33. public static SingleEnemyConfig DeserializeSingleEnemyConfig(JSONNode _json)
  34. {
  35. return new SingleEnemyConfig(_json);
  36. }
  37. /// <summary>
  38. /// 怪物ID
  39. /// </summary>
  40. public int ID { get; private set; }
  41. /// <summary>
  42. /// 怪物Prefab
  43. /// </summary>
  44. public string EnemyPrefab { get; private set; }
  45. /// <summary>
  46. /// 基础血量
  47. /// </summary>
  48. public int HP { get; private set; }
  49. /// <summary>
  50. /// Attack1攻击力
  51. /// </summary>
  52. public System.Collections.Generic.List<int> Attack1 { get; private set; }
  53. /// <summary>
  54. /// Attack2攻击力
  55. /// </summary>
  56. public System.Collections.Generic.List<int> Attack2 { get; private set; }
  57. public const int __ID__ = 491839330;
  58. public override int GetTypeId() => __ID__;
  59. public void Resolve(Dictionary<string, object> _tables)
  60. {
  61. PostResolve();
  62. }
  63. public void TranslateText(System.Func<string, string, string> translator)
  64. {
  65. }
  66. public override string ToString()
  67. {
  68. return "{ "
  69. + "ID:" + ID + ","
  70. + "EnemyPrefab:" + EnemyPrefab + ","
  71. + "HP:" + HP + ","
  72. + "Attack1:" + Bright.Common.StringUtil.CollectionToString(Attack1) + ","
  73. + "Attack2:" + Bright.Common.StringUtil.CollectionToString(Attack2) + ","
  74. + "}";
  75. }
  76. partial void PostInit();
  77. partial void PostResolve();
  78. }
  79. }