UnitBaseConfig.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 ET.Editor.UnitConfig
  12. {
  13. public sealed partial class UnitBaseConfig : Bright.Config.EditorBeanBase
  14. {
  15. public UnitBaseConfig()
  16. {
  17. Name = "";
  18. SkillList = new System.Collections.Generic.List<int>();
  19. }
  20. public override void LoadJson(SimpleJSON.JSONObject _json)
  21. {
  22. {
  23. var _fieldJson = _json["Id"];
  24. if (_fieldJson != null)
  25. {
  26. if(!_fieldJson.IsNumber) { throw new SerializationException(); } Id = _fieldJson;
  27. }
  28. }
  29. {
  30. var _fieldJson = _json["Name"];
  31. if (_fieldJson != null)
  32. {
  33. if(!_fieldJson.IsString) { throw new SerializationException(); } Name = _fieldJson;
  34. }
  35. }
  36. {
  37. var _fieldJson = _json["SkillList"];
  38. if (_fieldJson != null)
  39. {
  40. if(!_fieldJson.IsArray) { throw new SerializationException(); } SkillList = new System.Collections.Generic.List<int>(); foreach(JSONNode __e in _fieldJson.Children) { int __v; if(!__e.IsNumber) { throw new SerializationException(); } __v = __e; SkillList.Add(__v); }
  41. }
  42. }
  43. {
  44. var _fieldJson = _json["AttributeConfigId"];
  45. if (_fieldJson != null)
  46. {
  47. if(!_fieldJson.IsNumber) { throw new SerializationException(); } AttributeConfigId = _fieldJson;
  48. }
  49. }
  50. }
  51. public override void SaveJson(SimpleJSON.JSONObject _json)
  52. {
  53. {
  54. _json["Id"] = new JSONNumber(Id);
  55. }
  56. {
  57. if (Name == null) { throw new System.ArgumentNullException(); }
  58. _json["Name"] = new JSONString(Name);
  59. }
  60. {
  61. if (SkillList == null) { throw new System.ArgumentNullException(); }
  62. { var __cjson = new JSONArray(); foreach(var _e in SkillList) { __cjson["null"] = new JSONNumber(_e); } _json["SkillList"] = __cjson; }
  63. }
  64. {
  65. _json["AttributeConfigId"] = new JSONNumber(AttributeConfigId);
  66. }
  67. }
  68. public static UnitBaseConfig LoadJsonUnitBaseConfig(SimpleJSON.JSONNode _json)
  69. {
  70. UnitBaseConfig obj = new UnitConfig.UnitBaseConfig();
  71. obj.LoadJson((SimpleJSON.JSONObject)_json);
  72. return obj;
  73. }
  74. public static void SaveJsonUnitBaseConfig(UnitBaseConfig _obj, SimpleJSON.JSONNode _json)
  75. {
  76. _obj.SaveJson((SimpleJSON.JSONObject)_json);
  77. }
  78. /// <summary>
  79. /// Id
  80. /// </summary>
  81. public int Id { get; set; }
  82. /// <summary>
  83. /// 英雄名
  84. /// </summary>
  85. public string Name { get; set; }
  86. /// <summary>
  87. /// 技能列表
  88. /// </summary>
  89. public System.Collections.Generic.List<int> SkillList { get; set; }
  90. /// <summary>
  91. /// 属性配置Id
  92. /// </summary>
  93. public int AttributeConfigId { get; set; }
  94. }
  95. }