Bundle.js 118 KB

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