|
@@ -37,6 +37,7 @@
|
|
|
* @property {tutorial.Message.IRoleOptMessage|null} [roleOptMessage] Message roleOptMessage
|
|
|
* @property {tutorial.Message.IReportData|null} [reportData] Message reportData
|
|
|
* @property {string|null} [msg] Message msg
|
|
|
+ * @property {tutorial.Message.IBuildingItems|null} [buildingItems] Message buildingItems
|
|
|
*/
|
|
|
|
|
|
/**
|
|
@@ -103,6 +104,14 @@
|
|
|
Message.prototype.msg = "";
|
|
|
|
|
|
/**
|
|
|
+ * Message buildingItems.
|
|
|
+ * @member {tutorial.Message.IBuildingItems|null|undefined} buildingItems
|
|
|
+ * @memberof tutorial.Message
|
|
|
+ * @instance
|
|
|
+ */
|
|
|
+ Message.prototype.buildingItems = null;
|
|
|
+
|
|
|
+ /**
|
|
|
* Creates a new Message instance using the specified properties.
|
|
|
* @function create
|
|
|
* @memberof tutorial.Message
|
|
@@ -138,6 +147,8 @@
|
|
|
$root.tutorial.Message.ReportData.encode(message.reportData, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
|
if (message.msg != null && message.hasOwnProperty("msg"))
|
|
|
writer.uint32(/* id 6, wireType 2 =*/50).string(message.msg);
|
|
|
+ if (message.buildingItems != null && message.hasOwnProperty("buildingItems"))
|
|
|
+ $root.tutorial.Message.BuildingItems.encode(message.buildingItems, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
|
|
return writer;
|
|
|
};
|
|
|
|
|
@@ -190,6 +201,9 @@
|
|
|
case 6:
|
|
|
message.msg = reader.string();
|
|
|
break;
|
|
|
+ case 7:
|
|
|
+ message.buildingItems = $root.tutorial.Message.BuildingItems.decode(reader, reader.uint32());
|
|
|
+ break;
|
|
|
default:
|
|
|
reader.skipType(tag & 7);
|
|
|
break;
|
|
@@ -234,6 +248,8 @@
|
|
|
case 2:
|
|
|
case 3:
|
|
|
case 4:
|
|
|
+ case 5:
|
|
|
+ case 6:
|
|
|
break;
|
|
|
}
|
|
|
if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) {
|
|
@@ -259,6 +275,11 @@
|
|
|
if (message.msg != null && message.hasOwnProperty("msg"))
|
|
|
if (!$util.isString(message.msg))
|
|
|
return "msg: string expected";
|
|
|
+ if (message.buildingItems != null && message.hasOwnProperty("buildingItems")) {
|
|
|
+ var error = $root.tutorial.Message.BuildingItems.verify(message.buildingItems);
|
|
|
+ if (error)
|
|
|
+ return "buildingItems." + error;
|
|
|
+ }
|
|
|
return null;
|
|
|
};
|
|
|
|
|
@@ -295,6 +316,14 @@
|
|
|
case 4:
|
|
|
message.type = 4;
|
|
|
break;
|
|
|
+ case "BD_ITEM":
|
|
|
+ case 5:
|
|
|
+ message.type = 5;
|
|
|
+ break;
|
|
|
+ case "HB":
|
|
|
+ case 6:
|
|
|
+ message.type = 6;
|
|
|
+ break;
|
|
|
}
|
|
|
if (object.dataMessage != null) {
|
|
|
if (typeof object.dataMessage !== "object")
|
|
@@ -318,6 +347,11 @@
|
|
|
}
|
|
|
if (object.msg != null)
|
|
|
message.msg = String(object.msg);
|
|
|
+ if (object.buildingItems != null) {
|
|
|
+ if (typeof object.buildingItems !== "object")
|
|
|
+ throw TypeError(".tutorial.Message.buildingItems: object expected");
|
|
|
+ message.buildingItems = $root.tutorial.Message.BuildingItems.fromObject(object.buildingItems);
|
|
|
+ }
|
|
|
return message;
|
|
|
};
|
|
|
|
|
@@ -341,6 +375,7 @@
|
|
|
object.roleOptMessage = null;
|
|
|
object.reportData = null;
|
|
|
object.msg = "";
|
|
|
+ object.buildingItems = null;
|
|
|
}
|
|
|
if (message.type != null && message.hasOwnProperty("type"))
|
|
|
object.type = options.enums === String ? $root.tutorial.Message.Type[message.type] : message.type;
|
|
@@ -354,6 +389,8 @@
|
|
|
object.reportData = $root.tutorial.Message.ReportData.toObject(message.reportData, options);
|
|
|
if (message.msg != null && message.hasOwnProperty("msg"))
|
|
|
object.msg = message.msg;
|
|
|
+ if (message.buildingItems != null && message.hasOwnProperty("buildingItems"))
|
|
|
+ object.buildingItems = $root.tutorial.Message.BuildingItems.toObject(message.buildingItems, options);
|
|
|
return object;
|
|
|
};
|
|
|
|
|
@@ -377,6 +414,8 @@
|
|
|
* @property {number} NOTIFY=2 NOTIFY value
|
|
|
* @property {number} ROLEOPT=3 ROLEOPT value
|
|
|
* @property {number} REPORT=4 REPORT value
|
|
|
+ * @property {number} BD_ITEM=5 BD_ITEM value
|
|
|
+ * @property {number} HB=6 HB value
|
|
|
*/
|
|
|
Message.Type = (function() {
|
|
|
var valuesById = {}, values = Object.create(valuesById);
|
|
@@ -385,6 +424,8 @@
|
|
|
values[valuesById[2] = "NOTIFY"] = 2;
|
|
|
values[valuesById[3] = "ROLEOPT"] = 3;
|
|
|
values[valuesById[4] = "REPORT"] = 4;
|
|
|
+ values[valuesById[5] = "BD_ITEM"] = 5;
|
|
|
+ values[valuesById[6] = "HB"] = 6;
|
|
|
return values;
|
|
|
})();
|
|
|
|
|
@@ -1741,6 +1782,459 @@
|
|
|
return BuildingInfo;
|
|
|
})();
|
|
|
|
|
|
+ Message.BuildingItems = (function() {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Properties of a BuildingItems.
|
|
|
+ * @memberof tutorial.Message
|
|
|
+ * @interface IBuildingItems
|
|
|
+ * @property {number|Long|null} [buildingId] BuildingItems buildingId
|
|
|
+ * @property {tutorial.Message.IItem|null} [item] BuildingItems item
|
|
|
+ */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Constructs a new BuildingItems.
|
|
|
+ * @memberof tutorial.Message
|
|
|
+ * @classdesc Represents a BuildingItems.
|
|
|
+ * @implements IBuildingItems
|
|
|
+ * @constructor
|
|
|
+ * @param {tutorial.Message.IBuildingItems=} [properties] Properties to set
|
|
|
+ */
|
|
|
+ function BuildingItems(properties) {
|
|
|
+ if (properties)
|
|
|
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
|
+ if (properties[keys[i]] != null)
|
|
|
+ this[keys[i]] = properties[keys[i]];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * BuildingItems buildingId.
|
|
|
+ * @member {number|Long} buildingId
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @instance
|
|
|
+ */
|
|
|
+ BuildingItems.prototype.buildingId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * BuildingItems item.
|
|
|
+ * @member {tutorial.Message.IItem|null|undefined} item
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @instance
|
|
|
+ */
|
|
|
+ BuildingItems.prototype.item = null;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates a new BuildingItems instance using the specified properties.
|
|
|
+ * @function create
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @static
|
|
|
+ * @param {tutorial.Message.IBuildingItems=} [properties] Properties to set
|
|
|
+ * @returns {tutorial.Message.BuildingItems} BuildingItems instance
|
|
|
+ */
|
|
|
+ BuildingItems.create = function create(properties) {
|
|
|
+ return new BuildingItems(properties);
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Encodes the specified BuildingItems message. Does not implicitly {@link tutorial.Message.BuildingItems.verify|verify} messages.
|
|
|
+ * @function encode
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @static
|
|
|
+ * @param {tutorial.Message.IBuildingItems} message BuildingItems message or plain object to encode
|
|
|
+ * @param {$protobuf.Writer} [writer] Writer to encode to
|
|
|
+ * @returns {$protobuf.Writer} Writer
|
|
|
+ */
|
|
|
+ BuildingItems.encode = function encode(message, writer) {
|
|
|
+ if (!writer)
|
|
|
+ writer = $Writer.create();
|
|
|
+ if (message.buildingId != null && message.hasOwnProperty("buildingId"))
|
|
|
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.buildingId);
|
|
|
+ if (message.item != null && message.hasOwnProperty("item"))
|
|
|
+ $root.tutorial.Message.Item.encode(message.item, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
|
+ return writer;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Encodes the specified BuildingItems message, length delimited. Does not implicitly {@link tutorial.Message.BuildingItems.verify|verify} messages.
|
|
|
+ * @function encodeDelimited
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @static
|
|
|
+ * @param {tutorial.Message.IBuildingItems} message BuildingItems message or plain object to encode
|
|
|
+ * @param {$protobuf.Writer} [writer] Writer to encode to
|
|
|
+ * @returns {$protobuf.Writer} Writer
|
|
|
+ */
|
|
|
+ BuildingItems.encodeDelimited = function encodeDelimited(message, writer) {
|
|
|
+ return this.encode(message, writer).ldelim();
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Decodes a BuildingItems message from the specified reader or buffer.
|
|
|
+ * @function decode
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @static
|
|
|
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
|
+ * @param {number} [length] Message length if known beforehand
|
|
|
+ * @returns {tutorial.Message.BuildingItems} BuildingItems
|
|
|
+ * @throws {Error} If the payload is not a reader or valid buffer
|
|
|
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
|
+ */
|
|
|
+ BuildingItems.decode = function decode(reader, length) {
|
|
|
+ if (!(reader instanceof $Reader))
|
|
|
+ reader = $Reader.create(reader);
|
|
|
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.BuildingItems();
|
|
|
+ while (reader.pos < end) {
|
|
|
+ var tag = reader.uint32();
|
|
|
+ switch (tag >>> 3) {
|
|
|
+ case 1:
|
|
|
+ message.buildingId = reader.int64();
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ message.item = $root.tutorial.Message.Item.decode(reader, reader.uint32());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ reader.skipType(tag & 7);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return message;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Decodes a BuildingItems message from the specified reader or buffer, length delimited.
|
|
|
+ * @function decodeDelimited
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @static
|
|
|
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
|
+ * @returns {tutorial.Message.BuildingItems} BuildingItems
|
|
|
+ * @throws {Error} If the payload is not a reader or valid buffer
|
|
|
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
|
+ */
|
|
|
+ BuildingItems.decodeDelimited = function decodeDelimited(reader) {
|
|
|
+ if (!(reader instanceof $Reader))
|
|
|
+ reader = new $Reader(reader);
|
|
|
+ return this.decode(reader, reader.uint32());
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Verifies a BuildingItems message.
|
|
|
+ * @function verify
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @static
|
|
|
+ * @param {Object.<string,*>} message Plain object to verify
|
|
|
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
|
+ */
|
|
|
+ BuildingItems.verify = function verify(message) {
|
|
|
+ if (typeof message !== "object" || message === null)
|
|
|
+ return "object expected";
|
|
|
+ if (message.buildingId != null && message.hasOwnProperty("buildingId"))
|
|
|
+ if (!$util.isInteger(message.buildingId) && !(message.buildingId && $util.isInteger(message.buildingId.low) && $util.isInteger(message.buildingId.high)))
|
|
|
+ return "buildingId: integer|Long expected";
|
|
|
+ if (message.item != null && message.hasOwnProperty("item")) {
|
|
|
+ var error = $root.tutorial.Message.Item.verify(message.item);
|
|
|
+ if (error)
|
|
|
+ return "item." + error;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates a BuildingItems message from a plain object. Also converts values to their respective internal types.
|
|
|
+ * @function fromObject
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @static
|
|
|
+ * @param {Object.<string,*>} object Plain object
|
|
|
+ * @returns {tutorial.Message.BuildingItems} BuildingItems
|
|
|
+ */
|
|
|
+ BuildingItems.fromObject = function fromObject(object) {
|
|
|
+ if (object instanceof $root.tutorial.Message.BuildingItems)
|
|
|
+ return object;
|
|
|
+ var message = new $root.tutorial.Message.BuildingItems();
|
|
|
+ if (object.buildingId != null)
|
|
|
+ if ($util.Long)
|
|
|
+ (message.buildingId = $util.Long.fromValue(object.buildingId)).unsigned = false;
|
|
|
+ else if (typeof object.buildingId === "string")
|
|
|
+ message.buildingId = parseInt(object.buildingId, 10);
|
|
|
+ else if (typeof object.buildingId === "number")
|
|
|
+ message.buildingId = object.buildingId;
|
|
|
+ else if (typeof object.buildingId === "object")
|
|
|
+ message.buildingId = new $util.LongBits(object.buildingId.low >>> 0, object.buildingId.high >>> 0).toNumber();
|
|
|
+ if (object.item != null) {
|
|
|
+ if (typeof object.item !== "object")
|
|
|
+ throw TypeError(".tutorial.Message.BuildingItems.item: object expected");
|
|
|
+ message.item = $root.tutorial.Message.Item.fromObject(object.item);
|
|
|
+ }
|
|
|
+ return message;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates a plain object from a BuildingItems message. Also converts values to other types if specified.
|
|
|
+ * @function toObject
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @static
|
|
|
+ * @param {tutorial.Message.BuildingItems} message BuildingItems
|
|
|
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
|
+ * @returns {Object.<string,*>} Plain object
|
|
|
+ */
|
|
|
+ BuildingItems.toObject = function toObject(message, options) {
|
|
|
+ if (!options)
|
|
|
+ options = {};
|
|
|
+ var object = {};
|
|
|
+ if (options.defaults) {
|
|
|
+ if ($util.Long) {
|
|
|
+ var long = new $util.Long(0, 0, false);
|
|
|
+ object.buildingId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
|
+ } else
|
|
|
+ object.buildingId = options.longs === String ? "0" : 0;
|
|
|
+ object.item = null;
|
|
|
+ }
|
|
|
+ if (message.buildingId != null && message.hasOwnProperty("buildingId"))
|
|
|
+ if (typeof message.buildingId === "number")
|
|
|
+ object.buildingId = options.longs === String ? String(message.buildingId) : message.buildingId;
|
|
|
+ else
|
|
|
+ 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;
|
|
|
+ if (message.item != null && message.hasOwnProperty("item"))
|
|
|
+ object.item = $root.tutorial.Message.Item.toObject(message.item, options);
|
|
|
+ return object;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Converts this BuildingItems to JSON.
|
|
|
+ * @function toJSON
|
|
|
+ * @memberof tutorial.Message.BuildingItems
|
|
|
+ * @instance
|
|
|
+ * @returns {Object.<string,*>} JSON object
|
|
|
+ */
|
|
|
+ BuildingItems.prototype.toJSON = function toJSON() {
|
|
|
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
|
+ };
|
|
|
+
|
|
|
+ return BuildingItems;
|
|
|
+ })();
|
|
|
+
|
|
|
+ Message.Item = (function() {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Properties of an Item.
|
|
|
+ * @memberof tutorial.Message
|
|
|
+ * @interface IItem
|
|
|
+ * @property {number|Long|null} [id] Item id
|
|
|
+ * @property {number|null} [count] Item count
|
|
|
+ */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Constructs a new Item.
|
|
|
+ * @memberof tutorial.Message
|
|
|
+ * @classdesc Represents an Item.
|
|
|
+ * @implements IItem
|
|
|
+ * @constructor
|
|
|
+ * @param {tutorial.Message.IItem=} [properties] Properties to set
|
|
|
+ */
|
|
|
+ function Item(properties) {
|
|
|
+ if (properties)
|
|
|
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
|
+ if (properties[keys[i]] != null)
|
|
|
+ this[keys[i]] = properties[keys[i]];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Item id.
|
|
|
+ * @member {number|Long} id
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @instance
|
|
|
+ */
|
|
|
+ Item.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Item count.
|
|
|
+ * @member {number} count
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @instance
|
|
|
+ */
|
|
|
+ Item.prototype.count = 0;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates a new Item instance using the specified properties.
|
|
|
+ * @function create
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @static
|
|
|
+ * @param {tutorial.Message.IItem=} [properties] Properties to set
|
|
|
+ * @returns {tutorial.Message.Item} Item instance
|
|
|
+ */
|
|
|
+ Item.create = function create(properties) {
|
|
|
+ return new Item(properties);
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Encodes the specified Item message. Does not implicitly {@link tutorial.Message.Item.verify|verify} messages.
|
|
|
+ * @function encode
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @static
|
|
|
+ * @param {tutorial.Message.IItem} message Item message or plain object to encode
|
|
|
+ * @param {$protobuf.Writer} [writer] Writer to encode to
|
|
|
+ * @returns {$protobuf.Writer} Writer
|
|
|
+ */
|
|
|
+ Item.encode = function encode(message, writer) {
|
|
|
+ if (!writer)
|
|
|
+ writer = $Writer.create();
|
|
|
+ if (message.id != null && message.hasOwnProperty("id"))
|
|
|
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
|
|
|
+ if (message.count != null && message.hasOwnProperty("count"))
|
|
|
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count);
|
|
|
+ return writer;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Encodes the specified Item message, length delimited. Does not implicitly {@link tutorial.Message.Item.verify|verify} messages.
|
|
|
+ * @function encodeDelimited
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @static
|
|
|
+ * @param {tutorial.Message.IItem} message Item message or plain object to encode
|
|
|
+ * @param {$protobuf.Writer} [writer] Writer to encode to
|
|
|
+ * @returns {$protobuf.Writer} Writer
|
|
|
+ */
|
|
|
+ Item.encodeDelimited = function encodeDelimited(message, writer) {
|
|
|
+ return this.encode(message, writer).ldelim();
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Decodes an Item message from the specified reader or buffer.
|
|
|
+ * @function decode
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @static
|
|
|
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
|
+ * @param {number} [length] Message length if known beforehand
|
|
|
+ * @returns {tutorial.Message.Item} Item
|
|
|
+ * @throws {Error} If the payload is not a reader or valid buffer
|
|
|
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
|
+ */
|
|
|
+ Item.decode = function decode(reader, length) {
|
|
|
+ if (!(reader instanceof $Reader))
|
|
|
+ reader = $Reader.create(reader);
|
|
|
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.Item();
|
|
|
+ while (reader.pos < end) {
|
|
|
+ var tag = reader.uint32();
|
|
|
+ switch (tag >>> 3) {
|
|
|
+ case 1:
|
|
|
+ message.id = reader.int64();
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ message.count = reader.int32();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ reader.skipType(tag & 7);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return message;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Decodes an Item message from the specified reader or buffer, length delimited.
|
|
|
+ * @function decodeDelimited
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @static
|
|
|
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
|
+ * @returns {tutorial.Message.Item} Item
|
|
|
+ * @throws {Error} If the payload is not a reader or valid buffer
|
|
|
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
|
+ */
|
|
|
+ Item.decodeDelimited = function decodeDelimited(reader) {
|
|
|
+ if (!(reader instanceof $Reader))
|
|
|
+ reader = new $Reader(reader);
|
|
|
+ return this.decode(reader, reader.uint32());
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Verifies an Item message.
|
|
|
+ * @function verify
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @static
|
|
|
+ * @param {Object.<string,*>} message Plain object to verify
|
|
|
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
|
+ */
|
|
|
+ Item.verify = function verify(message) {
|
|
|
+ if (typeof message !== "object" || message === null)
|
|
|
+ return "object expected";
|
|
|
+ if (message.id != null && message.hasOwnProperty("id"))
|
|
|
+ if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
|
|
|
+ return "id: integer|Long expected";
|
|
|
+ if (message.count != null && message.hasOwnProperty("count"))
|
|
|
+ if (!$util.isInteger(message.count))
|
|
|
+ return "count: integer expected";
|
|
|
+ return null;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates an Item message from a plain object. Also converts values to their respective internal types.
|
|
|
+ * @function fromObject
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @static
|
|
|
+ * @param {Object.<string,*>} object Plain object
|
|
|
+ * @returns {tutorial.Message.Item} Item
|
|
|
+ */
|
|
|
+ Item.fromObject = function fromObject(object) {
|
|
|
+ if (object instanceof $root.tutorial.Message.Item)
|
|
|
+ return object;
|
|
|
+ var message = new $root.tutorial.Message.Item();
|
|
|
+ if (object.id != null)
|
|
|
+ if ($util.Long)
|
|
|
+ (message.id = $util.Long.fromValue(object.id)).unsigned = false;
|
|
|
+ else if (typeof object.id === "string")
|
|
|
+ message.id = parseInt(object.id, 10);
|
|
|
+ else if (typeof object.id === "number")
|
|
|
+ message.id = object.id;
|
|
|
+ else if (typeof object.id === "object")
|
|
|
+ message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
|
|
|
+ if (object.count != null)
|
|
|
+ message.count = object.count | 0;
|
|
|
+ return message;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates a plain object from an Item message. Also converts values to other types if specified.
|
|
|
+ * @function toObject
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @static
|
|
|
+ * @param {tutorial.Message.Item} message Item
|
|
|
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
|
+ * @returns {Object.<string,*>} Plain object
|
|
|
+ */
|
|
|
+ Item.toObject = function toObject(message, options) {
|
|
|
+ if (!options)
|
|
|
+ options = {};
|
|
|
+ var object = {};
|
|
|
+ if (options.defaults) {
|
|
|
+ if ($util.Long) {
|
|
|
+ var long = new $util.Long(0, 0, false);
|
|
|
+ object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
|
+ } else
|
|
|
+ object.id = options.longs === String ? "0" : 0;
|
|
|
+ object.count = 0;
|
|
|
+ }
|
|
|
+ if (message.id != null && message.hasOwnProperty("id"))
|
|
|
+ if (typeof message.id === "number")
|
|
|
+ object.id = options.longs === String ? String(message.id) : message.id;
|
|
|
+ else
|
|
|
+ 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;
|
|
|
+ if (message.count != null && message.hasOwnProperty("count"))
|
|
|
+ object.count = message.count;
|
|
|
+ return object;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Converts this Item to JSON.
|
|
|
+ * @function toJSON
|
|
|
+ * @memberof tutorial.Message.Item
|
|
|
+ * @instance
|
|
|
+ * @returns {Object.<string,*>} JSON object
|
|
|
+ */
|
|
|
+ Item.prototype.toJSON = function toJSON() {
|
|
|
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
|
+ };
|
|
|
+
|
|
|
+ return Item;
|
|
|
+ })();
|
|
|
+
|
|
|
return Message;
|
|
|
})();
|
|
|
|