Bundle.js 113 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245
  1. /*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
  2. (function(global, factory) { /* global define, require, module */
  3. /* AMD */ if (typeof define === 'function' && define.amd)
  4. define(["protobufjs/minimal"], factory);
  5. /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
  6. module.exports = factory(require("protobufjs/minimal"));
  7. })(this, function($protobuf) {
  8. "use strict";
  9. // Common aliases
  10. var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
  11. // Exported root namespace
  12. var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
  13. $root.tutorial = (function() {
  14. /**
  15. * Namespace tutorial.
  16. * @exports tutorial
  17. * @namespace
  18. */
  19. var tutorial = {};
  20. tutorial.Message = (function() {
  21. /**
  22. * Properties of a Message.
  23. * @memberof tutorial
  24. * @interface IMessage
  25. * @property {tutorial.Message.Type|null} [type] Message type
  26. * @property {tutorial.Message.IDataMessage|null} [dataMessage] Message dataMessage
  27. * @property {tutorial.Message.INotificationMessage|null} [notificationMessage] Message notificationMessage
  28. * @property {tutorial.Message.IRoleOptMessage|null} [roleOptMessage] Message roleOptMessage
  29. * @property {tutorial.Message.IReportData|null} [reportData] Message reportData
  30. * @property {string|null} [msg] Message msg
  31. * @property {tutorial.Message.IBuildingItems|null} [buildingItems] Message buildingItems
  32. */
  33. /**
  34. * Constructs a new Message.
  35. * @memberof tutorial
  36. * @classdesc Represents a Message.
  37. * @implements IMessage
  38. * @constructor
  39. * @param {tutorial.IMessage=} [properties] Properties to set
  40. */
  41. function Message(properties) {
  42. if (properties)
  43. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  44. if (properties[keys[i]] != null)
  45. this[keys[i]] = properties[keys[i]];
  46. }
  47. /**
  48. * Message type.
  49. * @member {tutorial.Message.Type} type
  50. * @memberof tutorial.Message
  51. * @instance
  52. */
  53. Message.prototype.type = 0;
  54. /**
  55. * Message dataMessage.
  56. * @member {tutorial.Message.IDataMessage|null|undefined} dataMessage
  57. * @memberof tutorial.Message
  58. * @instance
  59. */
  60. Message.prototype.dataMessage = null;
  61. /**
  62. * Message notificationMessage.
  63. * @member {tutorial.Message.INotificationMessage|null|undefined} notificationMessage
  64. * @memberof tutorial.Message
  65. * @instance
  66. */
  67. Message.prototype.notificationMessage = null;
  68. /**
  69. * Message roleOptMessage.
  70. * @member {tutorial.Message.IRoleOptMessage|null|undefined} roleOptMessage
  71. * @memberof tutorial.Message
  72. * @instance
  73. */
  74. Message.prototype.roleOptMessage = null;
  75. /**
  76. * Message reportData.
  77. * @member {tutorial.Message.IReportData|null|undefined} reportData
  78. * @memberof tutorial.Message
  79. * @instance
  80. */
  81. Message.prototype.reportData = null;
  82. /**
  83. * Message msg.
  84. * @member {string} msg
  85. * @memberof tutorial.Message
  86. * @instance
  87. */
  88. Message.prototype.msg = "";
  89. /**
  90. * Message buildingItems.
  91. * @member {tutorial.Message.IBuildingItems|null|undefined} buildingItems
  92. * @memberof tutorial.Message
  93. * @instance
  94. */
  95. Message.prototype.buildingItems = null;
  96. /**
  97. * Creates a new Message instance using the specified properties.
  98. * @function create
  99. * @memberof tutorial.Message
  100. * @static
  101. * @param {tutorial.IMessage=} [properties] Properties to set
  102. * @returns {tutorial.Message} Message instance
  103. */
  104. Message.create = function create(properties) {
  105. return new Message(properties);
  106. };
  107. /**
  108. * Encodes the specified Message message. Does not implicitly {@link tutorial.Message.verify|verify} messages.
  109. * @function encode
  110. * @memberof tutorial.Message
  111. * @static
  112. * @param {tutorial.IMessage} message Message message or plain object to encode
  113. * @param {$protobuf.Writer} [writer] Writer to encode to
  114. * @returns {$protobuf.Writer} Writer
  115. */
  116. Message.encode = function encode(message, writer) {
  117. if (!writer)
  118. writer = $Writer.create();
  119. if (message.type != null && message.hasOwnProperty("type"))
  120. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
  121. if (message.dataMessage != null && message.hasOwnProperty("dataMessage"))
  122. $root.tutorial.Message.DataMessage.encode(message.dataMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  123. if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage"))
  124. $root.tutorial.Message.NotificationMessage.encode(message.notificationMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
  125. if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage"))
  126. $root.tutorial.Message.RoleOptMessage.encode(message.roleOptMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
  127. if (message.reportData != null && message.hasOwnProperty("reportData"))
  128. $root.tutorial.Message.ReportData.encode(message.reportData, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
  129. if (message.msg != null && message.hasOwnProperty("msg"))
  130. writer.uint32(/* id 6, wireType 2 =*/50).string(message.msg);
  131. if (message.buildingItems != null && message.hasOwnProperty("buildingItems"))
  132. $root.tutorial.Message.BuildingItems.encode(message.buildingItems, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
  133. return writer;
  134. };
  135. /**
  136. * Encodes the specified Message message, length delimited. Does not implicitly {@link tutorial.Message.verify|verify} messages.
  137. * @function encodeDelimited
  138. * @memberof tutorial.Message
  139. * @static
  140. * @param {tutorial.IMessage} message Message message or plain object to encode
  141. * @param {$protobuf.Writer} [writer] Writer to encode to
  142. * @returns {$protobuf.Writer} Writer
  143. */
  144. Message.encodeDelimited = function encodeDelimited(message, writer) {
  145. return this.encode(message, writer).ldelim();
  146. };
  147. /**
  148. * Decodes a Message message from the specified reader or buffer.
  149. * @function decode
  150. * @memberof tutorial.Message
  151. * @static
  152. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  153. * @param {number} [length] Message length if known beforehand
  154. * @returns {tutorial.Message} Message
  155. * @throws {Error} If the payload is not a reader or valid buffer
  156. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  157. */
  158. Message.decode = function decode(reader, length) {
  159. if (!(reader instanceof $Reader))
  160. reader = $Reader.create(reader);
  161. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message();
  162. while (reader.pos < end) {
  163. var tag = reader.uint32();
  164. switch (tag >>> 3) {
  165. case 1:
  166. message.type = reader.int32();
  167. break;
  168. case 2:
  169. message.dataMessage = $root.tutorial.Message.DataMessage.decode(reader, reader.uint32());
  170. break;
  171. case 3:
  172. message.notificationMessage = $root.tutorial.Message.NotificationMessage.decode(reader, reader.uint32());
  173. break;
  174. case 4:
  175. message.roleOptMessage = $root.tutorial.Message.RoleOptMessage.decode(reader, reader.uint32());
  176. break;
  177. case 5:
  178. message.reportData = $root.tutorial.Message.ReportData.decode(reader, reader.uint32());
  179. break;
  180. case 6:
  181. message.msg = reader.string();
  182. break;
  183. case 7:
  184. message.buildingItems = $root.tutorial.Message.BuildingItems.decode(reader, reader.uint32());
  185. break;
  186. default:
  187. reader.skipType(tag & 7);
  188. break;
  189. }
  190. }
  191. return message;
  192. };
  193. /**
  194. * Decodes a Message message from the specified reader or buffer, length delimited.
  195. * @function decodeDelimited
  196. * @memberof tutorial.Message
  197. * @static
  198. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  199. * @returns {tutorial.Message} Message
  200. * @throws {Error} If the payload is not a reader or valid buffer
  201. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  202. */
  203. Message.decodeDelimited = function decodeDelimited(reader) {
  204. if (!(reader instanceof $Reader))
  205. reader = new $Reader(reader);
  206. return this.decode(reader, reader.uint32());
  207. };
  208. /**
  209. * Verifies a Message message.
  210. * @function verify
  211. * @memberof tutorial.Message
  212. * @static
  213. * @param {Object.<string,*>} message Plain object to verify
  214. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  215. */
  216. Message.verify = function verify(message) {
  217. if (typeof message !== "object" || message === null)
  218. return "object expected";
  219. if (message.type != null && message.hasOwnProperty("type"))
  220. switch (message.type) {
  221. default:
  222. return "type: enum value expected";
  223. case 0:
  224. case 1:
  225. case 2:
  226. case 3:
  227. case 4:
  228. case 5:
  229. case 6:
  230. break;
  231. }
  232. if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) {
  233. var error = $root.tutorial.Message.DataMessage.verify(message.dataMessage);
  234. if (error)
  235. return "dataMessage." + error;
  236. }
  237. if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage")) {
  238. var error = $root.tutorial.Message.NotificationMessage.verify(message.notificationMessage);
  239. if (error)
  240. return "notificationMessage." + error;
  241. }
  242. if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage")) {
  243. var error = $root.tutorial.Message.RoleOptMessage.verify(message.roleOptMessage);
  244. if (error)
  245. return "roleOptMessage." + error;
  246. }
  247. if (message.reportData != null && message.hasOwnProperty("reportData")) {
  248. var error = $root.tutorial.Message.ReportData.verify(message.reportData);
  249. if (error)
  250. return "reportData." + error;
  251. }
  252. if (message.msg != null && message.hasOwnProperty("msg"))
  253. if (!$util.isString(message.msg))
  254. return "msg: string expected";
  255. if (message.buildingItems != null && message.hasOwnProperty("buildingItems")) {
  256. var error = $root.tutorial.Message.BuildingItems.verify(message.buildingItems);
  257. if (error)
  258. return "buildingItems." + error;
  259. }
  260. return null;
  261. };
  262. /**
  263. * Creates a Message message from a plain object. Also converts values to their respective internal types.
  264. * @function fromObject
  265. * @memberof tutorial.Message
  266. * @static
  267. * @param {Object.<string,*>} object Plain object
  268. * @returns {tutorial.Message} Message
  269. */
  270. Message.fromObject = function fromObject(object) {
  271. if (object instanceof $root.tutorial.Message)
  272. return object;
  273. var message = new $root.tutorial.Message();
  274. switch (object.type) {
  275. case "SELF":
  276. case 0:
  277. message.type = 0;
  278. break;
  279. case "DATA":
  280. case 1:
  281. message.type = 1;
  282. break;
  283. case "NOTIFY":
  284. case 2:
  285. message.type = 2;
  286. break;
  287. case "ROLEOPT":
  288. case 3:
  289. message.type = 3;
  290. break;
  291. case "REPORT":
  292. case 4:
  293. message.type = 4;
  294. break;
  295. case "BD_ITEM":
  296. case 5:
  297. message.type = 5;
  298. break;
  299. case "HB":
  300. case 6:
  301. message.type = 6;
  302. break;
  303. }
  304. if (object.dataMessage != null) {
  305. if (typeof object.dataMessage !== "object")
  306. throw TypeError(".tutorial.Message.dataMessage: object expected");
  307. message.dataMessage = $root.tutorial.Message.DataMessage.fromObject(object.dataMessage);
  308. }
  309. if (object.notificationMessage != null) {
  310. if (typeof object.notificationMessage !== "object")
  311. throw TypeError(".tutorial.Message.notificationMessage: object expected");
  312. message.notificationMessage = $root.tutorial.Message.NotificationMessage.fromObject(object.notificationMessage);
  313. }
  314. if (object.roleOptMessage != null) {
  315. if (typeof object.roleOptMessage !== "object")
  316. throw TypeError(".tutorial.Message.roleOptMessage: object expected");
  317. message.roleOptMessage = $root.tutorial.Message.RoleOptMessage.fromObject(object.roleOptMessage);
  318. }
  319. if (object.reportData != null) {
  320. if (typeof object.reportData !== "object")
  321. throw TypeError(".tutorial.Message.reportData: object expected");
  322. message.reportData = $root.tutorial.Message.ReportData.fromObject(object.reportData);
  323. }
  324. if (object.msg != null)
  325. message.msg = String(object.msg);
  326. if (object.buildingItems != null) {
  327. if (typeof object.buildingItems !== "object")
  328. throw TypeError(".tutorial.Message.buildingItems: object expected");
  329. message.buildingItems = $root.tutorial.Message.BuildingItems.fromObject(object.buildingItems);
  330. }
  331. return message;
  332. };
  333. /**
  334. * Creates a plain object from a Message message. Also converts values to other types if specified.
  335. * @function toObject
  336. * @memberof tutorial.Message
  337. * @static
  338. * @param {tutorial.Message} message Message
  339. * @param {$protobuf.IConversionOptions} [options] Conversion options
  340. * @returns {Object.<string,*>} Plain object
  341. */
  342. Message.toObject = function toObject(message, options) {
  343. if (!options)
  344. options = {};
  345. var object = {};
  346. if (options.defaults) {
  347. object.type = options.enums === String ? "SELF" : 0;
  348. object.dataMessage = null;
  349. object.notificationMessage = null;
  350. object.roleOptMessage = null;
  351. object.reportData = null;
  352. object.msg = "";
  353. object.buildingItems = null;
  354. }
  355. if (message.type != null && message.hasOwnProperty("type"))
  356. object.type = options.enums === String ? $root.tutorial.Message.Type[message.type] : message.type;
  357. if (message.dataMessage != null && message.hasOwnProperty("dataMessage"))
  358. object.dataMessage = $root.tutorial.Message.DataMessage.toObject(message.dataMessage, options);
  359. if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage"))
  360. object.notificationMessage = $root.tutorial.Message.NotificationMessage.toObject(message.notificationMessage, options);
  361. if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage"))
  362. object.roleOptMessage = $root.tutorial.Message.RoleOptMessage.toObject(message.roleOptMessage, options);
  363. if (message.reportData != null && message.hasOwnProperty("reportData"))
  364. object.reportData = $root.tutorial.Message.ReportData.toObject(message.reportData, options);
  365. if (message.msg != null && message.hasOwnProperty("msg"))
  366. object.msg = message.msg;
  367. if (message.buildingItems != null && message.hasOwnProperty("buildingItems"))
  368. object.buildingItems = $root.tutorial.Message.BuildingItems.toObject(message.buildingItems, options);
  369. return object;
  370. };
  371. /**
  372. * Converts this Message to JSON.
  373. * @function toJSON
  374. * @memberof tutorial.Message
  375. * @instance
  376. * @returns {Object.<string,*>} JSON object
  377. */
  378. Message.prototype.toJSON = function toJSON() {
  379. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  380. };
  381. /**
  382. * Type enum.
  383. * @name tutorial.Message.Type
  384. * @enum {string}
  385. * @property {number} SELF=0 SELF value
  386. * @property {number} DATA=1 DATA value
  387. * @property {number} NOTIFY=2 NOTIFY value
  388. * @property {number} ROLEOPT=3 ROLEOPT value
  389. * @property {number} REPORT=4 REPORT value
  390. * @property {number} BD_ITEM=5 BD_ITEM value
  391. * @property {number} HB=6 HB value
  392. */
  393. Message.Type = (function() {
  394. var valuesById = {}, values = Object.create(valuesById);
  395. values[valuesById[0] = "SELF"] = 0;
  396. values[valuesById[1] = "DATA"] = 1;
  397. values[valuesById[2] = "NOTIFY"] = 2;
  398. values[valuesById[3] = "ROLEOPT"] = 3;
  399. values[valuesById[4] = "REPORT"] = 4;
  400. values[valuesById[5] = "BD_ITEM"] = 5;
  401. values[valuesById[6] = "HB"] = 6;
  402. return values;
  403. })();
  404. Message.DataMessage = (function() {
  405. /**
  406. * Properties of a DataMessage.
  407. * @memberof tutorial.Message
  408. * @interface IDataMessage
  409. * @property {number|null} [code] DataMessage code
  410. * @property {number|null} [result] DataMessage result
  411. * @property {string|null} [data] DataMessage data
  412. * @property {string|null} [msg] DataMessage msg
  413. */
  414. /**
  415. * Constructs a new DataMessage.
  416. * @memberof tutorial.Message
  417. * @classdesc Represents a DataMessage.
  418. * @implements IDataMessage
  419. * @constructor
  420. * @param {tutorial.Message.IDataMessage=} [properties] Properties to set
  421. */
  422. function DataMessage(properties) {
  423. if (properties)
  424. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  425. if (properties[keys[i]] != null)
  426. this[keys[i]] = properties[keys[i]];
  427. }
  428. /**
  429. * DataMessage code.
  430. * @member {number} code
  431. * @memberof tutorial.Message.DataMessage
  432. * @instance
  433. */
  434. DataMessage.prototype.code = 0;
  435. /**
  436. * DataMessage result.
  437. * @member {number} result
  438. * @memberof tutorial.Message.DataMessage
  439. * @instance
  440. */
  441. DataMessage.prototype.result = 0;
  442. /**
  443. * DataMessage data.
  444. * @member {string} data
  445. * @memberof tutorial.Message.DataMessage
  446. * @instance
  447. */
  448. DataMessage.prototype.data = "";
  449. /**
  450. * DataMessage msg.
  451. * @member {string} msg
  452. * @memberof tutorial.Message.DataMessage
  453. * @instance
  454. */
  455. DataMessage.prototype.msg = "";
  456. /**
  457. * Creates a new DataMessage instance using the specified properties.
  458. * @function create
  459. * @memberof tutorial.Message.DataMessage
  460. * @static
  461. * @param {tutorial.Message.IDataMessage=} [properties] Properties to set
  462. * @returns {tutorial.Message.DataMessage} DataMessage instance
  463. */
  464. DataMessage.create = function create(properties) {
  465. return new DataMessage(properties);
  466. };
  467. /**
  468. * Encodes the specified DataMessage message. Does not implicitly {@link tutorial.Message.DataMessage.verify|verify} messages.
  469. * @function encode
  470. * @memberof tutorial.Message.DataMessage
  471. * @static
  472. * @param {tutorial.Message.IDataMessage} message DataMessage message or plain object to encode
  473. * @param {$protobuf.Writer} [writer] Writer to encode to
  474. * @returns {$protobuf.Writer} Writer
  475. */
  476. DataMessage.encode = function encode(message, writer) {
  477. if (!writer)
  478. writer = $Writer.create();
  479. if (message.code != null && message.hasOwnProperty("code"))
  480. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
  481. if (message.result != null && message.hasOwnProperty("result"))
  482. writer.uint32(/* id 2, wireType 0 =*/16).int32(message.result);
  483. if (message.data != null && message.hasOwnProperty("data"))
  484. writer.uint32(/* id 3, wireType 2 =*/26).string(message.data);
  485. if (message.msg != null && message.hasOwnProperty("msg"))
  486. writer.uint32(/* id 4, wireType 2 =*/34).string(message.msg);
  487. return writer;
  488. };
  489. /**
  490. * Encodes the specified DataMessage message, length delimited. Does not implicitly {@link tutorial.Message.DataMessage.verify|verify} messages.
  491. * @function encodeDelimited
  492. * @memberof tutorial.Message.DataMessage
  493. * @static
  494. * @param {tutorial.Message.IDataMessage} message DataMessage message or plain object to encode
  495. * @param {$protobuf.Writer} [writer] Writer to encode to
  496. * @returns {$protobuf.Writer} Writer
  497. */
  498. DataMessage.encodeDelimited = function encodeDelimited(message, writer) {
  499. return this.encode(message, writer).ldelim();
  500. };
  501. /**
  502. * Decodes a DataMessage message from the specified reader or buffer.
  503. * @function decode
  504. * @memberof tutorial.Message.DataMessage
  505. * @static
  506. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  507. * @param {number} [length] Message length if known beforehand
  508. * @returns {tutorial.Message.DataMessage} DataMessage
  509. * @throws {Error} If the payload is not a reader or valid buffer
  510. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  511. */
  512. DataMessage.decode = function decode(reader, length) {
  513. if (!(reader instanceof $Reader))
  514. reader = $Reader.create(reader);
  515. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.DataMessage();
  516. while (reader.pos < end) {
  517. var tag = reader.uint32();
  518. switch (tag >>> 3) {
  519. case 1:
  520. message.code = reader.int32();
  521. break;
  522. case 2:
  523. message.result = reader.int32();
  524. break;
  525. case 3:
  526. message.data = reader.string();
  527. break;
  528. case 4:
  529. message.msg = reader.string();
  530. break;
  531. default:
  532. reader.skipType(tag & 7);
  533. break;
  534. }
  535. }
  536. return message;
  537. };
  538. /**
  539. * Decodes a DataMessage message from the specified reader or buffer, length delimited.
  540. * @function decodeDelimited
  541. * @memberof tutorial.Message.DataMessage
  542. * @static
  543. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  544. * @returns {tutorial.Message.DataMessage} DataMessage
  545. * @throws {Error} If the payload is not a reader or valid buffer
  546. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  547. */
  548. DataMessage.decodeDelimited = function decodeDelimited(reader) {
  549. if (!(reader instanceof $Reader))
  550. reader = new $Reader(reader);
  551. return this.decode(reader, reader.uint32());
  552. };
  553. /**
  554. * Verifies a DataMessage message.
  555. * @function verify
  556. * @memberof tutorial.Message.DataMessage
  557. * @static
  558. * @param {Object.<string,*>} message Plain object to verify
  559. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  560. */
  561. DataMessage.verify = function verify(message) {
  562. if (typeof message !== "object" || message === null)
  563. return "object expected";
  564. if (message.code != null && message.hasOwnProperty("code"))
  565. if (!$util.isInteger(message.code))
  566. return "code: integer expected";
  567. if (message.result != null && message.hasOwnProperty("result"))
  568. if (!$util.isInteger(message.result))
  569. return "result: integer expected";
  570. if (message.data != null && message.hasOwnProperty("data"))
  571. if (!$util.isString(message.data))
  572. return "data: string expected";
  573. if (message.msg != null && message.hasOwnProperty("msg"))
  574. if (!$util.isString(message.msg))
  575. return "msg: string expected";
  576. return null;
  577. };
  578. /**
  579. * Creates a DataMessage message from a plain object. Also converts values to their respective internal types.
  580. * @function fromObject
  581. * @memberof tutorial.Message.DataMessage
  582. * @static
  583. * @param {Object.<string,*>} object Plain object
  584. * @returns {tutorial.Message.DataMessage} DataMessage
  585. */
  586. DataMessage.fromObject = function fromObject(object) {
  587. if (object instanceof $root.tutorial.Message.DataMessage)
  588. return object;
  589. var message = new $root.tutorial.Message.DataMessage();
  590. if (object.code != null)
  591. message.code = object.code | 0;
  592. if (object.result != null)
  593. message.result = object.result | 0;
  594. if (object.data != null)
  595. message.data = String(object.data);
  596. if (object.msg != null)
  597. message.msg = String(object.msg);
  598. return message;
  599. };
  600. /**
  601. * Creates a plain object from a DataMessage message. Also converts values to other types if specified.
  602. * @function toObject
  603. * @memberof tutorial.Message.DataMessage
  604. * @static
  605. * @param {tutorial.Message.DataMessage} message DataMessage
  606. * @param {$protobuf.IConversionOptions} [options] Conversion options
  607. * @returns {Object.<string,*>} Plain object
  608. */
  609. DataMessage.toObject = function toObject(message, options) {
  610. if (!options)
  611. options = {};
  612. var object = {};
  613. if (options.defaults) {
  614. object.code = 0;
  615. object.result = 0;
  616. object.data = "";
  617. object.msg = "";
  618. }
  619. if (message.code != null && message.hasOwnProperty("code"))
  620. object.code = message.code;
  621. if (message.result != null && message.hasOwnProperty("result"))
  622. object.result = message.result;
  623. if (message.data != null && message.hasOwnProperty("data"))
  624. object.data = message.data;
  625. if (message.msg != null && message.hasOwnProperty("msg"))
  626. object.msg = message.msg;
  627. return object;
  628. };
  629. /**
  630. * Converts this DataMessage to JSON.
  631. * @function toJSON
  632. * @memberof tutorial.Message.DataMessage
  633. * @instance
  634. * @returns {Object.<string,*>} JSON object
  635. */
  636. DataMessage.prototype.toJSON = function toJSON() {
  637. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  638. };
  639. return DataMessage;
  640. })();
  641. Message.NotificationMessage = (function() {
  642. /**
  643. * Properties of a NotificationMessage.
  644. * @memberof tutorial.Message
  645. * @interface INotificationMessage
  646. * @property {number|null} [nType] NotificationMessage nType
  647. */
  648. /**
  649. * Constructs a new NotificationMessage.
  650. * @memberof tutorial.Message
  651. * @classdesc Represents a NotificationMessage.
  652. * @implements INotificationMessage
  653. * @constructor
  654. * @param {tutorial.Message.INotificationMessage=} [properties] Properties to set
  655. */
  656. function NotificationMessage(properties) {
  657. if (properties)
  658. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  659. if (properties[keys[i]] != null)
  660. this[keys[i]] = properties[keys[i]];
  661. }
  662. /**
  663. * NotificationMessage nType.
  664. * @member {number} nType
  665. * @memberof tutorial.Message.NotificationMessage
  666. * @instance
  667. */
  668. NotificationMessage.prototype.nType = 0;
  669. /**
  670. * Creates a new NotificationMessage instance using the specified properties.
  671. * @function create
  672. * @memberof tutorial.Message.NotificationMessage
  673. * @static
  674. * @param {tutorial.Message.INotificationMessage=} [properties] Properties to set
  675. * @returns {tutorial.Message.NotificationMessage} NotificationMessage instance
  676. */
  677. NotificationMessage.create = function create(properties) {
  678. return new NotificationMessage(properties);
  679. };
  680. /**
  681. * Encodes the specified NotificationMessage message. Does not implicitly {@link tutorial.Message.NotificationMessage.verify|verify} messages.
  682. * @function encode
  683. * @memberof tutorial.Message.NotificationMessage
  684. * @static
  685. * @param {tutorial.Message.INotificationMessage} message NotificationMessage message or plain object to encode
  686. * @param {$protobuf.Writer} [writer] Writer to encode to
  687. * @returns {$protobuf.Writer} Writer
  688. */
  689. NotificationMessage.encode = function encode(message, writer) {
  690. if (!writer)
  691. writer = $Writer.create();
  692. if (message.nType != null && message.hasOwnProperty("nType"))
  693. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nType);
  694. return writer;
  695. };
  696. /**
  697. * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link tutorial.Message.NotificationMessage.verify|verify} messages.
  698. * @function encodeDelimited
  699. * @memberof tutorial.Message.NotificationMessage
  700. * @static
  701. * @param {tutorial.Message.INotificationMessage} message NotificationMessage message or plain object to encode
  702. * @param {$protobuf.Writer} [writer] Writer to encode to
  703. * @returns {$protobuf.Writer} Writer
  704. */
  705. NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) {
  706. return this.encode(message, writer).ldelim();
  707. };
  708. /**
  709. * Decodes a NotificationMessage message from the specified reader or buffer.
  710. * @function decode
  711. * @memberof tutorial.Message.NotificationMessage
  712. * @static
  713. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  714. * @param {number} [length] Message length if known beforehand
  715. * @returns {tutorial.Message.NotificationMessage} NotificationMessage
  716. * @throws {Error} If the payload is not a reader or valid buffer
  717. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  718. */
  719. NotificationMessage.decode = function decode(reader, length) {
  720. if (!(reader instanceof $Reader))
  721. reader = $Reader.create(reader);
  722. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.NotificationMessage();
  723. while (reader.pos < end) {
  724. var tag = reader.uint32();
  725. switch (tag >>> 3) {
  726. case 1:
  727. message.nType = reader.int32();
  728. break;
  729. default:
  730. reader.skipType(tag & 7);
  731. break;
  732. }
  733. }
  734. return message;
  735. };
  736. /**
  737. * Decodes a NotificationMessage message from the specified reader or buffer, length delimited.
  738. * @function decodeDelimited
  739. * @memberof tutorial.Message.NotificationMessage
  740. * @static
  741. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  742. * @returns {tutorial.Message.NotificationMessage} NotificationMessage
  743. * @throws {Error} If the payload is not a reader or valid buffer
  744. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  745. */
  746. NotificationMessage.decodeDelimited = function decodeDelimited(reader) {
  747. if (!(reader instanceof $Reader))
  748. reader = new $Reader(reader);
  749. return this.decode(reader, reader.uint32());
  750. };
  751. /**
  752. * Verifies a NotificationMessage message.
  753. * @function verify
  754. * @memberof tutorial.Message.NotificationMessage
  755. * @static
  756. * @param {Object.<string,*>} message Plain object to verify
  757. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  758. */
  759. NotificationMessage.verify = function verify(message) {
  760. if (typeof message !== "object" || message === null)
  761. return "object expected";
  762. if (message.nType != null && message.hasOwnProperty("nType"))
  763. if (!$util.isInteger(message.nType))
  764. return "nType: integer expected";
  765. return null;
  766. };
  767. /**
  768. * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types.
  769. * @function fromObject
  770. * @memberof tutorial.Message.NotificationMessage
  771. * @static
  772. * @param {Object.<string,*>} object Plain object
  773. * @returns {tutorial.Message.NotificationMessage} NotificationMessage
  774. */
  775. NotificationMessage.fromObject = function fromObject(object) {
  776. if (object instanceof $root.tutorial.Message.NotificationMessage)
  777. return object;
  778. var message = new $root.tutorial.Message.NotificationMessage();
  779. if (object.nType != null)
  780. message.nType = object.nType | 0;
  781. return message;
  782. };
  783. /**
  784. * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified.
  785. * @function toObject
  786. * @memberof tutorial.Message.NotificationMessage
  787. * @static
  788. * @param {tutorial.Message.NotificationMessage} message NotificationMessage
  789. * @param {$protobuf.IConversionOptions} [options] Conversion options
  790. * @returns {Object.<string,*>} Plain object
  791. */
  792. NotificationMessage.toObject = function toObject(message, options) {
  793. if (!options)
  794. options = {};
  795. var object = {};
  796. if (options.defaults)
  797. object.nType = 0;
  798. if (message.nType != null && message.hasOwnProperty("nType"))
  799. object.nType = message.nType;
  800. return object;
  801. };
  802. /**
  803. * Converts this NotificationMessage to JSON.
  804. * @function toJSON
  805. * @memberof tutorial.Message.NotificationMessage
  806. * @instance
  807. * @returns {Object.<string,*>} JSON object
  808. */
  809. NotificationMessage.prototype.toJSON = function toJSON() {
  810. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  811. };
  812. return NotificationMessage;
  813. })();
  814. Message.RoleOptMessage = (function() {
  815. /**
  816. * Properties of a RoleOptMessage.
  817. * @memberof tutorial.Message
  818. * @interface IRoleOptMessage
  819. * @property {number|Long|null} [targetUid] RoleOptMessage targetUid
  820. * @property {number|Long|null} [exBossUid] RoleOptMessage exBossUid
  821. * @property {number|null} [opt] RoleOptMessage opt
  822. */
  823. /**
  824. * Constructs a new RoleOptMessage.
  825. * @memberof tutorial.Message
  826. * @classdesc Represents a RoleOptMessage.
  827. * @implements IRoleOptMessage
  828. * @constructor
  829. * @param {tutorial.Message.IRoleOptMessage=} [properties] Properties to set
  830. */
  831. function RoleOptMessage(properties) {
  832. if (properties)
  833. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  834. if (properties[keys[i]] != null)
  835. this[keys[i]] = properties[keys[i]];
  836. }
  837. /**
  838. * RoleOptMessage targetUid.
  839. * @member {number|Long} targetUid
  840. * @memberof tutorial.Message.RoleOptMessage
  841. * @instance
  842. */
  843. RoleOptMessage.prototype.targetUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  844. /**
  845. * RoleOptMessage exBossUid.
  846. * @member {number|Long} exBossUid
  847. * @memberof tutorial.Message.RoleOptMessage
  848. * @instance
  849. */
  850. RoleOptMessage.prototype.exBossUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  851. /**
  852. * RoleOptMessage opt.
  853. * @member {number} opt
  854. * @memberof tutorial.Message.RoleOptMessage
  855. * @instance
  856. */
  857. RoleOptMessage.prototype.opt = 0;
  858. /**
  859. * Creates a new RoleOptMessage instance using the specified properties.
  860. * @function create
  861. * @memberof tutorial.Message.RoleOptMessage
  862. * @static
  863. * @param {tutorial.Message.IRoleOptMessage=} [properties] Properties to set
  864. * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage instance
  865. */
  866. RoleOptMessage.create = function create(properties) {
  867. return new RoleOptMessage(properties);
  868. };
  869. /**
  870. * Encodes the specified RoleOptMessage message. Does not implicitly {@link tutorial.Message.RoleOptMessage.verify|verify} messages.
  871. * @function encode
  872. * @memberof tutorial.Message.RoleOptMessage
  873. * @static
  874. * @param {tutorial.Message.IRoleOptMessage} message RoleOptMessage message or plain object to encode
  875. * @param {$protobuf.Writer} [writer] Writer to encode to
  876. * @returns {$protobuf.Writer} Writer
  877. */
  878. RoleOptMessage.encode = function encode(message, writer) {
  879. if (!writer)
  880. writer = $Writer.create();
  881. if (message.targetUid != null && message.hasOwnProperty("targetUid"))
  882. writer.uint32(/* id 1, wireType 0 =*/8).int64(message.targetUid);
  883. if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
  884. writer.uint32(/* id 2, wireType 0 =*/16).int64(message.exBossUid);
  885. if (message.opt != null && message.hasOwnProperty("opt"))
  886. writer.uint32(/* id 3, wireType 0 =*/24).int32(message.opt);
  887. return writer;
  888. };
  889. /**
  890. * Encodes the specified RoleOptMessage message, length delimited. Does not implicitly {@link tutorial.Message.RoleOptMessage.verify|verify} messages.
  891. * @function encodeDelimited
  892. * @memberof tutorial.Message.RoleOptMessage
  893. * @static
  894. * @param {tutorial.Message.IRoleOptMessage} message RoleOptMessage message or plain object to encode
  895. * @param {$protobuf.Writer} [writer] Writer to encode to
  896. * @returns {$protobuf.Writer} Writer
  897. */
  898. RoleOptMessage.encodeDelimited = function encodeDelimited(message, writer) {
  899. return this.encode(message, writer).ldelim();
  900. };
  901. /**
  902. * Decodes a RoleOptMessage message from the specified reader or buffer.
  903. * @function decode
  904. * @memberof tutorial.Message.RoleOptMessage
  905. * @static
  906. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  907. * @param {number} [length] Message length if known beforehand
  908. * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
  909. * @throws {Error} If the payload is not a reader or valid buffer
  910. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  911. */
  912. RoleOptMessage.decode = function decode(reader, length) {
  913. if (!(reader instanceof $Reader))
  914. reader = $Reader.create(reader);
  915. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.RoleOptMessage();
  916. while (reader.pos < end) {
  917. var tag = reader.uint32();
  918. switch (tag >>> 3) {
  919. case 1:
  920. message.targetUid = reader.int64();
  921. break;
  922. case 2:
  923. message.exBossUid = reader.int64();
  924. break;
  925. case 3:
  926. message.opt = reader.int32();
  927. break;
  928. default:
  929. reader.skipType(tag & 7);
  930. break;
  931. }
  932. }
  933. return message;
  934. };
  935. /**
  936. * Decodes a RoleOptMessage message from the specified reader or buffer, length delimited.
  937. * @function decodeDelimited
  938. * @memberof tutorial.Message.RoleOptMessage
  939. * @static
  940. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  941. * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
  942. * @throws {Error} If the payload is not a reader or valid buffer
  943. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  944. */
  945. RoleOptMessage.decodeDelimited = function decodeDelimited(reader) {
  946. if (!(reader instanceof $Reader))
  947. reader = new $Reader(reader);
  948. return this.decode(reader, reader.uint32());
  949. };
  950. /**
  951. * Verifies a RoleOptMessage message.
  952. * @function verify
  953. * @memberof tutorial.Message.RoleOptMessage
  954. * @static
  955. * @param {Object.<string,*>} message Plain object to verify
  956. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  957. */
  958. RoleOptMessage.verify = function verify(message) {
  959. if (typeof message !== "object" || message === null)
  960. return "object expected";
  961. if (message.targetUid != null && message.hasOwnProperty("targetUid"))
  962. if (!$util.isInteger(message.targetUid) && !(message.targetUid && $util.isInteger(message.targetUid.low) && $util.isInteger(message.targetUid.high)))
  963. return "targetUid: integer|Long expected";
  964. if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
  965. if (!$util.isInteger(message.exBossUid) && !(message.exBossUid && $util.isInteger(message.exBossUid.low) && $util.isInteger(message.exBossUid.high)))
  966. return "exBossUid: integer|Long expected";
  967. if (message.opt != null && message.hasOwnProperty("opt"))
  968. if (!$util.isInteger(message.opt))
  969. return "opt: integer expected";
  970. return null;
  971. };
  972. /**
  973. * Creates a RoleOptMessage message from a plain object. Also converts values to their respective internal types.
  974. * @function fromObject
  975. * @memberof tutorial.Message.RoleOptMessage
  976. * @static
  977. * @param {Object.<string,*>} object Plain object
  978. * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
  979. */
  980. RoleOptMessage.fromObject = function fromObject(object) {
  981. if (object instanceof $root.tutorial.Message.RoleOptMessage)
  982. return object;
  983. var message = new $root.tutorial.Message.RoleOptMessage();
  984. if (object.targetUid != null)
  985. if ($util.Long)
  986. (message.targetUid = $util.Long.fromValue(object.targetUid)).unsigned = false;
  987. else if (typeof object.targetUid === "string")
  988. message.targetUid = parseInt(object.targetUid, 10);
  989. else if (typeof object.targetUid === "number")
  990. message.targetUid = object.targetUid;
  991. else if (typeof object.targetUid === "object")
  992. message.targetUid = new $util.LongBits(object.targetUid.low >>> 0, object.targetUid.high >>> 0).toNumber();
  993. if (object.exBossUid != null)
  994. if ($util.Long)
  995. (message.exBossUid = $util.Long.fromValue(object.exBossUid)).unsigned = false;
  996. else if (typeof object.exBossUid === "string")
  997. message.exBossUid = parseInt(object.exBossUid, 10);
  998. else if (typeof object.exBossUid === "number")
  999. message.exBossUid = object.exBossUid;
  1000. else if (typeof object.exBossUid === "object")
  1001. message.exBossUid = new $util.LongBits(object.exBossUid.low >>> 0, object.exBossUid.high >>> 0).toNumber();
  1002. if (object.opt != null)
  1003. message.opt = object.opt | 0;
  1004. return message;
  1005. };
  1006. /**
  1007. * Creates a plain object from a RoleOptMessage message. Also converts values to other types if specified.
  1008. * @function toObject
  1009. * @memberof tutorial.Message.RoleOptMessage
  1010. * @static
  1011. * @param {tutorial.Message.RoleOptMessage} message RoleOptMessage
  1012. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1013. * @returns {Object.<string,*>} Plain object
  1014. */
  1015. RoleOptMessage.toObject = function toObject(message, options) {
  1016. if (!options)
  1017. options = {};
  1018. var object = {};
  1019. if (options.defaults) {
  1020. if ($util.Long) {
  1021. var long = new $util.Long(0, 0, false);
  1022. object.targetUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1023. } else
  1024. object.targetUid = options.longs === String ? "0" : 0;
  1025. if ($util.Long) {
  1026. var long = new $util.Long(0, 0, false);
  1027. object.exBossUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1028. } else
  1029. object.exBossUid = options.longs === String ? "0" : 0;
  1030. object.opt = 0;
  1031. }
  1032. if (message.targetUid != null && message.hasOwnProperty("targetUid"))
  1033. if (typeof message.targetUid === "number")
  1034. object.targetUid = options.longs === String ? String(message.targetUid) : message.targetUid;
  1035. else
  1036. object.targetUid = options.longs === String ? $util.Long.prototype.toString.call(message.targetUid) : options.longs === Number ? new $util.LongBits(message.targetUid.low >>> 0, message.targetUid.high >>> 0).toNumber() : message.targetUid;
  1037. if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
  1038. if (typeof message.exBossUid === "number")
  1039. object.exBossUid = options.longs === String ? String(message.exBossUid) : message.exBossUid;
  1040. else
  1041. object.exBossUid = options.longs === String ? $util.Long.prototype.toString.call(message.exBossUid) : options.longs === Number ? new $util.LongBits(message.exBossUid.low >>> 0, message.exBossUid.high >>> 0).toNumber() : message.exBossUid;
  1042. if (message.opt != null && message.hasOwnProperty("opt"))
  1043. object.opt = message.opt;
  1044. return object;
  1045. };
  1046. /**
  1047. * Converts this RoleOptMessage to JSON.
  1048. * @function toJSON
  1049. * @memberof tutorial.Message.RoleOptMessage
  1050. * @instance
  1051. * @returns {Object.<string,*>} JSON object
  1052. */
  1053. RoleOptMessage.prototype.toJSON = function toJSON() {
  1054. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1055. };
  1056. return RoleOptMessage;
  1057. })();
  1058. Message.ReportData = (function() {
  1059. /**
  1060. * Properties of a ReportData.
  1061. * @memberof tutorial.Message
  1062. * @interface IReportData
  1063. * @property {number|null} [seq] * 上报序号,每次重新获取时重置
  1064. * @property {number|Long|null} [t] 时间戳
  1065. * @property {number|null} [cmd] @see com.duowan.allstar.model.enumeration.Cmd
  1066. * @property {number|Long|null} [gi] grossIncome
  1067. * @property {number|Long|null} [s] @see com.duowan.allstar.model.home.UserExtra#stars
  1068. * @property {Array.<tutorial.Message.IBuildingInfo>|null} [b] @see BuildingInfoForm
  1069. * @property {Array.<tutorial.Message.IBuildingInfo>|null} [ub] 未解锁建筑
  1070. */
  1071. /**
  1072. * Constructs a new ReportData.
  1073. * @memberof tutorial.Message
  1074. * @classdesc Represents a ReportData.
  1075. * @implements IReportData
  1076. * @constructor
  1077. * @param {tutorial.Message.IReportData=} [properties] Properties to set
  1078. */
  1079. function ReportData(properties) {
  1080. this.b = [];
  1081. this.ub = [];
  1082. if (properties)
  1083. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1084. if (properties[keys[i]] != null)
  1085. this[keys[i]] = properties[keys[i]];
  1086. }
  1087. /**
  1088. * * 上报序号,每次重新获取时重置
  1089. * @member {number} seq
  1090. * @memberof tutorial.Message.ReportData
  1091. * @instance
  1092. */
  1093. ReportData.prototype.seq = 0;
  1094. /**
  1095. * 时间戳
  1096. * @member {number|Long} t
  1097. * @memberof tutorial.Message.ReportData
  1098. * @instance
  1099. */
  1100. ReportData.prototype.t = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1101. /**
  1102. * @see com.duowan.allstar.model.enumeration.Cmd
  1103. * @member {number} cmd
  1104. * @memberof tutorial.Message.ReportData
  1105. * @instance
  1106. */
  1107. ReportData.prototype.cmd = 0;
  1108. /**
  1109. * grossIncome
  1110. * @member {number|Long} gi
  1111. * @memberof tutorial.Message.ReportData
  1112. * @instance
  1113. */
  1114. ReportData.prototype.gi = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1115. /**
  1116. * @see com.duowan.allstar.model.home.UserExtra#stars
  1117. * @member {number|Long} s
  1118. * @memberof tutorial.Message.ReportData
  1119. * @instance
  1120. */
  1121. ReportData.prototype.s = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1122. /**
  1123. * @see BuildingInfoForm
  1124. * @member {Array.<tutorial.Message.IBuildingInfo>} b
  1125. * @memberof tutorial.Message.ReportData
  1126. * @instance
  1127. */
  1128. ReportData.prototype.b = $util.emptyArray;
  1129. /**
  1130. * 未解锁建筑
  1131. * @member {Array.<tutorial.Message.IBuildingInfo>} ub
  1132. * @memberof tutorial.Message.ReportData
  1133. * @instance
  1134. */
  1135. ReportData.prototype.ub = $util.emptyArray;
  1136. /**
  1137. * Creates a new ReportData instance using the specified properties.
  1138. * @function create
  1139. * @memberof tutorial.Message.ReportData
  1140. * @static
  1141. * @param {tutorial.Message.IReportData=} [properties] Properties to set
  1142. * @returns {tutorial.Message.ReportData} ReportData instance
  1143. */
  1144. ReportData.create = function create(properties) {
  1145. return new ReportData(properties);
  1146. };
  1147. /**
  1148. * Encodes the specified ReportData message. Does not implicitly {@link tutorial.Message.ReportData.verify|verify} messages.
  1149. * @function encode
  1150. * @memberof tutorial.Message.ReportData
  1151. * @static
  1152. * @param {tutorial.Message.IReportData} message ReportData message or plain object to encode
  1153. * @param {$protobuf.Writer} [writer] Writer to encode to
  1154. * @returns {$protobuf.Writer} Writer
  1155. */
  1156. ReportData.encode = function encode(message, writer) {
  1157. if (!writer)
  1158. writer = $Writer.create();
  1159. if (message.seq != null && message.hasOwnProperty("seq"))
  1160. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.seq);
  1161. if (message.t != null && message.hasOwnProperty("t"))
  1162. writer.uint32(/* id 2, wireType 0 =*/16).int64(message.t);
  1163. if (message.cmd != null && message.hasOwnProperty("cmd"))
  1164. writer.uint32(/* id 3, wireType 0 =*/24).int32(message.cmd);
  1165. if (message.gi != null && message.hasOwnProperty("gi"))
  1166. writer.uint32(/* id 4, wireType 0 =*/32).int64(message.gi);
  1167. if (message.s != null && message.hasOwnProperty("s"))
  1168. writer.uint32(/* id 5, wireType 0 =*/40).int64(message.s);
  1169. if (message.b != null && message.b.length)
  1170. for (var i = 0; i < message.b.length; ++i)
  1171. $root.tutorial.Message.BuildingInfo.encode(message.b[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
  1172. if (message.ub != null && message.ub.length)
  1173. for (var i = 0; i < message.ub.length; ++i)
  1174. $root.tutorial.Message.BuildingInfo.encode(message.ub[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
  1175. return writer;
  1176. };
  1177. /**
  1178. * Encodes the specified ReportData message, length delimited. Does not implicitly {@link tutorial.Message.ReportData.verify|verify} messages.
  1179. * @function encodeDelimited
  1180. * @memberof tutorial.Message.ReportData
  1181. * @static
  1182. * @param {tutorial.Message.IReportData} message ReportData message or plain object to encode
  1183. * @param {$protobuf.Writer} [writer] Writer to encode to
  1184. * @returns {$protobuf.Writer} Writer
  1185. */
  1186. ReportData.encodeDelimited = function encodeDelimited(message, writer) {
  1187. return this.encode(message, writer).ldelim();
  1188. };
  1189. /**
  1190. * Decodes a ReportData message from the specified reader or buffer.
  1191. * @function decode
  1192. * @memberof tutorial.Message.ReportData
  1193. * @static
  1194. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1195. * @param {number} [length] Message length if known beforehand
  1196. * @returns {tutorial.Message.ReportData} ReportData
  1197. * @throws {Error} If the payload is not a reader or valid buffer
  1198. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1199. */
  1200. ReportData.decode = function decode(reader, length) {
  1201. if (!(reader instanceof $Reader))
  1202. reader = $Reader.create(reader);
  1203. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.ReportData();
  1204. while (reader.pos < end) {
  1205. var tag = reader.uint32();
  1206. switch (tag >>> 3) {
  1207. case 1:
  1208. message.seq = reader.int32();
  1209. break;
  1210. case 2:
  1211. message.t = reader.int64();
  1212. break;
  1213. case 3:
  1214. message.cmd = reader.int32();
  1215. break;
  1216. case 4:
  1217. message.gi = reader.int64();
  1218. break;
  1219. case 5:
  1220. message.s = reader.int64();
  1221. break;
  1222. case 6:
  1223. if (!(message.b && message.b.length))
  1224. message.b = [];
  1225. message.b.push($root.tutorial.Message.BuildingInfo.decode(reader, reader.uint32()));
  1226. break;
  1227. case 7:
  1228. if (!(message.ub && message.ub.length))
  1229. message.ub = [];
  1230. message.ub.push($root.tutorial.Message.BuildingInfo.decode(reader, reader.uint32()));
  1231. break;
  1232. default:
  1233. reader.skipType(tag & 7);
  1234. break;
  1235. }
  1236. }
  1237. return message;
  1238. };
  1239. /**
  1240. * Decodes a ReportData message from the specified reader or buffer, length delimited.
  1241. * @function decodeDelimited
  1242. * @memberof tutorial.Message.ReportData
  1243. * @static
  1244. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1245. * @returns {tutorial.Message.ReportData} ReportData
  1246. * @throws {Error} If the payload is not a reader or valid buffer
  1247. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1248. */
  1249. ReportData.decodeDelimited = function decodeDelimited(reader) {
  1250. if (!(reader instanceof $Reader))
  1251. reader = new $Reader(reader);
  1252. return this.decode(reader, reader.uint32());
  1253. };
  1254. /**
  1255. * Verifies a ReportData message.
  1256. * @function verify
  1257. * @memberof tutorial.Message.ReportData
  1258. * @static
  1259. * @param {Object.<string,*>} message Plain object to verify
  1260. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1261. */
  1262. ReportData.verify = function verify(message) {
  1263. if (typeof message !== "object" || message === null)
  1264. return "object expected";
  1265. if (message.seq != null && message.hasOwnProperty("seq"))
  1266. if (!$util.isInteger(message.seq))
  1267. return "seq: integer expected";
  1268. if (message.t != null && message.hasOwnProperty("t"))
  1269. if (!$util.isInteger(message.t) && !(message.t && $util.isInteger(message.t.low) && $util.isInteger(message.t.high)))
  1270. return "t: integer|Long expected";
  1271. if (message.cmd != null && message.hasOwnProperty("cmd"))
  1272. if (!$util.isInteger(message.cmd))
  1273. return "cmd: integer expected";
  1274. if (message.gi != null && message.hasOwnProperty("gi"))
  1275. if (!$util.isInteger(message.gi) && !(message.gi && $util.isInteger(message.gi.low) && $util.isInteger(message.gi.high)))
  1276. return "gi: integer|Long expected";
  1277. if (message.s != null && message.hasOwnProperty("s"))
  1278. if (!$util.isInteger(message.s) && !(message.s && $util.isInteger(message.s.low) && $util.isInteger(message.s.high)))
  1279. return "s: integer|Long expected";
  1280. if (message.b != null && message.hasOwnProperty("b")) {
  1281. if (!Array.isArray(message.b))
  1282. return "b: array expected";
  1283. for (var i = 0; i < message.b.length; ++i) {
  1284. var error = $root.tutorial.Message.BuildingInfo.verify(message.b[i]);
  1285. if (error)
  1286. return "b." + error;
  1287. }
  1288. }
  1289. if (message.ub != null && message.hasOwnProperty("ub")) {
  1290. if (!Array.isArray(message.ub))
  1291. return "ub: array expected";
  1292. for (var i = 0; i < message.ub.length; ++i) {
  1293. var error = $root.tutorial.Message.BuildingInfo.verify(message.ub[i]);
  1294. if (error)
  1295. return "ub." + error;
  1296. }
  1297. }
  1298. return null;
  1299. };
  1300. /**
  1301. * Creates a ReportData message from a plain object. Also converts values to their respective internal types.
  1302. * @function fromObject
  1303. * @memberof tutorial.Message.ReportData
  1304. * @static
  1305. * @param {Object.<string,*>} object Plain object
  1306. * @returns {tutorial.Message.ReportData} ReportData
  1307. */
  1308. ReportData.fromObject = function fromObject(object) {
  1309. if (object instanceof $root.tutorial.Message.ReportData)
  1310. return object;
  1311. var message = new $root.tutorial.Message.ReportData();
  1312. if (object.seq != null)
  1313. message.seq = object.seq | 0;
  1314. if (object.t != null)
  1315. if ($util.Long)
  1316. (message.t = $util.Long.fromValue(object.t)).unsigned = false;
  1317. else if (typeof object.t === "string")
  1318. message.t = parseInt(object.t, 10);
  1319. else if (typeof object.t === "number")
  1320. message.t = object.t;
  1321. else if (typeof object.t === "object")
  1322. message.t = new $util.LongBits(object.t.low >>> 0, object.t.high >>> 0).toNumber();
  1323. if (object.cmd != null)
  1324. message.cmd = object.cmd | 0;
  1325. if (object.gi != null)
  1326. if ($util.Long)
  1327. (message.gi = $util.Long.fromValue(object.gi)).unsigned = false;
  1328. else if (typeof object.gi === "string")
  1329. message.gi = parseInt(object.gi, 10);
  1330. else if (typeof object.gi === "number")
  1331. message.gi = object.gi;
  1332. else if (typeof object.gi === "object")
  1333. message.gi = new $util.LongBits(object.gi.low >>> 0, object.gi.high >>> 0).toNumber();
  1334. if (object.s != null)
  1335. if ($util.Long)
  1336. (message.s = $util.Long.fromValue(object.s)).unsigned = false;
  1337. else if (typeof object.s === "string")
  1338. message.s = parseInt(object.s, 10);
  1339. else if (typeof object.s === "number")
  1340. message.s = object.s;
  1341. else if (typeof object.s === "object")
  1342. message.s = new $util.LongBits(object.s.low >>> 0, object.s.high >>> 0).toNumber();
  1343. if (object.b) {
  1344. if (!Array.isArray(object.b))
  1345. throw TypeError(".tutorial.Message.ReportData.b: array expected");
  1346. message.b = [];
  1347. for (var i = 0; i < object.b.length; ++i) {
  1348. if (typeof object.b[i] !== "object")
  1349. throw TypeError(".tutorial.Message.ReportData.b: object expected");
  1350. message.b[i] = $root.tutorial.Message.BuildingInfo.fromObject(object.b[i]);
  1351. }
  1352. }
  1353. if (object.ub) {
  1354. if (!Array.isArray(object.ub))
  1355. throw TypeError(".tutorial.Message.ReportData.ub: array expected");
  1356. message.ub = [];
  1357. for (var i = 0; i < object.ub.length; ++i) {
  1358. if (typeof object.ub[i] !== "object")
  1359. throw TypeError(".tutorial.Message.ReportData.ub: object expected");
  1360. message.ub[i] = $root.tutorial.Message.BuildingInfo.fromObject(object.ub[i]);
  1361. }
  1362. }
  1363. return message;
  1364. };
  1365. /**
  1366. * Creates a plain object from a ReportData message. Also converts values to other types if specified.
  1367. * @function toObject
  1368. * @memberof tutorial.Message.ReportData
  1369. * @static
  1370. * @param {tutorial.Message.ReportData} message ReportData
  1371. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1372. * @returns {Object.<string,*>} Plain object
  1373. */
  1374. ReportData.toObject = function toObject(message, options) {
  1375. if (!options)
  1376. options = {};
  1377. var object = {};
  1378. if (options.arrays || options.defaults) {
  1379. object.b = [];
  1380. object.ub = [];
  1381. }
  1382. if (options.defaults) {
  1383. object.seq = 0;
  1384. if ($util.Long) {
  1385. var long = new $util.Long(0, 0, false);
  1386. object.t = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1387. } else
  1388. object.t = options.longs === String ? "0" : 0;
  1389. object.cmd = 0;
  1390. if ($util.Long) {
  1391. var long = new $util.Long(0, 0, false);
  1392. object.gi = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1393. } else
  1394. object.gi = options.longs === String ? "0" : 0;
  1395. if ($util.Long) {
  1396. var long = new $util.Long(0, 0, false);
  1397. object.s = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1398. } else
  1399. object.s = options.longs === String ? "0" : 0;
  1400. }
  1401. if (message.seq != null && message.hasOwnProperty("seq"))
  1402. object.seq = message.seq;
  1403. if (message.t != null && message.hasOwnProperty("t"))
  1404. if (typeof message.t === "number")
  1405. object.t = options.longs === String ? String(message.t) : message.t;
  1406. else
  1407. object.t = options.longs === String ? $util.Long.prototype.toString.call(message.t) : options.longs === Number ? new $util.LongBits(message.t.low >>> 0, message.t.high >>> 0).toNumber() : message.t;
  1408. if (message.cmd != null && message.hasOwnProperty("cmd"))
  1409. object.cmd = message.cmd;
  1410. if (message.gi != null && message.hasOwnProperty("gi"))
  1411. if (typeof message.gi === "number")
  1412. object.gi = options.longs === String ? String(message.gi) : message.gi;
  1413. else
  1414. object.gi = options.longs === String ? $util.Long.prototype.toString.call(message.gi) : options.longs === Number ? new $util.LongBits(message.gi.low >>> 0, message.gi.high >>> 0).toNumber() : message.gi;
  1415. if (message.s != null && message.hasOwnProperty("s"))
  1416. if (typeof message.s === "number")
  1417. object.s = options.longs === String ? String(message.s) : message.s;
  1418. else
  1419. object.s = options.longs === String ? $util.Long.prototype.toString.call(message.s) : options.longs === Number ? new $util.LongBits(message.s.low >>> 0, message.s.high >>> 0).toNumber() : message.s;
  1420. if (message.b && message.b.length) {
  1421. object.b = [];
  1422. for (var j = 0; j < message.b.length; ++j)
  1423. object.b[j] = $root.tutorial.Message.BuildingInfo.toObject(message.b[j], options);
  1424. }
  1425. if (message.ub && message.ub.length) {
  1426. object.ub = [];
  1427. for (var j = 0; j < message.ub.length; ++j)
  1428. object.ub[j] = $root.tutorial.Message.BuildingInfo.toObject(message.ub[j], options);
  1429. }
  1430. return object;
  1431. };
  1432. /**
  1433. * Converts this ReportData to JSON.
  1434. * @function toJSON
  1435. * @memberof tutorial.Message.ReportData
  1436. * @instance
  1437. * @returns {Object.<string,*>} JSON object
  1438. */
  1439. ReportData.prototype.toJSON = function toJSON() {
  1440. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1441. };
  1442. return ReportData;
  1443. })();
  1444. Message.BuildingInfo = (function() {
  1445. /**
  1446. * Properties of a BuildingInfo.
  1447. * @memberof tutorial.Message
  1448. * @interface IBuildingInfo
  1449. * @property {number|Long|null} [id] BuildingInfo id
  1450. * @property {number|null} [l] BuildingInfo l
  1451. * @property {number|null} [cc] BuildingInfo cc
  1452. */
  1453. /**
  1454. * Constructs a new BuildingInfo.
  1455. * @memberof tutorial.Message
  1456. * @classdesc Represents a BuildingInfo.
  1457. * @implements IBuildingInfo
  1458. * @constructor
  1459. * @param {tutorial.Message.IBuildingInfo=} [properties] Properties to set
  1460. */
  1461. function BuildingInfo(properties) {
  1462. if (properties)
  1463. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1464. if (properties[keys[i]] != null)
  1465. this[keys[i]] = properties[keys[i]];
  1466. }
  1467. /**
  1468. * BuildingInfo id.
  1469. * @member {number|Long} id
  1470. * @memberof tutorial.Message.BuildingInfo
  1471. * @instance
  1472. */
  1473. BuildingInfo.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1474. /**
  1475. * BuildingInfo l.
  1476. * @member {number} l
  1477. * @memberof tutorial.Message.BuildingInfo
  1478. * @instance
  1479. */
  1480. BuildingInfo.prototype.l = 0;
  1481. /**
  1482. * BuildingInfo cc.
  1483. * @member {number} cc
  1484. * @memberof tutorial.Message.BuildingInfo
  1485. * @instance
  1486. */
  1487. BuildingInfo.prototype.cc = 0;
  1488. /**
  1489. * Creates a new BuildingInfo instance using the specified properties.
  1490. * @function create
  1491. * @memberof tutorial.Message.BuildingInfo
  1492. * @static
  1493. * @param {tutorial.Message.IBuildingInfo=} [properties] Properties to set
  1494. * @returns {tutorial.Message.BuildingInfo} BuildingInfo instance
  1495. */
  1496. BuildingInfo.create = function create(properties) {
  1497. return new BuildingInfo(properties);
  1498. };
  1499. /**
  1500. * Encodes the specified BuildingInfo message. Does not implicitly {@link tutorial.Message.BuildingInfo.verify|verify} messages.
  1501. * @function encode
  1502. * @memberof tutorial.Message.BuildingInfo
  1503. * @static
  1504. * @param {tutorial.Message.IBuildingInfo} message BuildingInfo message or plain object to encode
  1505. * @param {$protobuf.Writer} [writer] Writer to encode to
  1506. * @returns {$protobuf.Writer} Writer
  1507. */
  1508. BuildingInfo.encode = function encode(message, writer) {
  1509. if (!writer)
  1510. writer = $Writer.create();
  1511. if (message.id != null && message.hasOwnProperty("id"))
  1512. writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
  1513. if (message.l != null && message.hasOwnProperty("l"))
  1514. writer.uint32(/* id 2, wireType 0 =*/16).int32(message.l);
  1515. if (message.cc != null && message.hasOwnProperty("cc"))
  1516. writer.uint32(/* id 3, wireType 0 =*/24).int32(message.cc);
  1517. return writer;
  1518. };
  1519. /**
  1520. * Encodes the specified BuildingInfo message, length delimited. Does not implicitly {@link tutorial.Message.BuildingInfo.verify|verify} messages.
  1521. * @function encodeDelimited
  1522. * @memberof tutorial.Message.BuildingInfo
  1523. * @static
  1524. * @param {tutorial.Message.IBuildingInfo} message BuildingInfo message or plain object to encode
  1525. * @param {$protobuf.Writer} [writer] Writer to encode to
  1526. * @returns {$protobuf.Writer} Writer
  1527. */
  1528. BuildingInfo.encodeDelimited = function encodeDelimited(message, writer) {
  1529. return this.encode(message, writer).ldelim();
  1530. };
  1531. /**
  1532. * Decodes a BuildingInfo message from the specified reader or buffer.
  1533. * @function decode
  1534. * @memberof tutorial.Message.BuildingInfo
  1535. * @static
  1536. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1537. * @param {number} [length] Message length if known beforehand
  1538. * @returns {tutorial.Message.BuildingInfo} BuildingInfo
  1539. * @throws {Error} If the payload is not a reader or valid buffer
  1540. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1541. */
  1542. BuildingInfo.decode = function decode(reader, length) {
  1543. if (!(reader instanceof $Reader))
  1544. reader = $Reader.create(reader);
  1545. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.BuildingInfo();
  1546. while (reader.pos < end) {
  1547. var tag = reader.uint32();
  1548. switch (tag >>> 3) {
  1549. case 1:
  1550. message.id = reader.int64();
  1551. break;
  1552. case 2:
  1553. message.l = reader.int32();
  1554. break;
  1555. case 3:
  1556. message.cc = reader.int32();
  1557. break;
  1558. default:
  1559. reader.skipType(tag & 7);
  1560. break;
  1561. }
  1562. }
  1563. return message;
  1564. };
  1565. /**
  1566. * Decodes a BuildingInfo message from the specified reader or buffer, length delimited.
  1567. * @function decodeDelimited
  1568. * @memberof tutorial.Message.BuildingInfo
  1569. * @static
  1570. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1571. * @returns {tutorial.Message.BuildingInfo} BuildingInfo
  1572. * @throws {Error} If the payload is not a reader or valid buffer
  1573. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1574. */
  1575. BuildingInfo.decodeDelimited = function decodeDelimited(reader) {
  1576. if (!(reader instanceof $Reader))
  1577. reader = new $Reader(reader);
  1578. return this.decode(reader, reader.uint32());
  1579. };
  1580. /**
  1581. * Verifies a BuildingInfo message.
  1582. * @function verify
  1583. * @memberof tutorial.Message.BuildingInfo
  1584. * @static
  1585. * @param {Object.<string,*>} message Plain object to verify
  1586. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1587. */
  1588. BuildingInfo.verify = function verify(message) {
  1589. if (typeof message !== "object" || message === null)
  1590. return "object expected";
  1591. if (message.id != null && message.hasOwnProperty("id"))
  1592. if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
  1593. return "id: integer|Long expected";
  1594. if (message.l != null && message.hasOwnProperty("l"))
  1595. if (!$util.isInteger(message.l))
  1596. return "l: integer expected";
  1597. if (message.cc != null && message.hasOwnProperty("cc"))
  1598. if (!$util.isInteger(message.cc))
  1599. return "cc: integer expected";
  1600. return null;
  1601. };
  1602. /**
  1603. * Creates a BuildingInfo message from a plain object. Also converts values to their respective internal types.
  1604. * @function fromObject
  1605. * @memberof tutorial.Message.BuildingInfo
  1606. * @static
  1607. * @param {Object.<string,*>} object Plain object
  1608. * @returns {tutorial.Message.BuildingInfo} BuildingInfo
  1609. */
  1610. BuildingInfo.fromObject = function fromObject(object) {
  1611. if (object instanceof $root.tutorial.Message.BuildingInfo)
  1612. return object;
  1613. var message = new $root.tutorial.Message.BuildingInfo();
  1614. if (object.id != null)
  1615. if ($util.Long)
  1616. (message.id = $util.Long.fromValue(object.id)).unsigned = false;
  1617. else if (typeof object.id === "string")
  1618. message.id = parseInt(object.id, 10);
  1619. else if (typeof object.id === "number")
  1620. message.id = object.id;
  1621. else if (typeof object.id === "object")
  1622. message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
  1623. if (object.l != null)
  1624. message.l = object.l | 0;
  1625. if (object.cc != null)
  1626. message.cc = object.cc | 0;
  1627. return message;
  1628. };
  1629. /**
  1630. * Creates a plain object from a BuildingInfo message. Also converts values to other types if specified.
  1631. * @function toObject
  1632. * @memberof tutorial.Message.BuildingInfo
  1633. * @static
  1634. * @param {tutorial.Message.BuildingInfo} message BuildingInfo
  1635. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1636. * @returns {Object.<string,*>} Plain object
  1637. */
  1638. BuildingInfo.toObject = function toObject(message, options) {
  1639. if (!options)
  1640. options = {};
  1641. var object = {};
  1642. if (options.defaults) {
  1643. if ($util.Long) {
  1644. var long = new $util.Long(0, 0, false);
  1645. object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1646. } else
  1647. object.id = options.longs === String ? "0" : 0;
  1648. object.l = 0;
  1649. object.cc = 0;
  1650. }
  1651. if (message.id != null && message.hasOwnProperty("id"))
  1652. if (typeof message.id === "number")
  1653. object.id = options.longs === String ? String(message.id) : message.id;
  1654. else
  1655. object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id;
  1656. if (message.l != null && message.hasOwnProperty("l"))
  1657. object.l = message.l;
  1658. if (message.cc != null && message.hasOwnProperty("cc"))
  1659. object.cc = message.cc;
  1660. return object;
  1661. };
  1662. /**
  1663. * Converts this BuildingInfo to JSON.
  1664. * @function toJSON
  1665. * @memberof tutorial.Message.BuildingInfo
  1666. * @instance
  1667. * @returns {Object.<string,*>} JSON object
  1668. */
  1669. BuildingInfo.prototype.toJSON = function toJSON() {
  1670. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1671. };
  1672. return BuildingInfo;
  1673. })();
  1674. Message.BuildingItems = (function() {
  1675. /**
  1676. * Properties of a BuildingItems.
  1677. * @memberof tutorial.Message
  1678. * @interface IBuildingItems
  1679. * @property {number|Long|null} [buildingId] BuildingItems buildingId
  1680. * @property {tutorial.Message.IItem|null} [item] BuildingItems item
  1681. */
  1682. /**
  1683. * Constructs a new BuildingItems.
  1684. * @memberof tutorial.Message
  1685. * @classdesc Represents a BuildingItems.
  1686. * @implements IBuildingItems
  1687. * @constructor
  1688. * @param {tutorial.Message.IBuildingItems=} [properties] Properties to set
  1689. */
  1690. function BuildingItems(properties) {
  1691. if (properties)
  1692. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1693. if (properties[keys[i]] != null)
  1694. this[keys[i]] = properties[keys[i]];
  1695. }
  1696. /**
  1697. * BuildingItems buildingId.
  1698. * @member {number|Long} buildingId
  1699. * @memberof tutorial.Message.BuildingItems
  1700. * @instance
  1701. */
  1702. BuildingItems.prototype.buildingId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1703. /**
  1704. * BuildingItems item.
  1705. * @member {tutorial.Message.IItem|null|undefined} item
  1706. * @memberof tutorial.Message.BuildingItems
  1707. * @instance
  1708. */
  1709. BuildingItems.prototype.item = null;
  1710. /**
  1711. * Creates a new BuildingItems instance using the specified properties.
  1712. * @function create
  1713. * @memberof tutorial.Message.BuildingItems
  1714. * @static
  1715. * @param {tutorial.Message.IBuildingItems=} [properties] Properties to set
  1716. * @returns {tutorial.Message.BuildingItems} BuildingItems instance
  1717. */
  1718. BuildingItems.create = function create(properties) {
  1719. return new BuildingItems(properties);
  1720. };
  1721. /**
  1722. * Encodes the specified BuildingItems message. Does not implicitly {@link tutorial.Message.BuildingItems.verify|verify} messages.
  1723. * @function encode
  1724. * @memberof tutorial.Message.BuildingItems
  1725. * @static
  1726. * @param {tutorial.Message.IBuildingItems} message BuildingItems message or plain object to encode
  1727. * @param {$protobuf.Writer} [writer] Writer to encode to
  1728. * @returns {$protobuf.Writer} Writer
  1729. */
  1730. BuildingItems.encode = function encode(message, writer) {
  1731. if (!writer)
  1732. writer = $Writer.create();
  1733. if (message.buildingId != null && message.hasOwnProperty("buildingId"))
  1734. writer.uint32(/* id 1, wireType 0 =*/8).int64(message.buildingId);
  1735. if (message.item != null && message.hasOwnProperty("item"))
  1736. $root.tutorial.Message.Item.encode(message.item, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  1737. return writer;
  1738. };
  1739. /**
  1740. * Encodes the specified BuildingItems message, length delimited. Does not implicitly {@link tutorial.Message.BuildingItems.verify|verify} messages.
  1741. * @function encodeDelimited
  1742. * @memberof tutorial.Message.BuildingItems
  1743. * @static
  1744. * @param {tutorial.Message.IBuildingItems} message BuildingItems message or plain object to encode
  1745. * @param {$protobuf.Writer} [writer] Writer to encode to
  1746. * @returns {$protobuf.Writer} Writer
  1747. */
  1748. BuildingItems.encodeDelimited = function encodeDelimited(message, writer) {
  1749. return this.encode(message, writer).ldelim();
  1750. };
  1751. /**
  1752. * Decodes a BuildingItems message from the specified reader or buffer.
  1753. * @function decode
  1754. * @memberof tutorial.Message.BuildingItems
  1755. * @static
  1756. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1757. * @param {number} [length] Message length if known beforehand
  1758. * @returns {tutorial.Message.BuildingItems} BuildingItems
  1759. * @throws {Error} If the payload is not a reader or valid buffer
  1760. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1761. */
  1762. BuildingItems.decode = function decode(reader, length) {
  1763. if (!(reader instanceof $Reader))
  1764. reader = $Reader.create(reader);
  1765. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.BuildingItems();
  1766. while (reader.pos < end) {
  1767. var tag = reader.uint32();
  1768. switch (tag >>> 3) {
  1769. case 1:
  1770. message.buildingId = reader.int64();
  1771. break;
  1772. case 2:
  1773. message.item = $root.tutorial.Message.Item.decode(reader, reader.uint32());
  1774. break;
  1775. default:
  1776. reader.skipType(tag & 7);
  1777. break;
  1778. }
  1779. }
  1780. return message;
  1781. };
  1782. /**
  1783. * Decodes a BuildingItems message from the specified reader or buffer, length delimited.
  1784. * @function decodeDelimited
  1785. * @memberof tutorial.Message.BuildingItems
  1786. * @static
  1787. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1788. * @returns {tutorial.Message.BuildingItems} BuildingItems
  1789. * @throws {Error} If the payload is not a reader or valid buffer
  1790. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1791. */
  1792. BuildingItems.decodeDelimited = function decodeDelimited(reader) {
  1793. if (!(reader instanceof $Reader))
  1794. reader = new $Reader(reader);
  1795. return this.decode(reader, reader.uint32());
  1796. };
  1797. /**
  1798. * Verifies a BuildingItems message.
  1799. * @function verify
  1800. * @memberof tutorial.Message.BuildingItems
  1801. * @static
  1802. * @param {Object.<string,*>} message Plain object to verify
  1803. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1804. */
  1805. BuildingItems.verify = function verify(message) {
  1806. if (typeof message !== "object" || message === null)
  1807. return "object expected";
  1808. if (message.buildingId != null && message.hasOwnProperty("buildingId"))
  1809. if (!$util.isInteger(message.buildingId) && !(message.buildingId && $util.isInteger(message.buildingId.low) && $util.isInteger(message.buildingId.high)))
  1810. return "buildingId: integer|Long expected";
  1811. if (message.item != null && message.hasOwnProperty("item")) {
  1812. var error = $root.tutorial.Message.Item.verify(message.item);
  1813. if (error)
  1814. return "item." + error;
  1815. }
  1816. return null;
  1817. };
  1818. /**
  1819. * Creates a BuildingItems message from a plain object. Also converts values to their respective internal types.
  1820. * @function fromObject
  1821. * @memberof tutorial.Message.BuildingItems
  1822. * @static
  1823. * @param {Object.<string,*>} object Plain object
  1824. * @returns {tutorial.Message.BuildingItems} BuildingItems
  1825. */
  1826. BuildingItems.fromObject = function fromObject(object) {
  1827. if (object instanceof $root.tutorial.Message.BuildingItems)
  1828. return object;
  1829. var message = new $root.tutorial.Message.BuildingItems();
  1830. if (object.buildingId != null)
  1831. if ($util.Long)
  1832. (message.buildingId = $util.Long.fromValue(object.buildingId)).unsigned = false;
  1833. else if (typeof object.buildingId === "string")
  1834. message.buildingId = parseInt(object.buildingId, 10);
  1835. else if (typeof object.buildingId === "number")
  1836. message.buildingId = object.buildingId;
  1837. else if (typeof object.buildingId === "object")
  1838. message.buildingId = new $util.LongBits(object.buildingId.low >>> 0, object.buildingId.high >>> 0).toNumber();
  1839. if (object.item != null) {
  1840. if (typeof object.item !== "object")
  1841. throw TypeError(".tutorial.Message.BuildingItems.item: object expected");
  1842. message.item = $root.tutorial.Message.Item.fromObject(object.item);
  1843. }
  1844. return message;
  1845. };
  1846. /**
  1847. * Creates a plain object from a BuildingItems message. Also converts values to other types if specified.
  1848. * @function toObject
  1849. * @memberof tutorial.Message.BuildingItems
  1850. * @static
  1851. * @param {tutorial.Message.BuildingItems} message BuildingItems
  1852. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1853. * @returns {Object.<string,*>} Plain object
  1854. */
  1855. BuildingItems.toObject = function toObject(message, options) {
  1856. if (!options)
  1857. options = {};
  1858. var object = {};
  1859. if (options.defaults) {
  1860. if ($util.Long) {
  1861. var long = new $util.Long(0, 0, false);
  1862. object.buildingId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1863. } else
  1864. object.buildingId = options.longs === String ? "0" : 0;
  1865. object.item = null;
  1866. }
  1867. if (message.buildingId != null && message.hasOwnProperty("buildingId"))
  1868. if (typeof message.buildingId === "number")
  1869. object.buildingId = options.longs === String ? String(message.buildingId) : message.buildingId;
  1870. else
  1871. object.buildingId = options.longs === String ? $util.Long.prototype.toString.call(message.buildingId) : options.longs === Number ? new $util.LongBits(message.buildingId.low >>> 0, message.buildingId.high >>> 0).toNumber() : message.buildingId;
  1872. if (message.item != null && message.hasOwnProperty("item"))
  1873. object.item = $root.tutorial.Message.Item.toObject(message.item, options);
  1874. return object;
  1875. };
  1876. /**
  1877. * Converts this BuildingItems to JSON.
  1878. * @function toJSON
  1879. * @memberof tutorial.Message.BuildingItems
  1880. * @instance
  1881. * @returns {Object.<string,*>} JSON object
  1882. */
  1883. BuildingItems.prototype.toJSON = function toJSON() {
  1884. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1885. };
  1886. return BuildingItems;
  1887. })();
  1888. Message.Item = (function() {
  1889. /**
  1890. * Properties of an Item.
  1891. * @memberof tutorial.Message
  1892. * @interface IItem
  1893. * @property {number|Long|null} [id] Item id
  1894. * @property {number|null} [count] Item count
  1895. */
  1896. /**
  1897. * Constructs a new Item.
  1898. * @memberof tutorial.Message
  1899. * @classdesc Represents an Item.
  1900. * @implements IItem
  1901. * @constructor
  1902. * @param {tutorial.Message.IItem=} [properties] Properties to set
  1903. */
  1904. function Item(properties) {
  1905. if (properties)
  1906. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1907. if (properties[keys[i]] != null)
  1908. this[keys[i]] = properties[keys[i]];
  1909. }
  1910. /**
  1911. * Item id.
  1912. * @member {number|Long} id
  1913. * @memberof tutorial.Message.Item
  1914. * @instance
  1915. */
  1916. Item.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1917. /**
  1918. * Item count.
  1919. * @member {number} count
  1920. * @memberof tutorial.Message.Item
  1921. * @instance
  1922. */
  1923. Item.prototype.count = 0;
  1924. /**
  1925. * Creates a new Item instance using the specified properties.
  1926. * @function create
  1927. * @memberof tutorial.Message.Item
  1928. * @static
  1929. * @param {tutorial.Message.IItem=} [properties] Properties to set
  1930. * @returns {tutorial.Message.Item} Item instance
  1931. */
  1932. Item.create = function create(properties) {
  1933. return new Item(properties);
  1934. };
  1935. /**
  1936. * Encodes the specified Item message. Does not implicitly {@link tutorial.Message.Item.verify|verify} messages.
  1937. * @function encode
  1938. * @memberof tutorial.Message.Item
  1939. * @static
  1940. * @param {tutorial.Message.IItem} message Item message or plain object to encode
  1941. * @param {$protobuf.Writer} [writer] Writer to encode to
  1942. * @returns {$protobuf.Writer} Writer
  1943. */
  1944. Item.encode = function encode(message, writer) {
  1945. if (!writer)
  1946. writer = $Writer.create();
  1947. if (message.id != null && message.hasOwnProperty("id"))
  1948. writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
  1949. if (message.count != null && message.hasOwnProperty("count"))
  1950. writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count);
  1951. return writer;
  1952. };
  1953. /**
  1954. * Encodes the specified Item message, length delimited. Does not implicitly {@link tutorial.Message.Item.verify|verify} messages.
  1955. * @function encodeDelimited
  1956. * @memberof tutorial.Message.Item
  1957. * @static
  1958. * @param {tutorial.Message.IItem} message Item message or plain object to encode
  1959. * @param {$protobuf.Writer} [writer] Writer to encode to
  1960. * @returns {$protobuf.Writer} Writer
  1961. */
  1962. Item.encodeDelimited = function encodeDelimited(message, writer) {
  1963. return this.encode(message, writer).ldelim();
  1964. };
  1965. /**
  1966. * Decodes an Item message from the specified reader or buffer.
  1967. * @function decode
  1968. * @memberof tutorial.Message.Item
  1969. * @static
  1970. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1971. * @param {number} [length] Message length if known beforehand
  1972. * @returns {tutorial.Message.Item} Item
  1973. * @throws {Error} If the payload is not a reader or valid buffer
  1974. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1975. */
  1976. Item.decode = function decode(reader, length) {
  1977. if (!(reader instanceof $Reader))
  1978. reader = $Reader.create(reader);
  1979. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.Item();
  1980. while (reader.pos < end) {
  1981. var tag = reader.uint32();
  1982. switch (tag >>> 3) {
  1983. case 1:
  1984. message.id = reader.int64();
  1985. break;
  1986. case 2:
  1987. message.count = reader.int32();
  1988. break;
  1989. default:
  1990. reader.skipType(tag & 7);
  1991. break;
  1992. }
  1993. }
  1994. return message;
  1995. };
  1996. /**
  1997. * Decodes an Item message from the specified reader or buffer, length delimited.
  1998. * @function decodeDelimited
  1999. * @memberof tutorial.Message.Item
  2000. * @static
  2001. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2002. * @returns {tutorial.Message.Item} Item
  2003. * @throws {Error} If the payload is not a reader or valid buffer
  2004. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2005. */
  2006. Item.decodeDelimited = function decodeDelimited(reader) {
  2007. if (!(reader instanceof $Reader))
  2008. reader = new $Reader(reader);
  2009. return this.decode(reader, reader.uint32());
  2010. };
  2011. /**
  2012. * Verifies an Item message.
  2013. * @function verify
  2014. * @memberof tutorial.Message.Item
  2015. * @static
  2016. * @param {Object.<string,*>} message Plain object to verify
  2017. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2018. */
  2019. Item.verify = function verify(message) {
  2020. if (typeof message !== "object" || message === null)
  2021. return "object expected";
  2022. if (message.id != null && message.hasOwnProperty("id"))
  2023. if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
  2024. return "id: integer|Long expected";
  2025. if (message.count != null && message.hasOwnProperty("count"))
  2026. if (!$util.isInteger(message.count))
  2027. return "count: integer expected";
  2028. return null;
  2029. };
  2030. /**
  2031. * Creates an Item message from a plain object. Also converts values to their respective internal types.
  2032. * @function fromObject
  2033. * @memberof tutorial.Message.Item
  2034. * @static
  2035. * @param {Object.<string,*>} object Plain object
  2036. * @returns {tutorial.Message.Item} Item
  2037. */
  2038. Item.fromObject = function fromObject(object) {
  2039. if (object instanceof $root.tutorial.Message.Item)
  2040. return object;
  2041. var message = new $root.tutorial.Message.Item();
  2042. if (object.id != null)
  2043. if ($util.Long)
  2044. (message.id = $util.Long.fromValue(object.id)).unsigned = false;
  2045. else if (typeof object.id === "string")
  2046. message.id = parseInt(object.id, 10);
  2047. else if (typeof object.id === "number")
  2048. message.id = object.id;
  2049. else if (typeof object.id === "object")
  2050. message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
  2051. if (object.count != null)
  2052. message.count = object.count | 0;
  2053. return message;
  2054. };
  2055. /**
  2056. * Creates a plain object from an Item message. Also converts values to other types if specified.
  2057. * @function toObject
  2058. * @memberof tutorial.Message.Item
  2059. * @static
  2060. * @param {tutorial.Message.Item} message Item
  2061. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2062. * @returns {Object.<string,*>} Plain object
  2063. */
  2064. Item.toObject = function toObject(message, options) {
  2065. if (!options)
  2066. options = {};
  2067. var object = {};
  2068. if (options.defaults) {
  2069. if ($util.Long) {
  2070. var long = new $util.Long(0, 0, false);
  2071. object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  2072. } else
  2073. object.id = options.longs === String ? "0" : 0;
  2074. object.count = 0;
  2075. }
  2076. if (message.id != null && message.hasOwnProperty("id"))
  2077. if (typeof message.id === "number")
  2078. object.id = options.longs === String ? String(message.id) : message.id;
  2079. else
  2080. object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id;
  2081. if (message.count != null && message.hasOwnProperty("count"))
  2082. object.count = message.count;
  2083. return object;
  2084. };
  2085. /**
  2086. * Converts this Item to JSON.
  2087. * @function toJSON
  2088. * @memberof tutorial.Message.Item
  2089. * @instance
  2090. * @returns {Object.<string,*>} JSON object
  2091. */
  2092. Item.prototype.toJSON = function toJSON() {
  2093. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2094. };
  2095. return Item;
  2096. })();
  2097. return Message;
  2098. })();
  2099. return tutorial;
  2100. })();
  2101. return $root;
  2102. });