LuBanSampleConfig.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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.LuBanSample
  12. {
  13. public sealed partial class LuBanSampleConfig : Bright.Config.EditorBeanBase
  14. {
  15. public LuBanSampleConfig()
  16. {
  17. Name = "";
  18. Desc = "";
  19. Quality = item.EQuality.WHITE;
  20. ExchangeStream = new item.ItemExchange();
  21. ExchangeList = new System.Collections.Generic.List<item.ItemExchange>();
  22. ExchangeColumn = new item.ItemExchange();
  23. }
  24. public override void LoadJson(SimpleJSON.JSONObject _json)
  25. {
  26. {
  27. var _fieldJson = _json["id"];
  28. if (_fieldJson != null)
  29. {
  30. if(!_fieldJson.IsNumber) { throw new SerializationException(); } Id = _fieldJson;
  31. }
  32. }
  33. {
  34. var _fieldJson = _json["name"];
  35. if (_fieldJson != null)
  36. {
  37. if(!_fieldJson.IsString) { throw new SerializationException(); } Name = _fieldJson;
  38. }
  39. }
  40. {
  41. var _fieldJson = _json["desc"];
  42. if (_fieldJson != null)
  43. {
  44. if(!_fieldJson.IsString) { throw new SerializationException(); } Desc = _fieldJson;
  45. }
  46. }
  47. {
  48. var _fieldJson = _json["price"];
  49. if (_fieldJson != null)
  50. {
  51. if(!_fieldJson.IsNumber) { throw new SerializationException(); } Price = _fieldJson;
  52. }
  53. }
  54. {
  55. var _fieldJson = _json["upgrade_to_item_id"];
  56. if (_fieldJson != null)
  57. {
  58. if(!_fieldJson.IsNumber) { throw new SerializationException(); } UpgradeToItemId = _fieldJson;
  59. }
  60. }
  61. {
  62. var _fieldJson = _json["expire_time"];
  63. if (_fieldJson != null)
  64. {
  65. if(!_fieldJson.IsString) { throw new SerializationException(); } ExpireTime = _fieldJson;
  66. }
  67. }
  68. {
  69. var _fieldJson = _json["batch_useable"];
  70. if (_fieldJson != null)
  71. {
  72. if(!_fieldJson.IsBoolean) { throw new SerializationException(); } BatchUseable = _fieldJson;
  73. }
  74. }
  75. {
  76. var _fieldJson = _json["quality"];
  77. if (_fieldJson != null)
  78. {
  79. if(_fieldJson.IsString) { Quality = (item.EQuality)System.Enum.Parse(typeof(item.EQuality), _fieldJson); } else if(_fieldJson.IsNumber) { Quality = (item.EQuality)(int)_fieldJson; } else { throw new SerializationException(); }
  80. }
  81. }
  82. {
  83. var _fieldJson = _json["exchange_stream"];
  84. if (_fieldJson != null)
  85. {
  86. if(!_fieldJson.IsObject) { throw new SerializationException(); } ExchangeStream = item.ItemExchange.LoadJsonItemExchange(_fieldJson);
  87. }
  88. }
  89. {
  90. var _fieldJson = _json["exchange_list"];
  91. if (_fieldJson != null)
  92. {
  93. if(!_fieldJson.IsArray) { throw new SerializationException(); } ExchangeList = new System.Collections.Generic.List<item.ItemExchange>(); foreach(JSONNode __e in _fieldJson.Children) { item.ItemExchange __v; if(!__e.IsObject) { throw new SerializationException(); } __v = item.ItemExchange.LoadJsonItemExchange(__e); ExchangeList.Add(__v); }
  94. }
  95. }
  96. {
  97. var _fieldJson = _json["exchange_column"];
  98. if (_fieldJson != null)
  99. {
  100. if(!_fieldJson.IsObject) { throw new SerializationException(); } ExchangeColumn = item.ItemExchange.LoadJsonItemExchange(_fieldJson);
  101. }
  102. }
  103. {
  104. var _fieldJson = _json["UnitType"];
  105. if (_fieldJson != null)
  106. {
  107. if(!_fieldJson.IsNumber) { throw new SerializationException(); } UnitType = _fieldJson;
  108. }
  109. }
  110. }
  111. public override void SaveJson(SimpleJSON.JSONObject _json)
  112. {
  113. {
  114. _json["id"] = new JSONNumber(Id);
  115. }
  116. {
  117. if (Name == null) { throw new System.ArgumentNullException(); }
  118. _json["name"] = new JSONString(Name);
  119. }
  120. {
  121. if (Desc == null) { throw new System.ArgumentNullException(); }
  122. _json["desc"] = new JSONString(Desc);
  123. }
  124. {
  125. _json["price"] = new JSONNumber(Price);
  126. }
  127. {
  128. _json["upgrade_to_item_id"] = new JSONNumber(UpgradeToItemId);
  129. }
  130. if (ExpireTime != null)
  131. {
  132. _json["expire_time"] = new JSONString(ExpireTime);
  133. }
  134. {
  135. _json["batch_useable"] = new JSONBool(BatchUseable);
  136. }
  137. {
  138. _json["quality"] = new JSONNumber((int)Quality);
  139. }
  140. {
  141. if (ExchangeStream == null) { throw new System.ArgumentNullException(); }
  142. { var __bjson = new JSONObject(); item.ItemExchange.SaveJsonItemExchange(ExchangeStream, __bjson); _json["exchange_stream"] = __bjson; }
  143. }
  144. {
  145. if (ExchangeList == null) { throw new System.ArgumentNullException(); }
  146. { var __cjson = new JSONArray(); foreach(var _e in ExchangeList) { { var __bjson = new JSONObject(); item.ItemExchange.SaveJsonItemExchange(_e, __bjson); __cjson["null"] = __bjson; } } _json["exchange_list"] = __cjson; }
  147. }
  148. {
  149. if (ExchangeColumn == null) { throw new System.ArgumentNullException(); }
  150. { var __bjson = new JSONObject(); item.ItemExchange.SaveJsonItemExchange(ExchangeColumn, __bjson); _json["exchange_column"] = __bjson; }
  151. }
  152. {
  153. _json["UnitType"] = new JSONNumber(UnitType);
  154. }
  155. }
  156. public static LuBanSampleConfig LoadJsonLuBanSampleConfig(SimpleJSON.JSONNode _json)
  157. {
  158. LuBanSampleConfig obj = new LuBanSample.LuBanSampleConfig();
  159. obj.LoadJson((SimpleJSON.JSONObject)_json);
  160. return obj;
  161. }
  162. public static void SaveJsonLuBanSampleConfig(LuBanSampleConfig _obj, SimpleJSON.JSONNode _json)
  163. {
  164. _obj.SaveJson((SimpleJSON.JSONObject)_json);
  165. }
  166. /// <summary>
  167. /// 这是id
  168. /// </summary>
  169. public int Id { get; set; }
  170. /// <summary>
  171. /// 名字
  172. /// </summary>
  173. public string Name { get; set; }
  174. /// <summary>
  175. /// 描述
  176. /// </summary>
  177. public string Desc { get; set; }
  178. /// <summary>
  179. /// 价格
  180. /// </summary>
  181. public int Price { get; set; }
  182. /// <summary>
  183. /// 引用当前表
  184. /// </summary>
  185. public int UpgradeToItemId { get; set; }
  186. /// <summary>
  187. /// 过期时间
  188. /// </summary>
  189. public string ExpireTime { get; set; }
  190. /// <summary>
  191. /// 能否批量使用
  192. /// </summary>
  193. public bool BatchUseable { get; set; }
  194. /// <summary>
  195. /// 品质
  196. /// </summary>
  197. public item.EQuality Quality { get; set; }
  198. /// <summary>
  199. /// 道具兑换配置
  200. /// </summary>
  201. public item.ItemExchange ExchangeStream { get; set; }
  202. public System.Collections.Generic.List<item.ItemExchange> ExchangeList { get; set; }
  203. /// <summary>
  204. /// 道具兑换配置
  205. /// </summary>
  206. public item.ItemExchange ExchangeColumn { get; set; }
  207. /// <summary>
  208. /// Unit类型
  209. /// </summary>
  210. public int UnitType { get; set; }
  211. }
  212. }