SingleEnemyConfig.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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["Name"].IsString) { throw new SerializationException(); } Name = _json["Name"]; }
  18. { if(!_json["SpriteName"].IsString) { throw new SerializationException(); } SpriteName = _json["SpriteName"]; }
  19. { if(!_json["Color"].IsString) { throw new SerializationException(); } Color = _json["Color"]; }
  20. { if(!_json["Type"].IsString) { throw new SerializationException(); } Type = _json["Type"]; }
  21. { if(!_json["EnemyPrefab"].IsString) { throw new SerializationException(); } EnemyPrefab = _json["EnemyPrefab"]; }
  22. { var __json0 = _json["Radius"]; if(!__json0.IsArray) { throw new SerializationException(); } Radius = new System.Collections.Generic.List<int>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Radius.Add(__v0); } }
  23. { if(!_json["HP"].IsNumber) { throw new SerializationException(); } HP = _json["HP"]; }
  24. { if(!_json["AttackSummon"].IsNumber) { throw new SerializationException(); } AttackSummon = _json["AttackSummon"]; }
  25. { if(!_json["AttackMarch"].IsNumber) { throw new SerializationException(); } AttackMarch = _json["AttackMarch"]; }
  26. { if(!_json["MinMoveSpeed"].IsNumber) { throw new SerializationException(); } MinMoveSpeed = _json["MinMoveSpeed"]; }
  27. { if(!_json["MaxMoveSpeed"].IsNumber) { throw new SerializationException(); } MaxMoveSpeed = _json["MaxMoveSpeed"]; }
  28. PostInit();
  29. }
  30. public SingleEnemyConfig(string Name, string SpriteName, string Color, string Type, string EnemyPrefab, System.Collections.Generic.List<int> Radius, int HP, int AttackSummon, int AttackMarch, float MinMoveSpeed, float MaxMoveSpeed )
  31. {
  32. this.Name = Name;
  33. this.SpriteName = SpriteName;
  34. this.Color = Color;
  35. this.Type = Type;
  36. this.EnemyPrefab = EnemyPrefab;
  37. this.Radius = Radius;
  38. this.HP = HP;
  39. this.AttackSummon = AttackSummon;
  40. this.AttackMarch = AttackMarch;
  41. this.MinMoveSpeed = MinMoveSpeed;
  42. this.MaxMoveSpeed = MaxMoveSpeed;
  43. PostInit();
  44. }
  45. public static SingleEnemyConfig DeserializeSingleEnemyConfig(JSONNode _json)
  46. {
  47. return new SingleEnemyConfig(_json);
  48. }
  49. /// <summary>
  50. /// 角色类型汇总:
  51. /// </summary>
  52. public string Name { get; private set; }
  53. /// <summary>
  54. /// Enemy
  55. /// </summary>
  56. public string SpriteName { get; private set; }
  57. /// <summary>
  58. /// Tower
  59. /// </summary>
  60. public string Color { get; private set; }
  61. public string Type { get; private set; }
  62. public string EnemyPrefab { get; private set; }
  63. public System.Collections.Generic.List<int> Radius { get; private set; }
  64. public int HP { get; private set; }
  65. public int AttackSummon { get; private set; }
  66. public int AttackMarch { get; private set; }
  67. public float MinMoveSpeed { get; private set; }
  68. public float MaxMoveSpeed { get; private set; }
  69. public const int __ID__ = 491839330;
  70. public override int GetTypeId() => __ID__;
  71. public void Resolve(Dictionary<string, object> _tables)
  72. {
  73. PostResolve();
  74. }
  75. public void TranslateText(System.Func<string, string, string> translator)
  76. {
  77. }
  78. public override string ToString()
  79. {
  80. return "{ "
  81. + "Name:" + Name + ","
  82. + "SpriteName:" + SpriteName + ","
  83. + "Color:" + Color + ","
  84. + "Type:" + Type + ","
  85. + "EnemyPrefab:" + EnemyPrefab + ","
  86. + "Radius:" + Bright.Common.StringUtil.CollectionToString(Radius) + ","
  87. + "HP:" + HP + ","
  88. + "AttackSummon:" + AttackSummon + ","
  89. + "AttackMarch:" + AttackMarch + ","
  90. + "MinMoveSpeed:" + MinMoveSpeed + ","
  91. + "MaxMoveSpeed:" + MaxMoveSpeed + ","
  92. + "}";
  93. }
  94. partial void PostInit();
  95. partial void PostResolve();
  96. }
  97. }