SingleEnemyConfig.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. { if(!_json["SortingOrder"].IsNumber) { throw new SerializationException(); } SortingOrder = _json["SortingOrder"]; }
  23. PostInit();
  24. }
  25. public SingleEnemyConfig(int ID, string EnemyPrefab, int HP, System.Collections.Generic.List<int> Attack1, System.Collections.Generic.List<int> Attack2, int SortingOrder )
  26. {
  27. this.ID = ID;
  28. this.EnemyPrefab = EnemyPrefab;
  29. this.HP = HP;
  30. this.Attack1 = Attack1;
  31. this.Attack2 = Attack2;
  32. this.SortingOrder = SortingOrder;
  33. PostInit();
  34. }
  35. public static SingleEnemyConfig DeserializeSingleEnemyConfig(JSONNode _json)
  36. {
  37. return new SingleEnemyConfig(_json);
  38. }
  39. /// <summary>
  40. /// 怪物ID
  41. /// </summary>
  42. public int ID { get; private set; }
  43. /// <summary>
  44. /// 怪物Prefab
  45. /// </summary>
  46. public string EnemyPrefab { get; private set; }
  47. /// <summary>
  48. /// 基础血量
  49. /// </summary>
  50. public int HP { get; private set; }
  51. /// <summary>
  52. /// Attack1攻击力
  53. /// </summary>
  54. public System.Collections.Generic.List<int> Attack1 { get; private set; }
  55. /// <summary>
  56. /// Attack2攻击力
  57. /// </summary>
  58. public System.Collections.Generic.List<int> Attack2 { get; private set; }
  59. /// <summary>
  60. /// 基础显示层级(1000递增)
  61. /// </summary>
  62. public int SortingOrder { get; private set; }
  63. public const int __ID__ = 491839330;
  64. public override int GetTypeId() => __ID__;
  65. public void Resolve(Dictionary<string, object> _tables)
  66. {
  67. PostResolve();
  68. }
  69. public void TranslateText(System.Func<string, string, string> translator)
  70. {
  71. }
  72. public override string ToString()
  73. {
  74. return "{ "
  75. + "ID:" + ID + ","
  76. + "EnemyPrefab:" + EnemyPrefab + ","
  77. + "HP:" + HP + ","
  78. + "Attack1:" + Bright.Common.StringUtil.CollectionToString(Attack1) + ","
  79. + "Attack2:" + Bright.Common.StringUtil.CollectionToString(Attack2) + ","
  80. + "SortingOrder:" + SortingOrder + ","
  81. + "}";
  82. }
  83. partial void PostInit();
  84. partial void PostResolve();
  85. }
  86. }