docs/proto/message.js
2024-12-24 15:51:12 +08:00

77296 lines
3.1 MiB

/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";
var $protobuf = require("protobufjs/minimal");
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.tutorial = (function() {
/**
* Namespace tutorial.
* @exports tutorial
* @namespace
*/
var tutorial = {};
/**
* HANDLE_TYPE enum.
* @name tutorial.HANDLE_TYPE
* @enum {number}
* @property {number} ADD=0 ADD value
* @property {number} COMPOSE=1 COMPOSE value
* @property {number} BUY=2 BUY value
* @property {number} SELL=3 SELL value
* @property {number} REMOVE=4 REMOVE value
*/
tutorial.HANDLE_TYPE = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "ADD"] = 0;
values[valuesById[1] = "COMPOSE"] = 1;
values[valuesById[2] = "BUY"] = 2;
values[valuesById[3] = "SELL"] = 3;
values[valuesById[4] = "REMOVE"] = 4;
return values;
})();
/**
* RES_CODE enum.
* @name tutorial.RES_CODE
* @enum {number}
* @property {number} FAIL=0 FAIL value
* @property {number} SUCCESS=1 SUCCESS value
*/
tutorial.RES_CODE = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "FAIL"] = 0;
values[valuesById[1] = "SUCCESS"] = 1;
return values;
})();
/**
* ITEM_TYPE enum.
* @name tutorial.ITEM_TYPE
* @enum {number}
* @property {number} ENERGY=0 ENERGY value
* @property {number} STAR=1 STAR value
* @property {number} DIAMOND=2 DIAMOND value
*/
tutorial.ITEM_TYPE = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "ENERGY"] = 0;
values[valuesById[1] = "STAR"] = 1;
values[valuesById[2] = "DIAMOND"] = 2;
return values;
})();
tutorial.ClientReq = (function() {
/**
* Properties of a ClientReq.
* @memberof tutorial
* @interface IClientReq
* @property {string|null} [func] ClientReq func
* @property {string|null} [cid] ClientReq cid
* @property {Uint8Array|null} [info] ClientReq info
* @property {string|null} [sessionId] ClientReq sessionId
* @property {string|null} [gatewayId] ClientReq gatewayId
* @property {string|null} [userId] ClientReq userId
* @property {string|null} [userBase] ClientReq userBase
*/
/**
* Constructs a new ClientReq.
* @memberof tutorial
* @classdesc Represents a ClientReq.
* @implements IClientReq
* @constructor
* @param {tutorial.IClientReq=} [properties] Properties to set
*/
function ClientReq(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]];
}
/**
* ClientReq func.
* @member {string} func
* @memberof tutorial.ClientReq
* @instance
*/
ClientReq.prototype.func = "";
/**
* ClientReq cid.
* @member {string} cid
* @memberof tutorial.ClientReq
* @instance
*/
ClientReq.prototype.cid = "";
/**
* ClientReq info.
* @member {Uint8Array} info
* @memberof tutorial.ClientReq
* @instance
*/
ClientReq.prototype.info = $util.newBuffer([]);
/**
* ClientReq sessionId.
* @member {string} sessionId
* @memberof tutorial.ClientReq
* @instance
*/
ClientReq.prototype.sessionId = "";
/**
* ClientReq gatewayId.
* @member {string} gatewayId
* @memberof tutorial.ClientReq
* @instance
*/
ClientReq.prototype.gatewayId = "";
/**
* ClientReq userId.
* @member {string} userId
* @memberof tutorial.ClientReq
* @instance
*/
ClientReq.prototype.userId = "";
/**
* ClientReq userBase.
* @member {string} userBase
* @memberof tutorial.ClientReq
* @instance
*/
ClientReq.prototype.userBase = "";
/**
* Creates a new ClientReq instance using the specified properties.
* @function create
* @memberof tutorial.ClientReq
* @static
* @param {tutorial.IClientReq=} [properties] Properties to set
* @returns {tutorial.ClientReq} ClientReq instance
*/
ClientReq.create = function create(properties) {
return new ClientReq(properties);
};
/**
* Encodes the specified ClientReq message. Does not implicitly {@link tutorial.ClientReq.verify|verify} messages.
* @function encode
* @memberof tutorial.ClientReq
* @static
* @param {tutorial.IClientReq} message ClientReq message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ClientReq.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.func != null && Object.hasOwnProperty.call(message, "func"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.func);
if (message.cid != null && Object.hasOwnProperty.call(message, "cid"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.cid);
if (message.info != null && Object.hasOwnProperty.call(message, "info"))
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.info);
if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.sessionId);
if (message.gatewayId != null && Object.hasOwnProperty.call(message, "gatewayId"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.gatewayId);
if (message.userId != null && Object.hasOwnProperty.call(message, "userId"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.userId);
if (message.userBase != null && Object.hasOwnProperty.call(message, "userBase"))
writer.uint32(/* id 7, wireType 2 =*/58).string(message.userBase);
return writer;
};
/**
* Encodes the specified ClientReq message, length delimited. Does not implicitly {@link tutorial.ClientReq.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ClientReq
* @static
* @param {tutorial.IClientReq} message ClientReq message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ClientReq.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ClientReq message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ClientReq
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ClientReq} ClientReq
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ClientReq.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.ClientReq();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.func = reader.string();
break;
}
case 2: {
message.cid = reader.string();
break;
}
case 3: {
message.info = reader.bytes();
break;
}
case 4: {
message.sessionId = reader.string();
break;
}
case 5: {
message.gatewayId = reader.string();
break;
}
case 6: {
message.userId = reader.string();
break;
}
case 7: {
message.userBase = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ClientReq message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ClientReq
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ClientReq} ClientReq
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ClientReq.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ClientReq message.
* @function verify
* @memberof tutorial.ClientReq
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ClientReq.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.func != null && message.hasOwnProperty("func"))
if (!$util.isString(message.func))
return "func: string expected";
if (message.cid != null && message.hasOwnProperty("cid"))
if (!$util.isString(message.cid))
return "cid: string expected";
if (message.info != null && message.hasOwnProperty("info"))
if (!(message.info && typeof message.info.length === "number" || $util.isString(message.info)))
return "info: buffer expected";
if (message.sessionId != null && message.hasOwnProperty("sessionId"))
if (!$util.isString(message.sessionId))
return "sessionId: string expected";
if (message.gatewayId != null && message.hasOwnProperty("gatewayId"))
if (!$util.isString(message.gatewayId))
return "gatewayId: string expected";
if (message.userId != null && message.hasOwnProperty("userId"))
if (!$util.isString(message.userId))
return "userId: string expected";
if (message.userBase != null && message.hasOwnProperty("userBase"))
if (!$util.isString(message.userBase))
return "userBase: string expected";
return null;
};
/**
* Creates a ClientReq message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ClientReq
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ClientReq} ClientReq
*/
ClientReq.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ClientReq)
return object;
var message = new $root.tutorial.ClientReq();
if (object.func != null)
message.func = String(object.func);
if (object.cid != null)
message.cid = String(object.cid);
if (object.info != null)
if (typeof object.info === "string")
$util.base64.decode(object.info, message.info = $util.newBuffer($util.base64.length(object.info)), 0);
else if (object.info.length >= 0)
message.info = object.info;
if (object.sessionId != null)
message.sessionId = String(object.sessionId);
if (object.gatewayId != null)
message.gatewayId = String(object.gatewayId);
if (object.userId != null)
message.userId = String(object.userId);
if (object.userBase != null)
message.userBase = String(object.userBase);
return message;
};
/**
* Creates a plain object from a ClientReq message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ClientReq
* @static
* @param {tutorial.ClientReq} message ClientReq
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ClientReq.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.func = "";
object.cid = "";
if (options.bytes === String)
object.info = "";
else {
object.info = [];
if (options.bytes !== Array)
object.info = $util.newBuffer(object.info);
}
object.sessionId = "";
object.gatewayId = "";
object.userId = "";
object.userBase = "";
}
if (message.func != null && message.hasOwnProperty("func"))
object.func = message.func;
if (message.cid != null && message.hasOwnProperty("cid"))
object.cid = message.cid;
if (message.info != null && message.hasOwnProperty("info"))
object.info = options.bytes === String ? $util.base64.encode(message.info, 0, message.info.length) : options.bytes === Array ? Array.prototype.slice.call(message.info) : message.info;
if (message.sessionId != null && message.hasOwnProperty("sessionId"))
object.sessionId = message.sessionId;
if (message.gatewayId != null && message.hasOwnProperty("gatewayId"))
object.gatewayId = message.gatewayId;
if (message.userId != null && message.hasOwnProperty("userId"))
object.userId = message.userId;
if (message.userBase != null && message.hasOwnProperty("userBase"))
object.userBase = message.userBase;
return object;
};
/**
* Converts this ClientReq to JSON.
* @function toJSON
* @memberof tutorial.ClientReq
* @instance
* @returns {Object.<string,*>} JSON object
*/
ClientReq.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ClientReq
* @function getTypeUrl
* @memberof tutorial.ClientReq
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ClientReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ClientReq";
};
return ClientReq;
})();
tutorial.ReqOfflineReconnect = (function() {
/**
* Properties of a ReqOfflineReconnect.
* @memberof tutorial
* @interface IReqOfflineReconnect
* @property {number|null} [dwUin] ReqOfflineReconnect dwUin
*/
/**
* Constructs a new ReqOfflineReconnect.
* @memberof tutorial
* @classdesc Represents a ReqOfflineReconnect.
* @implements IReqOfflineReconnect
* @constructor
* @param {tutorial.IReqOfflineReconnect=} [properties] Properties to set
*/
function ReqOfflineReconnect(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]];
}
/**
* ReqOfflineReconnect dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqOfflineReconnect
* @instance
*/
ReqOfflineReconnect.prototype.dwUin = 0;
/**
* Creates a new ReqOfflineReconnect instance using the specified properties.
* @function create
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {tutorial.IReqOfflineReconnect=} [properties] Properties to set
* @returns {tutorial.ReqOfflineReconnect} ReqOfflineReconnect instance
*/
ReqOfflineReconnect.create = function create(properties) {
return new ReqOfflineReconnect(properties);
};
/**
* Encodes the specified ReqOfflineReconnect message. Does not implicitly {@link tutorial.ReqOfflineReconnect.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {tutorial.IReqOfflineReconnect} message ReqOfflineReconnect message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqOfflineReconnect.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqOfflineReconnect message, length delimited. Does not implicitly {@link tutorial.ReqOfflineReconnect.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {tutorial.IReqOfflineReconnect} message ReqOfflineReconnect message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqOfflineReconnect.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqOfflineReconnect message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqOfflineReconnect} ReqOfflineReconnect
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqOfflineReconnect.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.ReqOfflineReconnect();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqOfflineReconnect message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqOfflineReconnect} ReqOfflineReconnect
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqOfflineReconnect.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqOfflineReconnect message.
* @function verify
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqOfflineReconnect.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqOfflineReconnect message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqOfflineReconnect} ReqOfflineReconnect
*/
ReqOfflineReconnect.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqOfflineReconnect)
return object;
var message = new $root.tutorial.ReqOfflineReconnect();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqOfflineReconnect message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {tutorial.ReqOfflineReconnect} message ReqOfflineReconnect
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqOfflineReconnect.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqOfflineReconnect to JSON.
* @function toJSON
* @memberof tutorial.ReqOfflineReconnect
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqOfflineReconnect.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqOfflineReconnect
* @function getTypeUrl
* @memberof tutorial.ReqOfflineReconnect
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqOfflineReconnect.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqOfflineReconnect";
};
return ReqOfflineReconnect;
})();
tutorial.ResOfflineReconnect = (function() {
/**
* Properties of a ResOfflineReconnect.
* @memberof tutorial
* @interface IResOfflineReconnect
* @property {number|null} [dwUin] ResOfflineReconnect dwUin
* @property {number|null} [Result] ResOfflineReconnect Result
*/
/**
* Constructs a new ResOfflineReconnect.
* @memberof tutorial
* @classdesc Represents a ResOfflineReconnect.
* @implements IResOfflineReconnect
* @constructor
* @param {tutorial.IResOfflineReconnect=} [properties] Properties to set
*/
function ResOfflineReconnect(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]];
}
/**
* ResOfflineReconnect dwUin.
* @member {number} dwUin
* @memberof tutorial.ResOfflineReconnect
* @instance
*/
ResOfflineReconnect.prototype.dwUin = 0;
/**
* ResOfflineReconnect Result.
* @member {number} Result
* @memberof tutorial.ResOfflineReconnect
* @instance
*/
ResOfflineReconnect.prototype.Result = 0;
/**
* Creates a new ResOfflineReconnect instance using the specified properties.
* @function create
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {tutorial.IResOfflineReconnect=} [properties] Properties to set
* @returns {tutorial.ResOfflineReconnect} ResOfflineReconnect instance
*/
ResOfflineReconnect.create = function create(properties) {
return new ResOfflineReconnect(properties);
};
/**
* Encodes the specified ResOfflineReconnect message. Does not implicitly {@link tutorial.ResOfflineReconnect.verify|verify} messages.
* @function encode
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {tutorial.IResOfflineReconnect} message ResOfflineReconnect message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResOfflineReconnect.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.Result != null && Object.hasOwnProperty.call(message, "Result"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Result);
return writer;
};
/**
* Encodes the specified ResOfflineReconnect message, length delimited. Does not implicitly {@link tutorial.ResOfflineReconnect.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {tutorial.IResOfflineReconnect} message ResOfflineReconnect message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResOfflineReconnect.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResOfflineReconnect message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResOfflineReconnect} ResOfflineReconnect
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResOfflineReconnect.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.ResOfflineReconnect();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.Result = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResOfflineReconnect message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResOfflineReconnect} ResOfflineReconnect
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResOfflineReconnect.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResOfflineReconnect message.
* @function verify
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResOfflineReconnect.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.Result != null && message.hasOwnProperty("Result"))
if (!$util.isInteger(message.Result))
return "Result: integer expected";
return null;
};
/**
* Creates a ResOfflineReconnect message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResOfflineReconnect} ResOfflineReconnect
*/
ResOfflineReconnect.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResOfflineReconnect)
return object;
var message = new $root.tutorial.ResOfflineReconnect();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.Result != null)
message.Result = object.Result | 0;
return message;
};
/**
* Creates a plain object from a ResOfflineReconnect message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {tutorial.ResOfflineReconnect} message ResOfflineReconnect
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResOfflineReconnect.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.Result = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.Result != null && message.hasOwnProperty("Result"))
object.Result = message.Result;
return object;
};
/**
* Converts this ResOfflineReconnect to JSON.
* @function toJSON
* @memberof tutorial.ResOfflineReconnect
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResOfflineReconnect.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResOfflineReconnect
* @function getTypeUrl
* @memberof tutorial.ResOfflineReconnect
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResOfflineReconnect.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResOfflineReconnect";
};
return ResOfflineReconnect;
})();
tutorial.ReqBindFacebookAccount = (function() {
/**
* Properties of a ReqBindFacebookAccount.
* @memberof tutorial
* @interface IReqBindFacebookAccount
* @property {number|null} [dwUin] ReqBindFacebookAccount dwUin
* @property {string|null} [BindAccountId] ReqBindFacebookAccount BindAccountId
*/
/**
* Constructs a new ReqBindFacebookAccount.
* @memberof tutorial
* @classdesc Represents a ReqBindFacebookAccount.
* @implements IReqBindFacebookAccount
* @constructor
* @param {tutorial.IReqBindFacebookAccount=} [properties] Properties to set
*/
function ReqBindFacebookAccount(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]];
}
/**
* ReqBindFacebookAccount dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqBindFacebookAccount
* @instance
*/
ReqBindFacebookAccount.prototype.dwUin = 0;
/**
* ReqBindFacebookAccount BindAccountId.
* @member {string} BindAccountId
* @memberof tutorial.ReqBindFacebookAccount
* @instance
*/
ReqBindFacebookAccount.prototype.BindAccountId = "";
/**
* Creates a new ReqBindFacebookAccount instance using the specified properties.
* @function create
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {tutorial.IReqBindFacebookAccount=} [properties] Properties to set
* @returns {tutorial.ReqBindFacebookAccount} ReqBindFacebookAccount instance
*/
ReqBindFacebookAccount.create = function create(properties) {
return new ReqBindFacebookAccount(properties);
};
/**
* Encodes the specified ReqBindFacebookAccount message. Does not implicitly {@link tutorial.ReqBindFacebookAccount.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {tutorial.IReqBindFacebookAccount} message ReqBindFacebookAccount message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBindFacebookAccount.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.BindAccountId != null && Object.hasOwnProperty.call(message, "BindAccountId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.BindAccountId);
return writer;
};
/**
* Encodes the specified ReqBindFacebookAccount message, length delimited. Does not implicitly {@link tutorial.ReqBindFacebookAccount.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {tutorial.IReqBindFacebookAccount} message ReqBindFacebookAccount message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBindFacebookAccount.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqBindFacebookAccount message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqBindFacebookAccount} ReqBindFacebookAccount
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBindFacebookAccount.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.ReqBindFacebookAccount();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.BindAccountId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqBindFacebookAccount message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqBindFacebookAccount} ReqBindFacebookAccount
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBindFacebookAccount.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqBindFacebookAccount message.
* @function verify
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqBindFacebookAccount.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
if (!$util.isString(message.BindAccountId))
return "BindAccountId: string expected";
return null;
};
/**
* Creates a ReqBindFacebookAccount message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqBindFacebookAccount} ReqBindFacebookAccount
*/
ReqBindFacebookAccount.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqBindFacebookAccount)
return object;
var message = new $root.tutorial.ReqBindFacebookAccount();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.BindAccountId != null)
message.BindAccountId = String(object.BindAccountId);
return message;
};
/**
* Creates a plain object from a ReqBindFacebookAccount message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {tutorial.ReqBindFacebookAccount} message ReqBindFacebookAccount
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqBindFacebookAccount.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.BindAccountId = "";
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
object.BindAccountId = message.BindAccountId;
return object;
};
/**
* Converts this ReqBindFacebookAccount to JSON.
* @function toJSON
* @memberof tutorial.ReqBindFacebookAccount
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqBindFacebookAccount.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqBindFacebookAccount
* @function getTypeUrl
* @memberof tutorial.ReqBindFacebookAccount
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqBindFacebookAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqBindFacebookAccount";
};
return ReqBindFacebookAccount;
})();
tutorial.ResBindFacebookAccount = (function() {
/**
* Properties of a ResBindFacebookAccount.
* @memberof tutorial
* @interface IResBindFacebookAccount
* @property {number|null} [dwUin] ResBindFacebookAccount dwUin
* @property {string|null} [BindAccountId] ResBindFacebookAccount BindAccountId
* @property {number|null} [ResultCode] ResBindFacebookAccount ResultCode
*/
/**
* Constructs a new ResBindFacebookAccount.
* @memberof tutorial
* @classdesc Represents a ResBindFacebookAccount.
* @implements IResBindFacebookAccount
* @constructor
* @param {tutorial.IResBindFacebookAccount=} [properties] Properties to set
*/
function ResBindFacebookAccount(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]];
}
/**
* ResBindFacebookAccount dwUin.
* @member {number} dwUin
* @memberof tutorial.ResBindFacebookAccount
* @instance
*/
ResBindFacebookAccount.prototype.dwUin = 0;
/**
* ResBindFacebookAccount BindAccountId.
* @member {string} BindAccountId
* @memberof tutorial.ResBindFacebookAccount
* @instance
*/
ResBindFacebookAccount.prototype.BindAccountId = "";
/**
* ResBindFacebookAccount ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResBindFacebookAccount
* @instance
*/
ResBindFacebookAccount.prototype.ResultCode = 0;
/**
* Creates a new ResBindFacebookAccount instance using the specified properties.
* @function create
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {tutorial.IResBindFacebookAccount=} [properties] Properties to set
* @returns {tutorial.ResBindFacebookAccount} ResBindFacebookAccount instance
*/
ResBindFacebookAccount.create = function create(properties) {
return new ResBindFacebookAccount(properties);
};
/**
* Encodes the specified ResBindFacebookAccount message. Does not implicitly {@link tutorial.ResBindFacebookAccount.verify|verify} messages.
* @function encode
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {tutorial.IResBindFacebookAccount} message ResBindFacebookAccount message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBindFacebookAccount.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.BindAccountId != null && Object.hasOwnProperty.call(message, "BindAccountId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.BindAccountId);
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ResultCode);
return writer;
};
/**
* Encodes the specified ResBindFacebookAccount message, length delimited. Does not implicitly {@link tutorial.ResBindFacebookAccount.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {tutorial.IResBindFacebookAccount} message ResBindFacebookAccount message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBindFacebookAccount.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResBindFacebookAccount message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResBindFacebookAccount} ResBindFacebookAccount
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBindFacebookAccount.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.ResBindFacebookAccount();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.BindAccountId = reader.string();
break;
}
case 3: {
message.ResultCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResBindFacebookAccount message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResBindFacebookAccount} ResBindFacebookAccount
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBindFacebookAccount.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResBindFacebookAccount message.
* @function verify
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResBindFacebookAccount.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
if (!$util.isString(message.BindAccountId))
return "BindAccountId: string expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
return null;
};
/**
* Creates a ResBindFacebookAccount message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResBindFacebookAccount} ResBindFacebookAccount
*/
ResBindFacebookAccount.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResBindFacebookAccount)
return object;
var message = new $root.tutorial.ResBindFacebookAccount();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.BindAccountId != null)
message.BindAccountId = String(object.BindAccountId);
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
return message;
};
/**
* Creates a plain object from a ResBindFacebookAccount message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {tutorial.ResBindFacebookAccount} message ResBindFacebookAccount
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResBindFacebookAccount.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.BindAccountId = "";
object.ResultCode = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
object.BindAccountId = message.BindAccountId;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
return object;
};
/**
* Converts this ResBindFacebookAccount to JSON.
* @function toJSON
* @memberof tutorial.ResBindFacebookAccount
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResBindFacebookAccount.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResBindFacebookAccount
* @function getTypeUrl
* @memberof tutorial.ResBindFacebookAccount
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResBindFacebookAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResBindFacebookAccount";
};
return ResBindFacebookAccount;
})();
tutorial.ReqOnlyBindFacebook = (function() {
/**
* Properties of a ReqOnlyBindFacebook.
* @memberof tutorial
* @interface IReqOnlyBindFacebook
* @property {number|null} [dwUin] ReqOnlyBindFacebook dwUin
* @property {string|null} [BindAccountId] ReqOnlyBindFacebook BindAccountId
*/
/**
* Constructs a new ReqOnlyBindFacebook.
* @memberof tutorial
* @classdesc 请求强制绑定已绑过其他设备的fb并且不同步数据
* @implements IReqOnlyBindFacebook
* @constructor
* @param {tutorial.IReqOnlyBindFacebook=} [properties] Properties to set
*/
function ReqOnlyBindFacebook(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]];
}
/**
* ReqOnlyBindFacebook dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqOnlyBindFacebook
* @instance
*/
ReqOnlyBindFacebook.prototype.dwUin = 0;
/**
* ReqOnlyBindFacebook BindAccountId.
* @member {string} BindAccountId
* @memberof tutorial.ReqOnlyBindFacebook
* @instance
*/
ReqOnlyBindFacebook.prototype.BindAccountId = "";
/**
* Creates a new ReqOnlyBindFacebook instance using the specified properties.
* @function create
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {tutorial.IReqOnlyBindFacebook=} [properties] Properties to set
* @returns {tutorial.ReqOnlyBindFacebook} ReqOnlyBindFacebook instance
*/
ReqOnlyBindFacebook.create = function create(properties) {
return new ReqOnlyBindFacebook(properties);
};
/**
* Encodes the specified ReqOnlyBindFacebook message. Does not implicitly {@link tutorial.ReqOnlyBindFacebook.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {tutorial.IReqOnlyBindFacebook} message ReqOnlyBindFacebook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqOnlyBindFacebook.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.BindAccountId != null && Object.hasOwnProperty.call(message, "BindAccountId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.BindAccountId);
return writer;
};
/**
* Encodes the specified ReqOnlyBindFacebook message, length delimited. Does not implicitly {@link tutorial.ReqOnlyBindFacebook.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {tutorial.IReqOnlyBindFacebook} message ReqOnlyBindFacebook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqOnlyBindFacebook.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqOnlyBindFacebook message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqOnlyBindFacebook} ReqOnlyBindFacebook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqOnlyBindFacebook.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.ReqOnlyBindFacebook();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.BindAccountId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqOnlyBindFacebook message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqOnlyBindFacebook} ReqOnlyBindFacebook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqOnlyBindFacebook.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqOnlyBindFacebook message.
* @function verify
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqOnlyBindFacebook.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
if (!$util.isString(message.BindAccountId))
return "BindAccountId: string expected";
return null;
};
/**
* Creates a ReqOnlyBindFacebook message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqOnlyBindFacebook} ReqOnlyBindFacebook
*/
ReqOnlyBindFacebook.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqOnlyBindFacebook)
return object;
var message = new $root.tutorial.ReqOnlyBindFacebook();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.BindAccountId != null)
message.BindAccountId = String(object.BindAccountId);
return message;
};
/**
* Creates a plain object from a ReqOnlyBindFacebook message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {tutorial.ReqOnlyBindFacebook} message ReqOnlyBindFacebook
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqOnlyBindFacebook.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.BindAccountId = "";
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
object.BindAccountId = message.BindAccountId;
return object;
};
/**
* Converts this ReqOnlyBindFacebook to JSON.
* @function toJSON
* @memberof tutorial.ReqOnlyBindFacebook
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqOnlyBindFacebook.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqOnlyBindFacebook
* @function getTypeUrl
* @memberof tutorial.ReqOnlyBindFacebook
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqOnlyBindFacebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqOnlyBindFacebook";
};
return ReqOnlyBindFacebook;
})();
tutorial.ResOnlyBindFacebook = (function() {
/**
* Properties of a ResOnlyBindFacebook.
* @memberof tutorial
* @interface IResOnlyBindFacebook
* @property {number|null} [dwUin] ResOnlyBindFacebook dwUin
* @property {string|null} [BindAccountId] ResOnlyBindFacebook BindAccountId
* @property {number|null} [ResultCode] ResOnlyBindFacebook ResultCode
*/
/**
* Constructs a new ResOnlyBindFacebook.
* @memberof tutorial
* @classdesc Represents a ResOnlyBindFacebook.
* @implements IResOnlyBindFacebook
* @constructor
* @param {tutorial.IResOnlyBindFacebook=} [properties] Properties to set
*/
function ResOnlyBindFacebook(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]];
}
/**
* ResOnlyBindFacebook dwUin.
* @member {number} dwUin
* @memberof tutorial.ResOnlyBindFacebook
* @instance
*/
ResOnlyBindFacebook.prototype.dwUin = 0;
/**
* ResOnlyBindFacebook BindAccountId.
* @member {string} BindAccountId
* @memberof tutorial.ResOnlyBindFacebook
* @instance
*/
ResOnlyBindFacebook.prototype.BindAccountId = "";
/**
* ResOnlyBindFacebook ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResOnlyBindFacebook
* @instance
*/
ResOnlyBindFacebook.prototype.ResultCode = 0;
/**
* Creates a new ResOnlyBindFacebook instance using the specified properties.
* @function create
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {tutorial.IResOnlyBindFacebook=} [properties] Properties to set
* @returns {tutorial.ResOnlyBindFacebook} ResOnlyBindFacebook instance
*/
ResOnlyBindFacebook.create = function create(properties) {
return new ResOnlyBindFacebook(properties);
};
/**
* Encodes the specified ResOnlyBindFacebook message. Does not implicitly {@link tutorial.ResOnlyBindFacebook.verify|verify} messages.
* @function encode
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {tutorial.IResOnlyBindFacebook} message ResOnlyBindFacebook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResOnlyBindFacebook.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.BindAccountId != null && Object.hasOwnProperty.call(message, "BindAccountId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.BindAccountId);
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ResultCode);
return writer;
};
/**
* Encodes the specified ResOnlyBindFacebook message, length delimited. Does not implicitly {@link tutorial.ResOnlyBindFacebook.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {tutorial.IResOnlyBindFacebook} message ResOnlyBindFacebook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResOnlyBindFacebook.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResOnlyBindFacebook message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResOnlyBindFacebook} ResOnlyBindFacebook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResOnlyBindFacebook.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.ResOnlyBindFacebook();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.BindAccountId = reader.string();
break;
}
case 3: {
message.ResultCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResOnlyBindFacebook message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResOnlyBindFacebook} ResOnlyBindFacebook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResOnlyBindFacebook.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResOnlyBindFacebook message.
* @function verify
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResOnlyBindFacebook.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
if (!$util.isString(message.BindAccountId))
return "BindAccountId: string expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
return null;
};
/**
* Creates a ResOnlyBindFacebook message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResOnlyBindFacebook} ResOnlyBindFacebook
*/
ResOnlyBindFacebook.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResOnlyBindFacebook)
return object;
var message = new $root.tutorial.ResOnlyBindFacebook();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.BindAccountId != null)
message.BindAccountId = String(object.BindAccountId);
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
return message;
};
/**
* Creates a plain object from a ResOnlyBindFacebook message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {tutorial.ResOnlyBindFacebook} message ResOnlyBindFacebook
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResOnlyBindFacebook.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.BindAccountId = "";
object.ResultCode = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
object.BindAccountId = message.BindAccountId;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
return object;
};
/**
* Converts this ResOnlyBindFacebook to JSON.
* @function toJSON
* @memberof tutorial.ResOnlyBindFacebook
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResOnlyBindFacebook.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResOnlyBindFacebook
* @function getTypeUrl
* @memberof tutorial.ResOnlyBindFacebook
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResOnlyBindFacebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResOnlyBindFacebook";
};
return ResOnlyBindFacebook;
})();
tutorial.ReqUnBindFacebook = (function() {
/**
* Properties of a ReqUnBindFacebook.
* @memberof tutorial
* @interface IReqUnBindFacebook
* @property {number|null} [dwUin] ReqUnBindFacebook dwUin
* @property {string|null} [BindAccountId] ReqUnBindFacebook BindAccountId
*/
/**
* Constructs a new ReqUnBindFacebook.
* @memberof tutorial
* @classdesc 请求接触绑定
* @implements IReqUnBindFacebook
* @constructor
* @param {tutorial.IReqUnBindFacebook=} [properties] Properties to set
*/
function ReqUnBindFacebook(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]];
}
/**
* ReqUnBindFacebook dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqUnBindFacebook
* @instance
*/
ReqUnBindFacebook.prototype.dwUin = 0;
/**
* ReqUnBindFacebook BindAccountId.
* @member {string} BindAccountId
* @memberof tutorial.ReqUnBindFacebook
* @instance
*/
ReqUnBindFacebook.prototype.BindAccountId = "";
/**
* Creates a new ReqUnBindFacebook instance using the specified properties.
* @function create
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {tutorial.IReqUnBindFacebook=} [properties] Properties to set
* @returns {tutorial.ReqUnBindFacebook} ReqUnBindFacebook instance
*/
ReqUnBindFacebook.create = function create(properties) {
return new ReqUnBindFacebook(properties);
};
/**
* Encodes the specified ReqUnBindFacebook message. Does not implicitly {@link tutorial.ReqUnBindFacebook.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {tutorial.IReqUnBindFacebook} message ReqUnBindFacebook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqUnBindFacebook.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.BindAccountId != null && Object.hasOwnProperty.call(message, "BindAccountId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.BindAccountId);
return writer;
};
/**
* Encodes the specified ReqUnBindFacebook message, length delimited. Does not implicitly {@link tutorial.ReqUnBindFacebook.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {tutorial.IReqUnBindFacebook} message ReqUnBindFacebook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqUnBindFacebook.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqUnBindFacebook message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqUnBindFacebook} ReqUnBindFacebook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqUnBindFacebook.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.ReqUnBindFacebook();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.BindAccountId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqUnBindFacebook message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqUnBindFacebook} ReqUnBindFacebook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqUnBindFacebook.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqUnBindFacebook message.
* @function verify
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqUnBindFacebook.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
if (!$util.isString(message.BindAccountId))
return "BindAccountId: string expected";
return null;
};
/**
* Creates a ReqUnBindFacebook message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqUnBindFacebook} ReqUnBindFacebook
*/
ReqUnBindFacebook.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqUnBindFacebook)
return object;
var message = new $root.tutorial.ReqUnBindFacebook();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.BindAccountId != null)
message.BindAccountId = String(object.BindAccountId);
return message;
};
/**
* Creates a plain object from a ReqUnBindFacebook message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {tutorial.ReqUnBindFacebook} message ReqUnBindFacebook
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqUnBindFacebook.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.BindAccountId = "";
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
object.BindAccountId = message.BindAccountId;
return object;
};
/**
* Converts this ReqUnBindFacebook to JSON.
* @function toJSON
* @memberof tutorial.ReqUnBindFacebook
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqUnBindFacebook.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqUnBindFacebook
* @function getTypeUrl
* @memberof tutorial.ReqUnBindFacebook
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqUnBindFacebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqUnBindFacebook";
};
return ReqUnBindFacebook;
})();
tutorial.ResUnBindFacebook = (function() {
/**
* Properties of a ResUnBindFacebook.
* @memberof tutorial
* @interface IResUnBindFacebook
* @property {number|null} [ResultCode] ResUnBindFacebook ResultCode
* @property {string|null} [BindAccountId] ResUnBindFacebook BindAccountId
*/
/**
* Constructs a new ResUnBindFacebook.
* @memberof tutorial
* @classdesc Represents a ResUnBindFacebook.
* @implements IResUnBindFacebook
* @constructor
* @param {tutorial.IResUnBindFacebook=} [properties] Properties to set
*/
function ResUnBindFacebook(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]];
}
/**
* ResUnBindFacebook ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResUnBindFacebook
* @instance
*/
ResUnBindFacebook.prototype.ResultCode = 0;
/**
* ResUnBindFacebook BindAccountId.
* @member {string} BindAccountId
* @memberof tutorial.ResUnBindFacebook
* @instance
*/
ResUnBindFacebook.prototype.BindAccountId = "";
/**
* Creates a new ResUnBindFacebook instance using the specified properties.
* @function create
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {tutorial.IResUnBindFacebook=} [properties] Properties to set
* @returns {tutorial.ResUnBindFacebook} ResUnBindFacebook instance
*/
ResUnBindFacebook.create = function create(properties) {
return new ResUnBindFacebook(properties);
};
/**
* Encodes the specified ResUnBindFacebook message. Does not implicitly {@link tutorial.ResUnBindFacebook.verify|verify} messages.
* @function encode
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {tutorial.IResUnBindFacebook} message ResUnBindFacebook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResUnBindFacebook.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
if (message.BindAccountId != null && Object.hasOwnProperty.call(message, "BindAccountId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.BindAccountId);
return writer;
};
/**
* Encodes the specified ResUnBindFacebook message, length delimited. Does not implicitly {@link tutorial.ResUnBindFacebook.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {tutorial.IResUnBindFacebook} message ResUnBindFacebook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResUnBindFacebook.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResUnBindFacebook message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResUnBindFacebook} ResUnBindFacebook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResUnBindFacebook.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.ResUnBindFacebook();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
case 2: {
message.BindAccountId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResUnBindFacebook message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResUnBindFacebook} ResUnBindFacebook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResUnBindFacebook.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResUnBindFacebook message.
* @function verify
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResUnBindFacebook.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
if (!$util.isString(message.BindAccountId))
return "BindAccountId: string expected";
return null;
};
/**
* Creates a ResUnBindFacebook message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResUnBindFacebook} ResUnBindFacebook
*/
ResUnBindFacebook.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResUnBindFacebook)
return object;
var message = new $root.tutorial.ResUnBindFacebook();
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
if (object.BindAccountId != null)
message.BindAccountId = String(object.BindAccountId);
return message;
};
/**
* Creates a plain object from a ResUnBindFacebook message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {tutorial.ResUnBindFacebook} message ResUnBindFacebook
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResUnBindFacebook.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.ResultCode = 0;
object.BindAccountId = "";
}
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
if (message.BindAccountId != null && message.hasOwnProperty("BindAccountId"))
object.BindAccountId = message.BindAccountId;
return object;
};
/**
* Converts this ResUnBindFacebook to JSON.
* @function toJSON
* @memberof tutorial.ResUnBindFacebook
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResUnBindFacebook.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResUnBindFacebook
* @function getTypeUrl
* @memberof tutorial.ResUnBindFacebook
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResUnBindFacebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResUnBindFacebook";
};
return ResUnBindFacebook;
})();
tutorial.ReqSynGameData = (function() {
/**
* Properties of a ReqSynGameData.
* @memberof tutorial
* @interface IReqSynGameData
* @property {number|null} [dwUin] ReqSynGameData dwUin
* @property {string|null} [NewFBId] ReqSynGameData NewFBId
*/
/**
* Constructs a new ReqSynGameData.
* @memberof tutorial
* @classdesc 请求强制绑定已绑过其他设备的fb并且同步数据
* @implements IReqSynGameData
* @constructor
* @param {tutorial.IReqSynGameData=} [properties] Properties to set
*/
function ReqSynGameData(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]];
}
/**
* ReqSynGameData dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqSynGameData
* @instance
*/
ReqSynGameData.prototype.dwUin = 0;
/**
* ReqSynGameData NewFBId.
* @member {string} NewFBId
* @memberof tutorial.ReqSynGameData
* @instance
*/
ReqSynGameData.prototype.NewFBId = "";
/**
* Creates a new ReqSynGameData instance using the specified properties.
* @function create
* @memberof tutorial.ReqSynGameData
* @static
* @param {tutorial.IReqSynGameData=} [properties] Properties to set
* @returns {tutorial.ReqSynGameData} ReqSynGameData instance
*/
ReqSynGameData.create = function create(properties) {
return new ReqSynGameData(properties);
};
/**
* Encodes the specified ReqSynGameData message. Does not implicitly {@link tutorial.ReqSynGameData.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSynGameData
* @static
* @param {tutorial.IReqSynGameData} message ReqSynGameData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSynGameData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.NewFBId != null && Object.hasOwnProperty.call(message, "NewFBId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.NewFBId);
return writer;
};
/**
* Encodes the specified ReqSynGameData message, length delimited. Does not implicitly {@link tutorial.ReqSynGameData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSynGameData
* @static
* @param {tutorial.IReqSynGameData} message ReqSynGameData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSynGameData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSynGameData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSynGameData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSynGameData} ReqSynGameData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSynGameData.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.ReqSynGameData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.NewFBId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSynGameData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSynGameData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSynGameData} ReqSynGameData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSynGameData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSynGameData message.
* @function verify
* @memberof tutorial.ReqSynGameData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSynGameData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.NewFBId != null && message.hasOwnProperty("NewFBId"))
if (!$util.isString(message.NewFBId))
return "NewFBId: string expected";
return null;
};
/**
* Creates a ReqSynGameData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSynGameData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSynGameData} ReqSynGameData
*/
ReqSynGameData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSynGameData)
return object;
var message = new $root.tutorial.ReqSynGameData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.NewFBId != null)
message.NewFBId = String(object.NewFBId);
return message;
};
/**
* Creates a plain object from a ReqSynGameData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSynGameData
* @static
* @param {tutorial.ReqSynGameData} message ReqSynGameData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSynGameData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.NewFBId = "";
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.NewFBId != null && message.hasOwnProperty("NewFBId"))
object.NewFBId = message.NewFBId;
return object;
};
/**
* Converts this ReqSynGameData to JSON.
* @function toJSON
* @memberof tutorial.ReqSynGameData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSynGameData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSynGameData
* @function getTypeUrl
* @memberof tutorial.ReqSynGameData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSynGameData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSynGameData";
};
return ReqSynGameData;
})();
tutorial.ResSynGameData = (function() {
/**
* Properties of a ResSynGameData.
* @memberof tutorial
* @interface IResSynGameData
* @property {number|null} [dwUin] ResSynGameData dwUin
* @property {number|null} [ResultCode] ResSynGameData ResultCode
*/
/**
* Constructs a new ResSynGameData.
* @memberof tutorial
* @classdesc Represents a ResSynGameData.
* @implements IResSynGameData
* @constructor
* @param {tutorial.IResSynGameData=} [properties] Properties to set
*/
function ResSynGameData(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]];
}
/**
* ResSynGameData dwUin.
* @member {number} dwUin
* @memberof tutorial.ResSynGameData
* @instance
*/
ResSynGameData.prototype.dwUin = 0;
/**
* ResSynGameData ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResSynGameData
* @instance
*/
ResSynGameData.prototype.ResultCode = 0;
/**
* Creates a new ResSynGameData instance using the specified properties.
* @function create
* @memberof tutorial.ResSynGameData
* @static
* @param {tutorial.IResSynGameData=} [properties] Properties to set
* @returns {tutorial.ResSynGameData} ResSynGameData instance
*/
ResSynGameData.create = function create(properties) {
return new ResSynGameData(properties);
};
/**
* Encodes the specified ResSynGameData message. Does not implicitly {@link tutorial.ResSynGameData.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSynGameData
* @static
* @param {tutorial.IResSynGameData} message ResSynGameData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSynGameData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ResultCode);
return writer;
};
/**
* Encodes the specified ResSynGameData message, length delimited. Does not implicitly {@link tutorial.ResSynGameData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSynGameData
* @static
* @param {tutorial.IResSynGameData} message ResSynGameData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSynGameData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSynGameData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSynGameData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSynGameData} ResSynGameData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSynGameData.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.ResSynGameData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.ResultCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSynGameData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSynGameData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSynGameData} ResSynGameData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSynGameData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSynGameData message.
* @function verify
* @memberof tutorial.ResSynGameData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSynGameData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
return null;
};
/**
* Creates a ResSynGameData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSynGameData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSynGameData} ResSynGameData
*/
ResSynGameData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSynGameData)
return object;
var message = new $root.tutorial.ResSynGameData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
return message;
};
/**
* Creates a plain object from a ResSynGameData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSynGameData
* @static
* @param {tutorial.ResSynGameData} message ResSynGameData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSynGameData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.ResultCode = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
return object;
};
/**
* Converts this ResSynGameData to JSON.
* @function toJSON
* @memberof tutorial.ResSynGameData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSynGameData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSynGameData
* @function getTypeUrl
* @memberof tutorial.ResSynGameData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSynGameData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSynGameData";
};
return ResSynGameData;
})();
tutorial.ForceKickOut = (function() {
/**
* Properties of a ForceKickOut.
* @memberof tutorial
* @interface IForceKickOut
*/
/**
* Constructs a new ForceKickOut.
* @memberof tutorial
* @classdesc Represents a ForceKickOut.
* @implements IForceKickOut
* @constructor
* @param {tutorial.IForceKickOut=} [properties] Properties to set
*/
function ForceKickOut(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]];
}
/**
* Creates a new ForceKickOut instance using the specified properties.
* @function create
* @memberof tutorial.ForceKickOut
* @static
* @param {tutorial.IForceKickOut=} [properties] Properties to set
* @returns {tutorial.ForceKickOut} ForceKickOut instance
*/
ForceKickOut.create = function create(properties) {
return new ForceKickOut(properties);
};
/**
* Encodes the specified ForceKickOut message. Does not implicitly {@link tutorial.ForceKickOut.verify|verify} messages.
* @function encode
* @memberof tutorial.ForceKickOut
* @static
* @param {tutorial.IForceKickOut} message ForceKickOut message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ForceKickOut.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ForceKickOut message, length delimited. Does not implicitly {@link tutorial.ForceKickOut.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ForceKickOut
* @static
* @param {tutorial.IForceKickOut} message ForceKickOut message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ForceKickOut.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ForceKickOut message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ForceKickOut
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ForceKickOut} ForceKickOut
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ForceKickOut.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.ForceKickOut();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ForceKickOut message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ForceKickOut
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ForceKickOut} ForceKickOut
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ForceKickOut.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ForceKickOut message.
* @function verify
* @memberof tutorial.ForceKickOut
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ForceKickOut.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ForceKickOut message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ForceKickOut
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ForceKickOut} ForceKickOut
*/
ForceKickOut.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ForceKickOut)
return object;
return new $root.tutorial.ForceKickOut();
};
/**
* Creates a plain object from a ForceKickOut message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ForceKickOut
* @static
* @param {tutorial.ForceKickOut} message ForceKickOut
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ForceKickOut.toObject = function toObject() {
return {};
};
/**
* Converts this ForceKickOut to JSON.
* @function toJSON
* @memberof tutorial.ForceKickOut
* @instance
* @returns {Object.<string,*>} JSON object
*/
ForceKickOut.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ForceKickOut
* @function getTypeUrl
* @memberof tutorial.ForceKickOut
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ForceKickOut.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ForceKickOut";
};
return ForceKickOut;
})();
tutorial.ResServerVersion = (function() {
/**
* Properties of a ResServerVersion.
* @memberof tutorial
* @interface IResServerVersion
* @property {number|null} [Version] ResServerVersion Version
*/
/**
* Constructs a new ResServerVersion.
* @memberof tutorial
* @classdesc Represents a ResServerVersion.
* @implements IResServerVersion
* @constructor
* @param {tutorial.IResServerVersion=} [properties] Properties to set
*/
function ResServerVersion(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]];
}
/**
* ResServerVersion Version.
* @member {number} Version
* @memberof tutorial.ResServerVersion
* @instance
*/
ResServerVersion.prototype.Version = 0;
/**
* Creates a new ResServerVersion instance using the specified properties.
* @function create
* @memberof tutorial.ResServerVersion
* @static
* @param {tutorial.IResServerVersion=} [properties] Properties to set
* @returns {tutorial.ResServerVersion} ResServerVersion instance
*/
ResServerVersion.create = function create(properties) {
return new ResServerVersion(properties);
};
/**
* Encodes the specified ResServerVersion message. Does not implicitly {@link tutorial.ResServerVersion.verify|verify} messages.
* @function encode
* @memberof tutorial.ResServerVersion
* @static
* @param {tutorial.IResServerVersion} message ResServerVersion message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResServerVersion.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Version != null && Object.hasOwnProperty.call(message, "Version"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Version);
return writer;
};
/**
* Encodes the specified ResServerVersion message, length delimited. Does not implicitly {@link tutorial.ResServerVersion.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResServerVersion
* @static
* @param {tutorial.IResServerVersion} message ResServerVersion message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResServerVersion.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResServerVersion message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResServerVersion
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResServerVersion} ResServerVersion
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResServerVersion.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.ResServerVersion();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Version = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResServerVersion message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResServerVersion
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResServerVersion} ResServerVersion
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResServerVersion.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResServerVersion message.
* @function verify
* @memberof tutorial.ResServerVersion
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResServerVersion.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Version != null && message.hasOwnProperty("Version"))
if (!$util.isInteger(message.Version))
return "Version: integer expected";
return null;
};
/**
* Creates a ResServerVersion message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResServerVersion
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResServerVersion} ResServerVersion
*/
ResServerVersion.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResServerVersion)
return object;
var message = new $root.tutorial.ResServerVersion();
if (object.Version != null)
message.Version = object.Version | 0;
return message;
};
/**
* Creates a plain object from a ResServerVersion message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResServerVersion
* @static
* @param {tutorial.ResServerVersion} message ResServerVersion
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResServerVersion.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Version = 0;
if (message.Version != null && message.hasOwnProperty("Version"))
object.Version = message.Version;
return object;
};
/**
* Converts this ResServerVersion to JSON.
* @function toJSON
* @memberof tutorial.ResServerVersion
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResServerVersion.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResServerVersion
* @function getTypeUrl
* @memberof tutorial.ResServerVersion
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResServerVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResServerVersion";
};
return ResServerVersion;
})();
tutorial.ResChessColorData = (function() {
/**
* Properties of a ResChessColorData.
* @memberof tutorial
* @interface IResChessColorData
* @property {Object.<string,number>|null} [mChessColorData] ResChessColorData mChessColorData
*/
/**
* Constructs a new ResChessColorData.
* @memberof tutorial
* @classdesc Represents a ResChessColorData.
* @implements IResChessColorData
* @constructor
* @param {tutorial.IResChessColorData=} [properties] Properties to set
*/
function ResChessColorData(properties) {
this.mChessColorData = {};
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]];
}
/**
* ResChessColorData mChessColorData.
* @member {Object.<string,number>} mChessColorData
* @memberof tutorial.ResChessColorData
* @instance
*/
ResChessColorData.prototype.mChessColorData = $util.emptyObject;
/**
* Creates a new ResChessColorData instance using the specified properties.
* @function create
* @memberof tutorial.ResChessColorData
* @static
* @param {tutorial.IResChessColorData=} [properties] Properties to set
* @returns {tutorial.ResChessColorData} ResChessColorData instance
*/
ResChessColorData.create = function create(properties) {
return new ResChessColorData(properties);
};
/**
* Encodes the specified ResChessColorData message. Does not implicitly {@link tutorial.ResChessColorData.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChessColorData
* @static
* @param {tutorial.IResChessColorData} message ResChessColorData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChessColorData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.mChessColorData != null && Object.hasOwnProperty.call(message, "mChessColorData"))
for (var keys = Object.keys(message.mChessColorData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessColorData[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ResChessColorData message, length delimited. Does not implicitly {@link tutorial.ResChessColorData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChessColorData
* @static
* @param {tutorial.IResChessColorData} message ResChessColorData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChessColorData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChessColorData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChessColorData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChessColorData} ResChessColorData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChessColorData.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.ResChessColorData(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.mChessColorData === $util.emptyObject)
message.mChessColorData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessColorData[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChessColorData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChessColorData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChessColorData} ResChessColorData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChessColorData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChessColorData message.
* @function verify
* @memberof tutorial.ResChessColorData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChessColorData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.mChessColorData != null && message.hasOwnProperty("mChessColorData")) {
if (!$util.isObject(message.mChessColorData))
return "mChessColorData: object expected";
var key = Object.keys(message.mChessColorData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessColorData[key[i]]))
return "mChessColorData: integer{k:string} expected";
}
return null;
};
/**
* Creates a ResChessColorData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChessColorData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChessColorData} ResChessColorData
*/
ResChessColorData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChessColorData)
return object;
var message = new $root.tutorial.ResChessColorData();
if (object.mChessColorData) {
if (typeof object.mChessColorData !== "object")
throw TypeError(".tutorial.ResChessColorData.mChessColorData: object expected");
message.mChessColorData = {};
for (var keys = Object.keys(object.mChessColorData), i = 0; i < keys.length; ++i)
message.mChessColorData[keys[i]] = object.mChessColorData[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ResChessColorData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChessColorData
* @static
* @param {tutorial.ResChessColorData} message ResChessColorData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChessColorData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mChessColorData = {};
var keys2;
if (message.mChessColorData && (keys2 = Object.keys(message.mChessColorData)).length) {
object.mChessColorData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessColorData[keys2[j]] = message.mChessColorData[keys2[j]];
}
return object;
};
/**
* Converts this ResChessColorData to JSON.
* @function toJSON
* @memberof tutorial.ResChessColorData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChessColorData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChessColorData
* @function getTypeUrl
* @memberof tutorial.ResChessColorData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChessColorData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChessColorData";
};
return ResChessColorData;
})();
tutorial.ClientRes = (function() {
/**
* Properties of a ClientRes.
* @memberof tutorial
* @interface IClientRes
* @property {string|null} [func] ClientRes func
* @property {string|null} [cid] ClientRes cid
* @property {Uint8Array|null} [info] ClientRes info
*/
/**
* Constructs a new ClientRes.
* @memberof tutorial
* @classdesc Represents a ClientRes.
* @implements IClientRes
* @constructor
* @param {tutorial.IClientRes=} [properties] Properties to set
*/
function ClientRes(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]];
}
/**
* ClientRes func.
* @member {string} func
* @memberof tutorial.ClientRes
* @instance
*/
ClientRes.prototype.func = "";
/**
* ClientRes cid.
* @member {string} cid
* @memberof tutorial.ClientRes
* @instance
*/
ClientRes.prototype.cid = "";
/**
* ClientRes info.
* @member {Uint8Array} info
* @memberof tutorial.ClientRes
* @instance
*/
ClientRes.prototype.info = $util.newBuffer([]);
/**
* Creates a new ClientRes instance using the specified properties.
* @function create
* @memberof tutorial.ClientRes
* @static
* @param {tutorial.IClientRes=} [properties] Properties to set
* @returns {tutorial.ClientRes} ClientRes instance
*/
ClientRes.create = function create(properties) {
return new ClientRes(properties);
};
/**
* Encodes the specified ClientRes message. Does not implicitly {@link tutorial.ClientRes.verify|verify} messages.
* @function encode
* @memberof tutorial.ClientRes
* @static
* @param {tutorial.IClientRes} message ClientRes message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ClientRes.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.func != null && Object.hasOwnProperty.call(message, "func"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.func);
if (message.cid != null && Object.hasOwnProperty.call(message, "cid"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.cid);
if (message.info != null && Object.hasOwnProperty.call(message, "info"))
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.info);
return writer;
};
/**
* Encodes the specified ClientRes message, length delimited. Does not implicitly {@link tutorial.ClientRes.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ClientRes
* @static
* @param {tutorial.IClientRes} message ClientRes message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ClientRes.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ClientRes message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ClientRes
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ClientRes} ClientRes
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ClientRes.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.ClientRes();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.func = reader.string();
break;
}
case 2: {
message.cid = reader.string();
break;
}
case 3: {
message.info = reader.bytes();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ClientRes message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ClientRes
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ClientRes} ClientRes
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ClientRes.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ClientRes message.
* @function verify
* @memberof tutorial.ClientRes
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ClientRes.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.func != null && message.hasOwnProperty("func"))
if (!$util.isString(message.func))
return "func: string expected";
if (message.cid != null && message.hasOwnProperty("cid"))
if (!$util.isString(message.cid))
return "cid: string expected";
if (message.info != null && message.hasOwnProperty("info"))
if (!(message.info && typeof message.info.length === "number" || $util.isString(message.info)))
return "info: buffer expected";
return null;
};
/**
* Creates a ClientRes message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ClientRes
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ClientRes} ClientRes
*/
ClientRes.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ClientRes)
return object;
var message = new $root.tutorial.ClientRes();
if (object.func != null)
message.func = String(object.func);
if (object.cid != null)
message.cid = String(object.cid);
if (object.info != null)
if (typeof object.info === "string")
$util.base64.decode(object.info, message.info = $util.newBuffer($util.base64.length(object.info)), 0);
else if (object.info.length >= 0)
message.info = object.info;
return message;
};
/**
* Creates a plain object from a ClientRes message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ClientRes
* @static
* @param {tutorial.ClientRes} message ClientRes
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ClientRes.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.func = "";
object.cid = "";
if (options.bytes === String)
object.info = "";
else {
object.info = [];
if (options.bytes !== Array)
object.info = $util.newBuffer(object.info);
}
}
if (message.func != null && message.hasOwnProperty("func"))
object.func = message.func;
if (message.cid != null && message.hasOwnProperty("cid"))
object.cid = message.cid;
if (message.info != null && message.hasOwnProperty("info"))
object.info = options.bytes === String ? $util.base64.encode(message.info, 0, message.info.length) : options.bytes === Array ? Array.prototype.slice.call(message.info) : message.info;
return object;
};
/**
* Converts this ClientRes to JSON.
* @function toJSON
* @memberof tutorial.ClientRes
* @instance
* @returns {Object.<string,*>} JSON object
*/
ClientRes.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ClientRes
* @function getTypeUrl
* @memberof tutorial.ClientRes
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ClientRes.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ClientRes";
};
return ClientRes;
})();
tutorial.ReqRegisterAccount = (function() {
/**
* Properties of a ReqRegisterAccount.
* @memberof tutorial
* @interface IReqRegisterAccount
* @property {string|null} [UserName] ReqRegisterAccount UserName
* @property {string|null} [UserPwd] ReqRegisterAccount UserPwd
* @property {number|null} [dwUin] ReqRegisterAccount dwUin
*/
/**
* Constructs a new ReqRegisterAccount.
* @memberof tutorial
* @classdesc 请求注册账号
* @implements IReqRegisterAccount
* @constructor
* @param {tutorial.IReqRegisterAccount=} [properties] Properties to set
*/
function ReqRegisterAccount(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]];
}
/**
* ReqRegisterAccount UserName.
* @member {string} UserName
* @memberof tutorial.ReqRegisterAccount
* @instance
*/
ReqRegisterAccount.prototype.UserName = "";
/**
* ReqRegisterAccount UserPwd.
* @member {string} UserPwd
* @memberof tutorial.ReqRegisterAccount
* @instance
*/
ReqRegisterAccount.prototype.UserPwd = "";
/**
* ReqRegisterAccount dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqRegisterAccount
* @instance
*/
ReqRegisterAccount.prototype.dwUin = 0;
/**
* Creates a new ReqRegisterAccount instance using the specified properties.
* @function create
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {tutorial.IReqRegisterAccount=} [properties] Properties to set
* @returns {tutorial.ReqRegisterAccount} ReqRegisterAccount instance
*/
ReqRegisterAccount.create = function create(properties) {
return new ReqRegisterAccount(properties);
};
/**
* Encodes the specified ReqRegisterAccount message. Does not implicitly {@link tutorial.ReqRegisterAccount.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {tutorial.IReqRegisterAccount} message ReqRegisterAccount message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRegisterAccount.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.UserName != null && Object.hasOwnProperty.call(message, "UserName"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.UserName);
if (message.UserPwd != null && Object.hasOwnProperty.call(message, "UserPwd"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.UserPwd);
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqRegisterAccount message, length delimited. Does not implicitly {@link tutorial.ReqRegisterAccount.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {tutorial.IReqRegisterAccount} message ReqRegisterAccount message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRegisterAccount.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRegisterAccount message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRegisterAccount} ReqRegisterAccount
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRegisterAccount.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.ReqRegisterAccount();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.UserName = reader.string();
break;
}
case 2: {
message.UserPwd = reader.string();
break;
}
case 3: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRegisterAccount message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRegisterAccount} ReqRegisterAccount
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRegisterAccount.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRegisterAccount message.
* @function verify
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRegisterAccount.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.UserName != null && message.hasOwnProperty("UserName"))
if (!$util.isString(message.UserName))
return "UserName: string expected";
if (message.UserPwd != null && message.hasOwnProperty("UserPwd"))
if (!$util.isString(message.UserPwd))
return "UserPwd: string expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqRegisterAccount message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRegisterAccount} ReqRegisterAccount
*/
ReqRegisterAccount.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRegisterAccount)
return object;
var message = new $root.tutorial.ReqRegisterAccount();
if (object.UserName != null)
message.UserName = String(object.UserName);
if (object.UserPwd != null)
message.UserPwd = String(object.UserPwd);
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqRegisterAccount message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {tutorial.ReqRegisterAccount} message ReqRegisterAccount
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRegisterAccount.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.UserName = "";
object.UserPwd = "";
object.dwUin = 0;
}
if (message.UserName != null && message.hasOwnProperty("UserName"))
object.UserName = message.UserName;
if (message.UserPwd != null && message.hasOwnProperty("UserPwd"))
object.UserPwd = message.UserPwd;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqRegisterAccount to JSON.
* @function toJSON
* @memberof tutorial.ReqRegisterAccount
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRegisterAccount.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRegisterAccount
* @function getTypeUrl
* @memberof tutorial.ReqRegisterAccount
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRegisterAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRegisterAccount";
};
return ReqRegisterAccount;
})();
tutorial.ResRegisterAccount = (function() {
/**
* Properties of a ResRegisterAccount.
* @memberof tutorial
* @interface IResRegisterAccount
* @property {number|null} [ResultCode] ResRegisterAccount ResultCode
*/
/**
* Constructs a new ResRegisterAccount.
* @memberof tutorial
* @classdesc 响应注册账号
* @implements IResRegisterAccount
* @constructor
* @param {tutorial.IResRegisterAccount=} [properties] Properties to set
*/
function ResRegisterAccount(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]];
}
/**
* ResRegisterAccount ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResRegisterAccount
* @instance
*/
ResRegisterAccount.prototype.ResultCode = 0;
/**
* Creates a new ResRegisterAccount instance using the specified properties.
* @function create
* @memberof tutorial.ResRegisterAccount
* @static
* @param {tutorial.IResRegisterAccount=} [properties] Properties to set
* @returns {tutorial.ResRegisterAccount} ResRegisterAccount instance
*/
ResRegisterAccount.create = function create(properties) {
return new ResRegisterAccount(properties);
};
/**
* Encodes the specified ResRegisterAccount message. Does not implicitly {@link tutorial.ResRegisterAccount.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRegisterAccount
* @static
* @param {tutorial.IResRegisterAccount} message ResRegisterAccount message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRegisterAccount.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
return writer;
};
/**
* Encodes the specified ResRegisterAccount message, length delimited. Does not implicitly {@link tutorial.ResRegisterAccount.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRegisterAccount
* @static
* @param {tutorial.IResRegisterAccount} message ResRegisterAccount message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRegisterAccount.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRegisterAccount message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRegisterAccount
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRegisterAccount} ResRegisterAccount
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRegisterAccount.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.ResRegisterAccount();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRegisterAccount message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRegisterAccount
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRegisterAccount} ResRegisterAccount
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRegisterAccount.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRegisterAccount message.
* @function verify
* @memberof tutorial.ResRegisterAccount
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRegisterAccount.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
return null;
};
/**
* Creates a ResRegisterAccount message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRegisterAccount
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRegisterAccount} ResRegisterAccount
*/
ResRegisterAccount.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRegisterAccount)
return object;
var message = new $root.tutorial.ResRegisterAccount();
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
return message;
};
/**
* Creates a plain object from a ResRegisterAccount message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRegisterAccount
* @static
* @param {tutorial.ResRegisterAccount} message ResRegisterAccount
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRegisterAccount.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.ResultCode = 0;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
return object;
};
/**
* Converts this ResRegisterAccount to JSON.
* @function toJSON
* @memberof tutorial.ResRegisterAccount
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRegisterAccount.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRegisterAccount
* @function getTypeUrl
* @memberof tutorial.ResRegisterAccount
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRegisterAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRegisterAccount";
};
return ResRegisterAccount;
})();
tutorial.ReqLogin = (function() {
/**
* Properties of a ReqLogin.
* @memberof tutorial
* @interface IReqLogin
* @property {string|null} [UserName] ReqLogin UserName
* @property {string|null} [UserPwd] ReqLogin UserPwd
*/
/**
* Constructs a new ReqLogin.
* @memberof tutorial
* @classdesc 请求登录
* @implements IReqLogin
* @constructor
* @param {tutorial.IReqLogin=} [properties] Properties to set
*/
function ReqLogin(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]];
}
/**
* ReqLogin UserName.
* @member {string} UserName
* @memberof tutorial.ReqLogin
* @instance
*/
ReqLogin.prototype.UserName = "";
/**
* ReqLogin UserPwd.
* @member {string} UserPwd
* @memberof tutorial.ReqLogin
* @instance
*/
ReqLogin.prototype.UserPwd = "";
/**
* Creates a new ReqLogin instance using the specified properties.
* @function create
* @memberof tutorial.ReqLogin
* @static
* @param {tutorial.IReqLogin=} [properties] Properties to set
* @returns {tutorial.ReqLogin} ReqLogin instance
*/
ReqLogin.create = function create(properties) {
return new ReqLogin(properties);
};
/**
* Encodes the specified ReqLogin message. Does not implicitly {@link tutorial.ReqLogin.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqLogin
* @static
* @param {tutorial.IReqLogin} message ReqLogin message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqLogin.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.UserName != null && Object.hasOwnProperty.call(message, "UserName"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.UserName);
if (message.UserPwd != null && Object.hasOwnProperty.call(message, "UserPwd"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.UserPwd);
return writer;
};
/**
* Encodes the specified ReqLogin message, length delimited. Does not implicitly {@link tutorial.ReqLogin.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqLogin
* @static
* @param {tutorial.IReqLogin} message ReqLogin message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqLogin.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqLogin message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqLogin
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqLogin} ReqLogin
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqLogin.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.ReqLogin();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.UserName = reader.string();
break;
}
case 2: {
message.UserPwd = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqLogin message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqLogin
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqLogin} ReqLogin
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqLogin.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqLogin message.
* @function verify
* @memberof tutorial.ReqLogin
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqLogin.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.UserName != null && message.hasOwnProperty("UserName"))
if (!$util.isString(message.UserName))
return "UserName: string expected";
if (message.UserPwd != null && message.hasOwnProperty("UserPwd"))
if (!$util.isString(message.UserPwd))
return "UserPwd: string expected";
return null;
};
/**
* Creates a ReqLogin message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqLogin
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqLogin} ReqLogin
*/
ReqLogin.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqLogin)
return object;
var message = new $root.tutorial.ReqLogin();
if (object.UserName != null)
message.UserName = String(object.UserName);
if (object.UserPwd != null)
message.UserPwd = String(object.UserPwd);
return message;
};
/**
* Creates a plain object from a ReqLogin message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqLogin
* @static
* @param {tutorial.ReqLogin} message ReqLogin
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqLogin.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.UserName = "";
object.UserPwd = "";
}
if (message.UserName != null && message.hasOwnProperty("UserName"))
object.UserName = message.UserName;
if (message.UserPwd != null && message.hasOwnProperty("UserPwd"))
object.UserPwd = message.UserPwd;
return object;
};
/**
* Converts this ReqLogin to JSON.
* @function toJSON
* @memberof tutorial.ReqLogin
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqLogin.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqLogin
* @function getTypeUrl
* @memberof tutorial.ReqLogin
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqLogin.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqLogin";
};
return ReqLogin;
})();
tutorial.ResLogin = (function() {
/**
* Properties of a ResLogin.
* @memberof tutorial
* @interface IResLogin
* @property {number|null} [ResultCode] ResLogin ResultCode
* @property {number|null} [dwUin] ResLogin dwUin
* @property {string|null} [UserName] ResLogin UserName
* @property {string|null} [FaceBookId] ResLogin FaceBookId
*/
/**
* Constructs a new ResLogin.
* @memberof tutorial
* @classdesc 响应登录
* @implements IResLogin
* @constructor
* @param {tutorial.IResLogin=} [properties] Properties to set
*/
function ResLogin(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]];
}
/**
* ResLogin ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResLogin
* @instance
*/
ResLogin.prototype.ResultCode = 0;
/**
* ResLogin dwUin.
* @member {number} dwUin
* @memberof tutorial.ResLogin
* @instance
*/
ResLogin.prototype.dwUin = 0;
/**
* ResLogin UserName.
* @member {string} UserName
* @memberof tutorial.ResLogin
* @instance
*/
ResLogin.prototype.UserName = "";
/**
* ResLogin FaceBookId.
* @member {string} FaceBookId
* @memberof tutorial.ResLogin
* @instance
*/
ResLogin.prototype.FaceBookId = "";
/**
* Creates a new ResLogin instance using the specified properties.
* @function create
* @memberof tutorial.ResLogin
* @static
* @param {tutorial.IResLogin=} [properties] Properties to set
* @returns {tutorial.ResLogin} ResLogin instance
*/
ResLogin.create = function create(properties) {
return new ResLogin(properties);
};
/**
* Encodes the specified ResLogin message. Does not implicitly {@link tutorial.ResLogin.verify|verify} messages.
* @function encode
* @memberof tutorial.ResLogin
* @static
* @param {tutorial.IResLogin} message ResLogin message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLogin.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dwUin);
if (message.UserName != null && Object.hasOwnProperty.call(message, "UserName"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.UserName);
if (message.FaceBookId != null && Object.hasOwnProperty.call(message, "FaceBookId"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.FaceBookId);
return writer;
};
/**
* Encodes the specified ResLogin message, length delimited. Does not implicitly {@link tutorial.ResLogin.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResLogin
* @static
* @param {tutorial.IResLogin} message ResLogin message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLogin.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResLogin message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResLogin
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResLogin} ResLogin
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLogin.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.ResLogin();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
case 2: {
message.dwUin = reader.int32();
break;
}
case 3: {
message.UserName = reader.string();
break;
}
case 4: {
message.FaceBookId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResLogin message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResLogin
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResLogin} ResLogin
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLogin.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResLogin message.
* @function verify
* @memberof tutorial.ResLogin
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResLogin.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.UserName != null && message.hasOwnProperty("UserName"))
if (!$util.isString(message.UserName))
return "UserName: string expected";
if (message.FaceBookId != null && message.hasOwnProperty("FaceBookId"))
if (!$util.isString(message.FaceBookId))
return "FaceBookId: string expected";
return null;
};
/**
* Creates a ResLogin message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResLogin
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResLogin} ResLogin
*/
ResLogin.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResLogin)
return object;
var message = new $root.tutorial.ResLogin();
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.UserName != null)
message.UserName = String(object.UserName);
if (object.FaceBookId != null)
message.FaceBookId = String(object.FaceBookId);
return message;
};
/**
* Creates a plain object from a ResLogin message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResLogin
* @static
* @param {tutorial.ResLogin} message ResLogin
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResLogin.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.ResultCode = 0;
object.dwUin = 0;
object.UserName = "";
object.FaceBookId = "";
}
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.UserName != null && message.hasOwnProperty("UserName"))
object.UserName = message.UserName;
if (message.FaceBookId != null && message.hasOwnProperty("FaceBookId"))
object.FaceBookId = message.FaceBookId;
return object;
};
/**
* Converts this ResLogin to JSON.
* @function toJSON
* @memberof tutorial.ResLogin
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResLogin.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResLogin
* @function getTypeUrl
* @memberof tutorial.ResLogin
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResLogin.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResLogin";
};
return ResLogin;
})();
tutorial.ReqPlayerBaseInfo = (function() {
/**
* Properties of a ReqPlayerBaseInfo.
* @memberof tutorial
* @interface IReqPlayerBaseInfo
* @property {number|null} [dwUin] ReqPlayerBaseInfo dwUin
*/
/**
* Constructs a new ReqPlayerBaseInfo.
* @memberof tutorial
* @classdesc 请求玩家基本信息(玩家登入成功后,第一条请求信息)
* @implements IReqPlayerBaseInfo
* @constructor
* @param {tutorial.IReqPlayerBaseInfo=} [properties] Properties to set
*/
function ReqPlayerBaseInfo(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]];
}
/**
* ReqPlayerBaseInfo dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqPlayerBaseInfo
* @instance
*/
ReqPlayerBaseInfo.prototype.dwUin = 0;
/**
* Creates a new ReqPlayerBaseInfo instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {tutorial.IReqPlayerBaseInfo=} [properties] Properties to set
* @returns {tutorial.ReqPlayerBaseInfo} ReqPlayerBaseInfo instance
*/
ReqPlayerBaseInfo.create = function create(properties) {
return new ReqPlayerBaseInfo(properties);
};
/**
* Encodes the specified ReqPlayerBaseInfo message. Does not implicitly {@link tutorial.ReqPlayerBaseInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {tutorial.IReqPlayerBaseInfo} message ReqPlayerBaseInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayerBaseInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqPlayerBaseInfo message, length delimited. Does not implicitly {@link tutorial.ReqPlayerBaseInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {tutorial.IReqPlayerBaseInfo} message ReqPlayerBaseInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayerBaseInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayerBaseInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayerBaseInfo} ReqPlayerBaseInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayerBaseInfo.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.ReqPlayerBaseInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayerBaseInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayerBaseInfo} ReqPlayerBaseInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayerBaseInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayerBaseInfo message.
* @function verify
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayerBaseInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqPlayerBaseInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayerBaseInfo} ReqPlayerBaseInfo
*/
ReqPlayerBaseInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayerBaseInfo)
return object;
var message = new $root.tutorial.ReqPlayerBaseInfo();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayerBaseInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {tutorial.ReqPlayerBaseInfo} message ReqPlayerBaseInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayerBaseInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqPlayerBaseInfo to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayerBaseInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayerBaseInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayerBaseInfo
* @function getTypeUrl
* @memberof tutorial.ReqPlayerBaseInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayerBaseInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayerBaseInfo";
};
return ReqPlayerBaseInfo;
})();
tutorial.ResPlayerBaseInfo = (function() {
/**
* Properties of a ResPlayerBaseInfo.
* @memberof tutorial
* @interface IResPlayerBaseInfo
* @property {number|null} [dwUin] ResPlayerBaseInfo dwUin
* @property {number|null} [energy] ResPlayerBaseInfo energy
* @property {number|null} [star] ResPlayerBaseInfo star
* @property {number|null} [recoverTime] ResPlayerBaseInfo recoverTime
* @property {number|null} [diamond] ResPlayerBaseInfo diamond
* @property {number|null} [level] ResPlayerBaseInfo level
* @property {number|null} [exp] ResPlayerBaseInfo exp
* @property {string|null} [startOrderId] ResPlayerBaseInfo startOrderId
* @property {number|null} [musicCode] ResPlayerBaseInfo musicCode
* @property {number|null} [guild] ResPlayerBaseInfo guild
* @property {number|null} [packUnlockCount] ResPlayerBaseInfo packUnlockCount
* @property {number|null} [lastPlayTime] ResPlayerBaseInfo lastPlayTime
* @property {number|null} [EnergyBuyCount] ResPlayerBaseInfo EnergyBuyCount
* @property {string|null} [userName] ResPlayerBaseInfo userName
* @property {number|null} [loginTime] ResPlayerBaseInfo loginTime
* @property {number|null} [logoutTime] ResPlayerBaseInfo logoutTime
* @property {number|null} [todayolinetime] ResPlayerBaseInfo todayolinetime
* @property {number|null} [rolecreatetime] ResPlayerBaseInfo rolecreatetime
* @property {number|null} [EmitOrderCnt] ResPlayerBaseInfo EmitOrderCnt
* @property {number|null} [NoAd] ResPlayerBaseInfo NoAd
* @property {number|null} [ChampshipsGroupID] ResPlayerBaseInfo ChampshipsGroupID
* @property {number|null} [LastChampGroupID] ResPlayerBaseInfo LastChampGroupID
* @property {string|null} [FaceBookId] ResPlayerBaseInfo FaceBookId
*/
/**
* Constructs a new ResPlayerBaseInfo.
* @memberof tutorial
* @classdesc Represents a ResPlayerBaseInfo.
* @implements IResPlayerBaseInfo
* @constructor
* @param {tutorial.IResPlayerBaseInfo=} [properties] Properties to set
*/
function ResPlayerBaseInfo(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]];
}
/**
* ResPlayerBaseInfo dwUin.
* @member {number} dwUin
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.dwUin = 0;
/**
* ResPlayerBaseInfo energy.
* @member {number} energy
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.energy = 0;
/**
* ResPlayerBaseInfo star.
* @member {number} star
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.star = 0;
/**
* ResPlayerBaseInfo recoverTime.
* @member {number} recoverTime
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.recoverTime = 0;
/**
* ResPlayerBaseInfo diamond.
* @member {number} diamond
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.diamond = 0;
/**
* ResPlayerBaseInfo level.
* @member {number} level
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.level = 0;
/**
* ResPlayerBaseInfo exp.
* @member {number} exp
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.exp = 0;
/**
* ResPlayerBaseInfo startOrderId.
* @member {string} startOrderId
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.startOrderId = "";
/**
* ResPlayerBaseInfo musicCode.
* @member {number} musicCode
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.musicCode = 0;
/**
* ResPlayerBaseInfo guild.
* @member {number} guild
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.guild = 0;
/**
* ResPlayerBaseInfo packUnlockCount.
* @member {number} packUnlockCount
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.packUnlockCount = 0;
/**
* ResPlayerBaseInfo lastPlayTime.
* @member {number} lastPlayTime
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.lastPlayTime = 0;
/**
* ResPlayerBaseInfo EnergyBuyCount.
* @member {number} EnergyBuyCount
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.EnergyBuyCount = 0;
/**
* ResPlayerBaseInfo userName.
* @member {string} userName
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.userName = "";
/**
* ResPlayerBaseInfo loginTime.
* @member {number} loginTime
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.loginTime = 0;
/**
* ResPlayerBaseInfo logoutTime.
* @member {number} logoutTime
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.logoutTime = 0;
/**
* ResPlayerBaseInfo todayolinetime.
* @member {number} todayolinetime
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.todayolinetime = 0;
/**
* ResPlayerBaseInfo rolecreatetime.
* @member {number} rolecreatetime
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.rolecreatetime = 0;
/**
* ResPlayerBaseInfo EmitOrderCnt.
* @member {number} EmitOrderCnt
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.EmitOrderCnt = 0;
/**
* ResPlayerBaseInfo NoAd.
* @member {number} NoAd
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.NoAd = 0;
/**
* ResPlayerBaseInfo ChampshipsGroupID.
* @member {number} ChampshipsGroupID
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.ChampshipsGroupID = 0;
/**
* ResPlayerBaseInfo LastChampGroupID.
* @member {number} LastChampGroupID
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.LastChampGroupID = 0;
/**
* ResPlayerBaseInfo FaceBookId.
* @member {string} FaceBookId
* @memberof tutorial.ResPlayerBaseInfo
* @instance
*/
ResPlayerBaseInfo.prototype.FaceBookId = "";
/**
* Creates a new ResPlayerBaseInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {tutorial.IResPlayerBaseInfo=} [properties] Properties to set
* @returns {tutorial.ResPlayerBaseInfo} ResPlayerBaseInfo instance
*/
ResPlayerBaseInfo.create = function create(properties) {
return new ResPlayerBaseInfo(properties);
};
/**
* Encodes the specified ResPlayerBaseInfo message. Does not implicitly {@link tutorial.ResPlayerBaseInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {tutorial.IResPlayerBaseInfo} message ResPlayerBaseInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerBaseInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.energy != null && Object.hasOwnProperty.call(message, "energy"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.energy);
if (message.star != null && Object.hasOwnProperty.call(message, "star"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.star);
if (message.recoverTime != null && Object.hasOwnProperty.call(message, "recoverTime"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoverTime);
if (message.diamond != null && Object.hasOwnProperty.call(message, "diamond"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.diamond);
if (message.level != null && Object.hasOwnProperty.call(message, "level"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.level);
if (message.exp != null && Object.hasOwnProperty.call(message, "exp"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.exp);
if (message.startOrderId != null && Object.hasOwnProperty.call(message, "startOrderId"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.startOrderId);
if (message.musicCode != null && Object.hasOwnProperty.call(message, "musicCode"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.musicCode);
if (message.guild != null && Object.hasOwnProperty.call(message, "guild"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.guild);
if (message.packUnlockCount != null && Object.hasOwnProperty.call(message, "packUnlockCount"))
writer.uint32(/* id 11, wireType 0 =*/88).int32(message.packUnlockCount);
if (message.lastPlayTime != null && Object.hasOwnProperty.call(message, "lastPlayTime"))
writer.uint32(/* id 12, wireType 0 =*/96).int32(message.lastPlayTime);
if (message.EnergyBuyCount != null && Object.hasOwnProperty.call(message, "EnergyBuyCount"))
writer.uint32(/* id 13, wireType 0 =*/104).int32(message.EnergyBuyCount);
if (message.userName != null && Object.hasOwnProperty.call(message, "userName"))
writer.uint32(/* id 14, wireType 2 =*/114).string(message.userName);
if (message.loginTime != null && Object.hasOwnProperty.call(message, "loginTime"))
writer.uint32(/* id 15, wireType 0 =*/120).int32(message.loginTime);
if (message.logoutTime != null && Object.hasOwnProperty.call(message, "logoutTime"))
writer.uint32(/* id 16, wireType 0 =*/128).int32(message.logoutTime);
if (message.todayolinetime != null && Object.hasOwnProperty.call(message, "todayolinetime"))
writer.uint32(/* id 17, wireType 0 =*/136).int32(message.todayolinetime);
if (message.rolecreatetime != null && Object.hasOwnProperty.call(message, "rolecreatetime"))
writer.uint32(/* id 18, wireType 0 =*/144).int32(message.rolecreatetime);
if (message.EmitOrderCnt != null && Object.hasOwnProperty.call(message, "EmitOrderCnt"))
writer.uint32(/* id 19, wireType 0 =*/152).int32(message.EmitOrderCnt);
if (message.NoAd != null && Object.hasOwnProperty.call(message, "NoAd"))
writer.uint32(/* id 20, wireType 0 =*/160).int32(message.NoAd);
if (message.ChampshipsGroupID != null && Object.hasOwnProperty.call(message, "ChampshipsGroupID"))
writer.uint32(/* id 21, wireType 0 =*/168).int32(message.ChampshipsGroupID);
if (message.LastChampGroupID != null && Object.hasOwnProperty.call(message, "LastChampGroupID"))
writer.uint32(/* id 22, wireType 0 =*/176).int32(message.LastChampGroupID);
if (message.FaceBookId != null && Object.hasOwnProperty.call(message, "FaceBookId"))
writer.uint32(/* id 23, wireType 2 =*/186).string(message.FaceBookId);
return writer;
};
/**
* Encodes the specified ResPlayerBaseInfo message, length delimited. Does not implicitly {@link tutorial.ResPlayerBaseInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {tutorial.IResPlayerBaseInfo} message ResPlayerBaseInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerBaseInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayerBaseInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayerBaseInfo} ResPlayerBaseInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerBaseInfo.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.ResPlayerBaseInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.energy = reader.int32();
break;
}
case 3: {
message.star = reader.int32();
break;
}
case 4: {
message.recoverTime = reader.int32();
break;
}
case 5: {
message.diamond = reader.int32();
break;
}
case 6: {
message.level = reader.int32();
break;
}
case 7: {
message.exp = reader.int32();
break;
}
case 8: {
message.startOrderId = reader.string();
break;
}
case 9: {
message.musicCode = reader.int32();
break;
}
case 10: {
message.guild = reader.int32();
break;
}
case 11: {
message.packUnlockCount = reader.int32();
break;
}
case 12: {
message.lastPlayTime = reader.int32();
break;
}
case 13: {
message.EnergyBuyCount = reader.int32();
break;
}
case 14: {
message.userName = reader.string();
break;
}
case 15: {
message.loginTime = reader.int32();
break;
}
case 16: {
message.logoutTime = reader.int32();
break;
}
case 17: {
message.todayolinetime = reader.int32();
break;
}
case 18: {
message.rolecreatetime = reader.int32();
break;
}
case 19: {
message.EmitOrderCnt = reader.int32();
break;
}
case 20: {
message.NoAd = reader.int32();
break;
}
case 21: {
message.ChampshipsGroupID = reader.int32();
break;
}
case 22: {
message.LastChampGroupID = reader.int32();
break;
}
case 23: {
message.FaceBookId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayerBaseInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayerBaseInfo} ResPlayerBaseInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerBaseInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayerBaseInfo message.
* @function verify
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayerBaseInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.energy != null && message.hasOwnProperty("energy"))
if (!$util.isInteger(message.energy))
return "energy: integer expected";
if (message.star != null && message.hasOwnProperty("star"))
if (!$util.isInteger(message.star))
return "star: integer expected";
if (message.recoverTime != null && message.hasOwnProperty("recoverTime"))
if (!$util.isInteger(message.recoverTime))
return "recoverTime: integer expected";
if (message.diamond != null && message.hasOwnProperty("diamond"))
if (!$util.isInteger(message.diamond))
return "diamond: integer expected";
if (message.level != null && message.hasOwnProperty("level"))
if (!$util.isInteger(message.level))
return "level: integer expected";
if (message.exp != null && message.hasOwnProperty("exp"))
if (!$util.isInteger(message.exp))
return "exp: integer expected";
if (message.startOrderId != null && message.hasOwnProperty("startOrderId"))
if (!$util.isString(message.startOrderId))
return "startOrderId: string expected";
if (message.musicCode != null && message.hasOwnProperty("musicCode"))
if (!$util.isInteger(message.musicCode))
return "musicCode: integer expected";
if (message.guild != null && message.hasOwnProperty("guild"))
if (!$util.isInteger(message.guild))
return "guild: integer expected";
if (message.packUnlockCount != null && message.hasOwnProperty("packUnlockCount"))
if (!$util.isInteger(message.packUnlockCount))
return "packUnlockCount: integer expected";
if (message.lastPlayTime != null && message.hasOwnProperty("lastPlayTime"))
if (!$util.isInteger(message.lastPlayTime))
return "lastPlayTime: integer expected";
if (message.EnergyBuyCount != null && message.hasOwnProperty("EnergyBuyCount"))
if (!$util.isInteger(message.EnergyBuyCount))
return "EnergyBuyCount: integer expected";
if (message.userName != null && message.hasOwnProperty("userName"))
if (!$util.isString(message.userName))
return "userName: string expected";
if (message.loginTime != null && message.hasOwnProperty("loginTime"))
if (!$util.isInteger(message.loginTime))
return "loginTime: integer expected";
if (message.logoutTime != null && message.hasOwnProperty("logoutTime"))
if (!$util.isInteger(message.logoutTime))
return "logoutTime: integer expected";
if (message.todayolinetime != null && message.hasOwnProperty("todayolinetime"))
if (!$util.isInteger(message.todayolinetime))
return "todayolinetime: integer expected";
if (message.rolecreatetime != null && message.hasOwnProperty("rolecreatetime"))
if (!$util.isInteger(message.rolecreatetime))
return "rolecreatetime: integer expected";
if (message.EmitOrderCnt != null && message.hasOwnProperty("EmitOrderCnt"))
if (!$util.isInteger(message.EmitOrderCnt))
return "EmitOrderCnt: integer expected";
if (message.NoAd != null && message.hasOwnProperty("NoAd"))
if (!$util.isInteger(message.NoAd))
return "NoAd: integer expected";
if (message.ChampshipsGroupID != null && message.hasOwnProperty("ChampshipsGroupID"))
if (!$util.isInteger(message.ChampshipsGroupID))
return "ChampshipsGroupID: integer expected";
if (message.LastChampGroupID != null && message.hasOwnProperty("LastChampGroupID"))
if (!$util.isInteger(message.LastChampGroupID))
return "LastChampGroupID: integer expected";
if (message.FaceBookId != null && message.hasOwnProperty("FaceBookId"))
if (!$util.isString(message.FaceBookId))
return "FaceBookId: string expected";
return null;
};
/**
* Creates a ResPlayerBaseInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayerBaseInfo} ResPlayerBaseInfo
*/
ResPlayerBaseInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayerBaseInfo)
return object;
var message = new $root.tutorial.ResPlayerBaseInfo();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.energy != null)
message.energy = object.energy | 0;
if (object.star != null)
message.star = object.star | 0;
if (object.recoverTime != null)
message.recoverTime = object.recoverTime | 0;
if (object.diamond != null)
message.diamond = object.diamond | 0;
if (object.level != null)
message.level = object.level | 0;
if (object.exp != null)
message.exp = object.exp | 0;
if (object.startOrderId != null)
message.startOrderId = String(object.startOrderId);
if (object.musicCode != null)
message.musicCode = object.musicCode | 0;
if (object.guild != null)
message.guild = object.guild | 0;
if (object.packUnlockCount != null)
message.packUnlockCount = object.packUnlockCount | 0;
if (object.lastPlayTime != null)
message.lastPlayTime = object.lastPlayTime | 0;
if (object.EnergyBuyCount != null)
message.EnergyBuyCount = object.EnergyBuyCount | 0;
if (object.userName != null)
message.userName = String(object.userName);
if (object.loginTime != null)
message.loginTime = object.loginTime | 0;
if (object.logoutTime != null)
message.logoutTime = object.logoutTime | 0;
if (object.todayolinetime != null)
message.todayolinetime = object.todayolinetime | 0;
if (object.rolecreatetime != null)
message.rolecreatetime = object.rolecreatetime | 0;
if (object.EmitOrderCnt != null)
message.EmitOrderCnt = object.EmitOrderCnt | 0;
if (object.NoAd != null)
message.NoAd = object.NoAd | 0;
if (object.ChampshipsGroupID != null)
message.ChampshipsGroupID = object.ChampshipsGroupID | 0;
if (object.LastChampGroupID != null)
message.LastChampGroupID = object.LastChampGroupID | 0;
if (object.FaceBookId != null)
message.FaceBookId = String(object.FaceBookId);
return message;
};
/**
* Creates a plain object from a ResPlayerBaseInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {tutorial.ResPlayerBaseInfo} message ResPlayerBaseInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayerBaseInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.energy = 0;
object.star = 0;
object.recoverTime = 0;
object.diamond = 0;
object.level = 0;
object.exp = 0;
object.startOrderId = "";
object.musicCode = 0;
object.guild = 0;
object.packUnlockCount = 0;
object.lastPlayTime = 0;
object.EnergyBuyCount = 0;
object.userName = "";
object.loginTime = 0;
object.logoutTime = 0;
object.todayolinetime = 0;
object.rolecreatetime = 0;
object.EmitOrderCnt = 0;
object.NoAd = 0;
object.ChampshipsGroupID = 0;
object.LastChampGroupID = 0;
object.FaceBookId = "";
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.energy != null && message.hasOwnProperty("energy"))
object.energy = message.energy;
if (message.star != null && message.hasOwnProperty("star"))
object.star = message.star;
if (message.recoverTime != null && message.hasOwnProperty("recoverTime"))
object.recoverTime = message.recoverTime;
if (message.diamond != null && message.hasOwnProperty("diamond"))
object.diamond = message.diamond;
if (message.level != null && message.hasOwnProperty("level"))
object.level = message.level;
if (message.exp != null && message.hasOwnProperty("exp"))
object.exp = message.exp;
if (message.startOrderId != null && message.hasOwnProperty("startOrderId"))
object.startOrderId = message.startOrderId;
if (message.musicCode != null && message.hasOwnProperty("musicCode"))
object.musicCode = message.musicCode;
if (message.guild != null && message.hasOwnProperty("guild"))
object.guild = message.guild;
if (message.packUnlockCount != null && message.hasOwnProperty("packUnlockCount"))
object.packUnlockCount = message.packUnlockCount;
if (message.lastPlayTime != null && message.hasOwnProperty("lastPlayTime"))
object.lastPlayTime = message.lastPlayTime;
if (message.EnergyBuyCount != null && message.hasOwnProperty("EnergyBuyCount"))
object.EnergyBuyCount = message.EnergyBuyCount;
if (message.userName != null && message.hasOwnProperty("userName"))
object.userName = message.userName;
if (message.loginTime != null && message.hasOwnProperty("loginTime"))
object.loginTime = message.loginTime;
if (message.logoutTime != null && message.hasOwnProperty("logoutTime"))
object.logoutTime = message.logoutTime;
if (message.todayolinetime != null && message.hasOwnProperty("todayolinetime"))
object.todayolinetime = message.todayolinetime;
if (message.rolecreatetime != null && message.hasOwnProperty("rolecreatetime"))
object.rolecreatetime = message.rolecreatetime;
if (message.EmitOrderCnt != null && message.hasOwnProperty("EmitOrderCnt"))
object.EmitOrderCnt = message.EmitOrderCnt;
if (message.NoAd != null && message.hasOwnProperty("NoAd"))
object.NoAd = message.NoAd;
if (message.ChampshipsGroupID != null && message.hasOwnProperty("ChampshipsGroupID"))
object.ChampshipsGroupID = message.ChampshipsGroupID;
if (message.LastChampGroupID != null && message.hasOwnProperty("LastChampGroupID"))
object.LastChampGroupID = message.LastChampGroupID;
if (message.FaceBookId != null && message.hasOwnProperty("FaceBookId"))
object.FaceBookId = message.FaceBookId;
return object;
};
/**
* Converts this ResPlayerBaseInfo to JSON.
* @function toJSON
* @memberof tutorial.ResPlayerBaseInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayerBaseInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayerBaseInfo
* @function getTypeUrl
* @memberof tutorial.ResPlayerBaseInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayerBaseInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayerBaseInfo";
};
return ResPlayerBaseInfo;
})();
tutorial.ResPlayerAsset = (function() {
/**
* Properties of a ResPlayerAsset.
* @memberof tutorial
* @interface IResPlayerAsset
* @property {number|null} [dwUin] ResPlayerAsset dwUin
* @property {number|null} [energy] ResPlayerAsset energy
* @property {number|null} [star] ResPlayerAsset star
* @property {number|null} [recoverTime] ResPlayerAsset recoverTime
* @property {number|null} [diamond] ResPlayerAsset diamond
* @property {number|null} [level] ResPlayerAsset level
* @property {number|null} [exp] ResPlayerAsset exp
* @property {number|null} [Login] ResPlayerAsset Login
* @property {number|null} [Logout] ResPlayerAsset Logout
*/
/**
* Constructs a new ResPlayerAsset.
* @memberof tutorial
* @classdesc Represents a ResPlayerAsset.
* @implements IResPlayerAsset
* @constructor
* @param {tutorial.IResPlayerAsset=} [properties] Properties to set
*/
function ResPlayerAsset(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]];
}
/**
* ResPlayerAsset dwUin.
* @member {number} dwUin
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.dwUin = 0;
/**
* ResPlayerAsset energy.
* @member {number} energy
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.energy = 0;
/**
* ResPlayerAsset star.
* @member {number} star
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.star = 0;
/**
* ResPlayerAsset recoverTime.
* @member {number} recoverTime
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.recoverTime = 0;
/**
* ResPlayerAsset diamond.
* @member {number} diamond
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.diamond = 0;
/**
* ResPlayerAsset level.
* @member {number} level
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.level = 0;
/**
* ResPlayerAsset exp.
* @member {number} exp
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.exp = 0;
/**
* ResPlayerAsset Login.
* @member {number} Login
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.Login = 0;
/**
* ResPlayerAsset Logout.
* @member {number} Logout
* @memberof tutorial.ResPlayerAsset
* @instance
*/
ResPlayerAsset.prototype.Logout = 0;
/**
* Creates a new ResPlayerAsset instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayerAsset
* @static
* @param {tutorial.IResPlayerAsset=} [properties] Properties to set
* @returns {tutorial.ResPlayerAsset} ResPlayerAsset instance
*/
ResPlayerAsset.create = function create(properties) {
return new ResPlayerAsset(properties);
};
/**
* Encodes the specified ResPlayerAsset message. Does not implicitly {@link tutorial.ResPlayerAsset.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayerAsset
* @static
* @param {tutorial.IResPlayerAsset} message ResPlayerAsset message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerAsset.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.energy != null && Object.hasOwnProperty.call(message, "energy"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.energy);
if (message.star != null && Object.hasOwnProperty.call(message, "star"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.star);
if (message.recoverTime != null && Object.hasOwnProperty.call(message, "recoverTime"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoverTime);
if (message.diamond != null && Object.hasOwnProperty.call(message, "diamond"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.diamond);
if (message.level != null && Object.hasOwnProperty.call(message, "level"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.level);
if (message.exp != null && Object.hasOwnProperty.call(message, "exp"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.exp);
if (message.Login != null && Object.hasOwnProperty.call(message, "Login"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.Login);
if (message.Logout != null && Object.hasOwnProperty.call(message, "Logout"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.Logout);
return writer;
};
/**
* Encodes the specified ResPlayerAsset message, length delimited. Does not implicitly {@link tutorial.ResPlayerAsset.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayerAsset
* @static
* @param {tutorial.IResPlayerAsset} message ResPlayerAsset message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerAsset.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayerAsset message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayerAsset
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayerAsset} ResPlayerAsset
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerAsset.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.ResPlayerAsset();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.energy = reader.int32();
break;
}
case 3: {
message.star = reader.int32();
break;
}
case 4: {
message.recoverTime = reader.int32();
break;
}
case 5: {
message.diamond = reader.int32();
break;
}
case 6: {
message.level = reader.int32();
break;
}
case 7: {
message.exp = reader.int32();
break;
}
case 8: {
message.Login = reader.int32();
break;
}
case 9: {
message.Logout = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayerAsset message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayerAsset
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayerAsset} ResPlayerAsset
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerAsset.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayerAsset message.
* @function verify
* @memberof tutorial.ResPlayerAsset
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayerAsset.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.energy != null && message.hasOwnProperty("energy"))
if (!$util.isInteger(message.energy))
return "energy: integer expected";
if (message.star != null && message.hasOwnProperty("star"))
if (!$util.isInteger(message.star))
return "star: integer expected";
if (message.recoverTime != null && message.hasOwnProperty("recoverTime"))
if (!$util.isInteger(message.recoverTime))
return "recoverTime: integer expected";
if (message.diamond != null && message.hasOwnProperty("diamond"))
if (!$util.isInteger(message.diamond))
return "diamond: integer expected";
if (message.level != null && message.hasOwnProperty("level"))
if (!$util.isInteger(message.level))
return "level: integer expected";
if (message.exp != null && message.hasOwnProperty("exp"))
if (!$util.isInteger(message.exp))
return "exp: integer expected";
if (message.Login != null && message.hasOwnProperty("Login"))
if (!$util.isInteger(message.Login))
return "Login: integer expected";
if (message.Logout != null && message.hasOwnProperty("Logout"))
if (!$util.isInteger(message.Logout))
return "Logout: integer expected";
return null;
};
/**
* Creates a ResPlayerAsset message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayerAsset
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayerAsset} ResPlayerAsset
*/
ResPlayerAsset.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayerAsset)
return object;
var message = new $root.tutorial.ResPlayerAsset();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.energy != null)
message.energy = object.energy | 0;
if (object.star != null)
message.star = object.star | 0;
if (object.recoverTime != null)
message.recoverTime = object.recoverTime | 0;
if (object.diamond != null)
message.diamond = object.diamond | 0;
if (object.level != null)
message.level = object.level | 0;
if (object.exp != null)
message.exp = object.exp | 0;
if (object.Login != null)
message.Login = object.Login | 0;
if (object.Logout != null)
message.Logout = object.Logout | 0;
return message;
};
/**
* Creates a plain object from a ResPlayerAsset message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayerAsset
* @static
* @param {tutorial.ResPlayerAsset} message ResPlayerAsset
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayerAsset.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.energy = 0;
object.star = 0;
object.recoverTime = 0;
object.diamond = 0;
object.level = 0;
object.exp = 0;
object.Login = 0;
object.Logout = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.energy != null && message.hasOwnProperty("energy"))
object.energy = message.energy;
if (message.star != null && message.hasOwnProperty("star"))
object.star = message.star;
if (message.recoverTime != null && message.hasOwnProperty("recoverTime"))
object.recoverTime = message.recoverTime;
if (message.diamond != null && message.hasOwnProperty("diamond"))
object.diamond = message.diamond;
if (message.level != null && message.hasOwnProperty("level"))
object.level = message.level;
if (message.exp != null && message.hasOwnProperty("exp"))
object.exp = message.exp;
if (message.Login != null && message.hasOwnProperty("Login"))
object.Login = message.Login;
if (message.Logout != null && message.hasOwnProperty("Logout"))
object.Logout = message.Logout;
return object;
};
/**
* Converts this ResPlayerAsset to JSON.
* @function toJSON
* @memberof tutorial.ResPlayerAsset
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayerAsset.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayerAsset
* @function getTypeUrl
* @memberof tutorial.ResPlayerAsset
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayerAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayerAsset";
};
return ResPlayerAsset;
})();
tutorial.UpdateBaseItemInfo = (function() {
/**
* Properties of an UpdateBaseItemInfo.
* @memberof tutorial
* @interface IUpdateBaseItemInfo
* @property {number|null} [dwUin] UpdateBaseItemInfo dwUin
* @property {Object.<string,number>|null} [mUpdateItem] UpdateBaseItemInfo mUpdateItem
*/
/**
* Constructs a new UpdateBaseItemInfo.
* @memberof tutorial
* @classdesc Represents an UpdateBaseItemInfo.
* @implements IUpdateBaseItemInfo
* @constructor
* @param {tutorial.IUpdateBaseItemInfo=} [properties] Properties to set
*/
function UpdateBaseItemInfo(properties) {
this.mUpdateItem = {};
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]];
}
/**
* UpdateBaseItemInfo dwUin.
* @member {number} dwUin
* @memberof tutorial.UpdateBaseItemInfo
* @instance
*/
UpdateBaseItemInfo.prototype.dwUin = 0;
/**
* UpdateBaseItemInfo mUpdateItem.
* @member {Object.<string,number>} mUpdateItem
* @memberof tutorial.UpdateBaseItemInfo
* @instance
*/
UpdateBaseItemInfo.prototype.mUpdateItem = $util.emptyObject;
/**
* Creates a new UpdateBaseItemInfo instance using the specified properties.
* @function create
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {tutorial.IUpdateBaseItemInfo=} [properties] Properties to set
* @returns {tutorial.UpdateBaseItemInfo} UpdateBaseItemInfo instance
*/
UpdateBaseItemInfo.create = function create(properties) {
return new UpdateBaseItemInfo(properties);
};
/**
* Encodes the specified UpdateBaseItemInfo message. Does not implicitly {@link tutorial.UpdateBaseItemInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {tutorial.IUpdateBaseItemInfo} message UpdateBaseItemInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UpdateBaseItemInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.mUpdateItem != null && Object.hasOwnProperty.call(message, "mUpdateItem"))
for (var keys = Object.keys(message.mUpdateItem), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mUpdateItem[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified UpdateBaseItemInfo message, length delimited. Does not implicitly {@link tutorial.UpdateBaseItemInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {tutorial.IUpdateBaseItemInfo} message UpdateBaseItemInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UpdateBaseItemInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an UpdateBaseItemInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.UpdateBaseItemInfo} UpdateBaseItemInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UpdateBaseItemInfo.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.UpdateBaseItemInfo(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
if (message.mUpdateItem === $util.emptyObject)
message.mUpdateItem = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mUpdateItem[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an UpdateBaseItemInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.UpdateBaseItemInfo} UpdateBaseItemInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UpdateBaseItemInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an UpdateBaseItemInfo message.
* @function verify
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UpdateBaseItemInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.mUpdateItem != null && message.hasOwnProperty("mUpdateItem")) {
if (!$util.isObject(message.mUpdateItem))
return "mUpdateItem: object expected";
var key = Object.keys(message.mUpdateItem);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "mUpdateItem: integer key{k:int32} expected";
if (!$util.isInteger(message.mUpdateItem[key[i]]))
return "mUpdateItem: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates an UpdateBaseItemInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.UpdateBaseItemInfo} UpdateBaseItemInfo
*/
UpdateBaseItemInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.UpdateBaseItemInfo)
return object;
var message = new $root.tutorial.UpdateBaseItemInfo();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.mUpdateItem) {
if (typeof object.mUpdateItem !== "object")
throw TypeError(".tutorial.UpdateBaseItemInfo.mUpdateItem: object expected");
message.mUpdateItem = {};
for (var keys = Object.keys(object.mUpdateItem), i = 0; i < keys.length; ++i)
message.mUpdateItem[keys[i]] = object.mUpdateItem[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from an UpdateBaseItemInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {tutorial.UpdateBaseItemInfo} message UpdateBaseItemInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UpdateBaseItemInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mUpdateItem = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
var keys2;
if (message.mUpdateItem && (keys2 = Object.keys(message.mUpdateItem)).length) {
object.mUpdateItem = {};
for (var j = 0; j < keys2.length; ++j)
object.mUpdateItem[keys2[j]] = message.mUpdateItem[keys2[j]];
}
return object;
};
/**
* Converts this UpdateBaseItemInfo to JSON.
* @function toJSON
* @memberof tutorial.UpdateBaseItemInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
UpdateBaseItemInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for UpdateBaseItemInfo
* @function getTypeUrl
* @memberof tutorial.UpdateBaseItemInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
UpdateBaseItemInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.UpdateBaseItemInfo";
};
return UpdateBaseItemInfo;
})();
tutorial.NotifyRenewBuyEnergyCnt = (function() {
/**
* Properties of a NotifyRenewBuyEnergyCnt.
* @memberof tutorial
* @interface INotifyRenewBuyEnergyCnt
* @property {number|null} [dwUin] NotifyRenewBuyEnergyCnt dwUin
* @property {number|null} [CurCnt] NotifyRenewBuyEnergyCnt CurCnt
*/
/**
* Constructs a new NotifyRenewBuyEnergyCnt.
* @memberof tutorial
* @classdesc Represents a NotifyRenewBuyEnergyCnt.
* @implements INotifyRenewBuyEnergyCnt
* @constructor
* @param {tutorial.INotifyRenewBuyEnergyCnt=} [properties] Properties to set
*/
function NotifyRenewBuyEnergyCnt(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]];
}
/**
* NotifyRenewBuyEnergyCnt dwUin.
* @member {number} dwUin
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @instance
*/
NotifyRenewBuyEnergyCnt.prototype.dwUin = 0;
/**
* NotifyRenewBuyEnergyCnt CurCnt.
* @member {number} CurCnt
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @instance
*/
NotifyRenewBuyEnergyCnt.prototype.CurCnt = 0;
/**
* Creates a new NotifyRenewBuyEnergyCnt instance using the specified properties.
* @function create
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {tutorial.INotifyRenewBuyEnergyCnt=} [properties] Properties to set
* @returns {tutorial.NotifyRenewBuyEnergyCnt} NotifyRenewBuyEnergyCnt instance
*/
NotifyRenewBuyEnergyCnt.create = function create(properties) {
return new NotifyRenewBuyEnergyCnt(properties);
};
/**
* Encodes the specified NotifyRenewBuyEnergyCnt message. Does not implicitly {@link tutorial.NotifyRenewBuyEnergyCnt.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {tutorial.INotifyRenewBuyEnergyCnt} message NotifyRenewBuyEnergyCnt message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyRenewBuyEnergyCnt.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.CurCnt != null && Object.hasOwnProperty.call(message, "CurCnt"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.CurCnt);
return writer;
};
/**
* Encodes the specified NotifyRenewBuyEnergyCnt message, length delimited. Does not implicitly {@link tutorial.NotifyRenewBuyEnergyCnt.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {tutorial.INotifyRenewBuyEnergyCnt} message NotifyRenewBuyEnergyCnt message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyRenewBuyEnergyCnt.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyRenewBuyEnergyCnt message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyRenewBuyEnergyCnt} NotifyRenewBuyEnergyCnt
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyRenewBuyEnergyCnt.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.NotifyRenewBuyEnergyCnt();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.CurCnt = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyRenewBuyEnergyCnt message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyRenewBuyEnergyCnt} NotifyRenewBuyEnergyCnt
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyRenewBuyEnergyCnt.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyRenewBuyEnergyCnt message.
* @function verify
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyRenewBuyEnergyCnt.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.CurCnt != null && message.hasOwnProperty("CurCnt"))
if (!$util.isInteger(message.CurCnt))
return "CurCnt: integer expected";
return null;
};
/**
* Creates a NotifyRenewBuyEnergyCnt message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyRenewBuyEnergyCnt} NotifyRenewBuyEnergyCnt
*/
NotifyRenewBuyEnergyCnt.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyRenewBuyEnergyCnt)
return object;
var message = new $root.tutorial.NotifyRenewBuyEnergyCnt();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.CurCnt != null)
message.CurCnt = object.CurCnt | 0;
return message;
};
/**
* Creates a plain object from a NotifyRenewBuyEnergyCnt message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {tutorial.NotifyRenewBuyEnergyCnt} message NotifyRenewBuyEnergyCnt
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyRenewBuyEnergyCnt.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.CurCnt = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.CurCnt != null && message.hasOwnProperty("CurCnt"))
object.CurCnt = message.CurCnt;
return object;
};
/**
* Converts this NotifyRenewBuyEnergyCnt to JSON.
* @function toJSON
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyRenewBuyEnergyCnt.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyRenewBuyEnergyCnt
* @function getTypeUrl
* @memberof tutorial.NotifyRenewBuyEnergyCnt
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyRenewBuyEnergyCnt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyRenewBuyEnergyCnt";
};
return NotifyRenewBuyEnergyCnt;
})();
tutorial.ReqRemoveAd = (function() {
/**
* Properties of a ReqRemoveAd.
* @memberof tutorial
* @interface IReqRemoveAd
* @property {number|null} [dwUin] ReqRemoveAd dwUin
*/
/**
* Constructs a new ReqRemoveAd.
* @memberof tutorial
* @classdesc 请求移除广告
* @implements IReqRemoveAd
* @constructor
* @param {tutorial.IReqRemoveAd=} [properties] Properties to set
*/
function ReqRemoveAd(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]];
}
/**
* ReqRemoveAd dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqRemoveAd
* @instance
*/
ReqRemoveAd.prototype.dwUin = 0;
/**
* Creates a new ReqRemoveAd instance using the specified properties.
* @function create
* @memberof tutorial.ReqRemoveAd
* @static
* @param {tutorial.IReqRemoveAd=} [properties] Properties to set
* @returns {tutorial.ReqRemoveAd} ReqRemoveAd instance
*/
ReqRemoveAd.create = function create(properties) {
return new ReqRemoveAd(properties);
};
/**
* Encodes the specified ReqRemoveAd message. Does not implicitly {@link tutorial.ReqRemoveAd.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRemoveAd
* @static
* @param {tutorial.IReqRemoveAd} message ReqRemoveAd message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRemoveAd.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqRemoveAd message, length delimited. Does not implicitly {@link tutorial.ReqRemoveAd.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRemoveAd
* @static
* @param {tutorial.IReqRemoveAd} message ReqRemoveAd message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRemoveAd.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRemoveAd message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRemoveAd
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRemoveAd} ReqRemoveAd
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRemoveAd.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.ReqRemoveAd();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRemoveAd message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRemoveAd
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRemoveAd} ReqRemoveAd
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRemoveAd.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRemoveAd message.
* @function verify
* @memberof tutorial.ReqRemoveAd
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRemoveAd.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqRemoveAd message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRemoveAd
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRemoveAd} ReqRemoveAd
*/
ReqRemoveAd.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRemoveAd)
return object;
var message = new $root.tutorial.ReqRemoveAd();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqRemoveAd message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRemoveAd
* @static
* @param {tutorial.ReqRemoveAd} message ReqRemoveAd
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRemoveAd.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqRemoveAd to JSON.
* @function toJSON
* @memberof tutorial.ReqRemoveAd
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRemoveAd.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRemoveAd
* @function getTypeUrl
* @memberof tutorial.ReqRemoveAd
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRemoveAd.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRemoveAd";
};
return ReqRemoveAd;
})();
tutorial.ResRemoveAd = (function() {
/**
* Properties of a ResRemoveAd.
* @memberof tutorial
* @interface IResRemoveAd
* @property {number|null} [ResultCode] ResRemoveAd ResultCode
*/
/**
* Constructs a new ResRemoveAd.
* @memberof tutorial
* @classdesc 响应移除广告
* @implements IResRemoveAd
* @constructor
* @param {tutorial.IResRemoveAd=} [properties] Properties to set
*/
function ResRemoveAd(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]];
}
/**
* ResRemoveAd ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResRemoveAd
* @instance
*/
ResRemoveAd.prototype.ResultCode = 0;
/**
* Creates a new ResRemoveAd instance using the specified properties.
* @function create
* @memberof tutorial.ResRemoveAd
* @static
* @param {tutorial.IResRemoveAd=} [properties] Properties to set
* @returns {tutorial.ResRemoveAd} ResRemoveAd instance
*/
ResRemoveAd.create = function create(properties) {
return new ResRemoveAd(properties);
};
/**
* Encodes the specified ResRemoveAd message. Does not implicitly {@link tutorial.ResRemoveAd.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRemoveAd
* @static
* @param {tutorial.IResRemoveAd} message ResRemoveAd message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRemoveAd.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
return writer;
};
/**
* Encodes the specified ResRemoveAd message, length delimited. Does not implicitly {@link tutorial.ResRemoveAd.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRemoveAd
* @static
* @param {tutorial.IResRemoveAd} message ResRemoveAd message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRemoveAd.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRemoveAd message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRemoveAd
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRemoveAd} ResRemoveAd
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRemoveAd.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.ResRemoveAd();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRemoveAd message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRemoveAd
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRemoveAd} ResRemoveAd
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRemoveAd.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRemoveAd message.
* @function verify
* @memberof tutorial.ResRemoveAd
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRemoveAd.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
return null;
};
/**
* Creates a ResRemoveAd message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRemoveAd
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRemoveAd} ResRemoveAd
*/
ResRemoveAd.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRemoveAd)
return object;
var message = new $root.tutorial.ResRemoveAd();
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
return message;
};
/**
* Creates a plain object from a ResRemoveAd message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRemoveAd
* @static
* @param {tutorial.ResRemoveAd} message ResRemoveAd
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRemoveAd.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.ResultCode = 0;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
return object;
};
/**
* Converts this ResRemoveAd to JSON.
* @function toJSON
* @memberof tutorial.ResRemoveAd
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRemoveAd.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRemoveAd
* @function getTypeUrl
* @memberof tutorial.ResRemoveAd
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRemoveAd.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRemoveAd";
};
return ResRemoveAd;
})();
tutorial.NotifyAddEnergy = (function() {
/**
* Properties of a NotifyAddEnergy.
* @memberof tutorial
* @interface INotifyAddEnergy
* @property {number|null} [dwUin] NotifyAddEnergy dwUin
* @property {number|null} [addCnt] NotifyAddEnergy addCnt
*/
/**
* Constructs a new NotifyAddEnergy.
* @memberof tutorial
* @classdesc Represents a NotifyAddEnergy.
* @implements INotifyAddEnergy
* @constructor
* @param {tutorial.INotifyAddEnergy=} [properties] Properties to set
*/
function NotifyAddEnergy(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]];
}
/**
* NotifyAddEnergy dwUin.
* @member {number} dwUin
* @memberof tutorial.NotifyAddEnergy
* @instance
*/
NotifyAddEnergy.prototype.dwUin = 0;
/**
* NotifyAddEnergy addCnt.
* @member {number} addCnt
* @memberof tutorial.NotifyAddEnergy
* @instance
*/
NotifyAddEnergy.prototype.addCnt = 0;
/**
* Creates a new NotifyAddEnergy instance using the specified properties.
* @function create
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {tutorial.INotifyAddEnergy=} [properties] Properties to set
* @returns {tutorial.NotifyAddEnergy} NotifyAddEnergy instance
*/
NotifyAddEnergy.create = function create(properties) {
return new NotifyAddEnergy(properties);
};
/**
* Encodes the specified NotifyAddEnergy message. Does not implicitly {@link tutorial.NotifyAddEnergy.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {tutorial.INotifyAddEnergy} message NotifyAddEnergy message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyAddEnergy.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.addCnt != null && Object.hasOwnProperty.call(message, "addCnt"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.addCnt);
return writer;
};
/**
* Encodes the specified NotifyAddEnergy message, length delimited. Does not implicitly {@link tutorial.NotifyAddEnergy.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {tutorial.INotifyAddEnergy} message NotifyAddEnergy message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyAddEnergy.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyAddEnergy message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyAddEnergy} NotifyAddEnergy
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyAddEnergy.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.NotifyAddEnergy();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.addCnt = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyAddEnergy message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyAddEnergy} NotifyAddEnergy
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyAddEnergy.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyAddEnergy message.
* @function verify
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyAddEnergy.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.addCnt != null && message.hasOwnProperty("addCnt"))
if (!$util.isInteger(message.addCnt))
return "addCnt: integer expected";
return null;
};
/**
* Creates a NotifyAddEnergy message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyAddEnergy} NotifyAddEnergy
*/
NotifyAddEnergy.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyAddEnergy)
return object;
var message = new $root.tutorial.NotifyAddEnergy();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.addCnt != null)
message.addCnt = object.addCnt | 0;
return message;
};
/**
* Creates a plain object from a NotifyAddEnergy message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {tutorial.NotifyAddEnergy} message NotifyAddEnergy
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyAddEnergy.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.addCnt = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.addCnt != null && message.hasOwnProperty("addCnt"))
object.addCnt = message.addCnt;
return object;
};
/**
* Converts this NotifyAddEnergy to JSON.
* @function toJSON
* @memberof tutorial.NotifyAddEnergy
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyAddEnergy.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyAddEnergy
* @function getTypeUrl
* @memberof tutorial.NotifyAddEnergy
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyAddEnergy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyAddEnergy";
};
return NotifyAddEnergy;
})();
tutorial.ReqServerTime = (function() {
/**
* Properties of a ReqServerTime.
* @memberof tutorial
* @interface IReqServerTime
* @property {number|null} [dwUin] ReqServerTime dwUin
*/
/**
* Constructs a new ReqServerTime.
* @memberof tutorial
* @classdesc 请求服务器时间
* @implements IReqServerTime
* @constructor
* @param {tutorial.IReqServerTime=} [properties] Properties to set
*/
function ReqServerTime(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]];
}
/**
* ReqServerTime dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqServerTime
* @instance
*/
ReqServerTime.prototype.dwUin = 0;
/**
* Creates a new ReqServerTime instance using the specified properties.
* @function create
* @memberof tutorial.ReqServerTime
* @static
* @param {tutorial.IReqServerTime=} [properties] Properties to set
* @returns {tutorial.ReqServerTime} ReqServerTime instance
*/
ReqServerTime.create = function create(properties) {
return new ReqServerTime(properties);
};
/**
* Encodes the specified ReqServerTime message. Does not implicitly {@link tutorial.ReqServerTime.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqServerTime
* @static
* @param {tutorial.IReqServerTime} message ReqServerTime message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqServerTime.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqServerTime message, length delimited. Does not implicitly {@link tutorial.ReqServerTime.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqServerTime
* @static
* @param {tutorial.IReqServerTime} message ReqServerTime message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqServerTime.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqServerTime message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqServerTime
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqServerTime} ReqServerTime
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqServerTime.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.ReqServerTime();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqServerTime message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqServerTime
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqServerTime} ReqServerTime
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqServerTime.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqServerTime message.
* @function verify
* @memberof tutorial.ReqServerTime
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqServerTime.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqServerTime message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqServerTime
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqServerTime} ReqServerTime
*/
ReqServerTime.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqServerTime)
return object;
var message = new $root.tutorial.ReqServerTime();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqServerTime message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqServerTime
* @static
* @param {tutorial.ReqServerTime} message ReqServerTime
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqServerTime.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqServerTime to JSON.
* @function toJSON
* @memberof tutorial.ReqServerTime
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqServerTime.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqServerTime
* @function getTypeUrl
* @memberof tutorial.ReqServerTime
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqServerTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqServerTime";
};
return ReqServerTime;
})();
tutorial.ResServerTime = (function() {
/**
* Properties of a ResServerTime.
* @memberof tutorial
* @interface IResServerTime
* @property {number|null} [ServerTime] ResServerTime ServerTime
*/
/**
* Constructs a new ResServerTime.
* @memberof tutorial
* @classdesc 响应服务器时间
* @implements IResServerTime
* @constructor
* @param {tutorial.IResServerTime=} [properties] Properties to set
*/
function ResServerTime(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]];
}
/**
* ResServerTime ServerTime.
* @member {number} ServerTime
* @memberof tutorial.ResServerTime
* @instance
*/
ResServerTime.prototype.ServerTime = 0;
/**
* Creates a new ResServerTime instance using the specified properties.
* @function create
* @memberof tutorial.ResServerTime
* @static
* @param {tutorial.IResServerTime=} [properties] Properties to set
* @returns {tutorial.ResServerTime} ResServerTime instance
*/
ResServerTime.create = function create(properties) {
return new ResServerTime(properties);
};
/**
* Encodes the specified ResServerTime message. Does not implicitly {@link tutorial.ResServerTime.verify|verify} messages.
* @function encode
* @memberof tutorial.ResServerTime
* @static
* @param {tutorial.IResServerTime} message ResServerTime message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResServerTime.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ServerTime != null && Object.hasOwnProperty.call(message, "ServerTime"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ServerTime);
return writer;
};
/**
* Encodes the specified ResServerTime message, length delimited. Does not implicitly {@link tutorial.ResServerTime.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResServerTime
* @static
* @param {tutorial.IResServerTime} message ResServerTime message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResServerTime.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResServerTime message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResServerTime
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResServerTime} ResServerTime
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResServerTime.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.ResServerTime();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ServerTime = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResServerTime message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResServerTime
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResServerTime} ResServerTime
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResServerTime.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResServerTime message.
* @function verify
* @memberof tutorial.ResServerTime
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResServerTime.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ServerTime != null && message.hasOwnProperty("ServerTime"))
if (!$util.isInteger(message.ServerTime))
return "ServerTime: integer expected";
return null;
};
/**
* Creates a ResServerTime message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResServerTime
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResServerTime} ResServerTime
*/
ResServerTime.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResServerTime)
return object;
var message = new $root.tutorial.ResServerTime();
if (object.ServerTime != null)
message.ServerTime = object.ServerTime | 0;
return message;
};
/**
* Creates a plain object from a ResServerTime message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResServerTime
* @static
* @param {tutorial.ResServerTime} message ResServerTime
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResServerTime.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.ServerTime = 0;
if (message.ServerTime != null && message.hasOwnProperty("ServerTime"))
object.ServerTime = message.ServerTime;
return object;
};
/**
* Converts this ResServerTime to JSON.
* @function toJSON
* @memberof tutorial.ResServerTime
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResServerTime.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResServerTime
* @function getTypeUrl
* @memberof tutorial.ResServerTime
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResServerTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResServerTime";
};
return ResServerTime;
})();
tutorial.ReqPlayerChessData = (function() {
/**
* Properties of a ReqPlayerChessData.
* @memberof tutorial
* @interface IReqPlayerChessData
* @property {number|null} [dwUin] ReqPlayerChessData dwUin
*/
/**
* Constructs a new ReqPlayerChessData.
* @memberof tutorial
* @classdesc Represents a ReqPlayerChessData.
* @implements IReqPlayerChessData
* @constructor
* @param {tutorial.IReqPlayerChessData=} [properties] Properties to set
*/
function ReqPlayerChessData(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]];
}
/**
* ReqPlayerChessData dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqPlayerChessData
* @instance
*/
ReqPlayerChessData.prototype.dwUin = 0;
/**
* Creates a new ReqPlayerChessData instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {tutorial.IReqPlayerChessData=} [properties] Properties to set
* @returns {tutorial.ReqPlayerChessData} ReqPlayerChessData instance
*/
ReqPlayerChessData.create = function create(properties) {
return new ReqPlayerChessData(properties);
};
/**
* Encodes the specified ReqPlayerChessData message. Does not implicitly {@link tutorial.ReqPlayerChessData.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {tutorial.IReqPlayerChessData} message ReqPlayerChessData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayerChessData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqPlayerChessData message, length delimited. Does not implicitly {@link tutorial.ReqPlayerChessData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {tutorial.IReqPlayerChessData} message ReqPlayerChessData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayerChessData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayerChessData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayerChessData} ReqPlayerChessData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayerChessData.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.ReqPlayerChessData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayerChessData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayerChessData} ReqPlayerChessData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayerChessData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayerChessData message.
* @function verify
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayerChessData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqPlayerChessData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayerChessData} ReqPlayerChessData
*/
ReqPlayerChessData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayerChessData)
return object;
var message = new $root.tutorial.ReqPlayerChessData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayerChessData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {tutorial.ReqPlayerChessData} message ReqPlayerChessData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayerChessData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqPlayerChessData to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayerChessData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayerChessData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayerChessData
* @function getTypeUrl
* @memberof tutorial.ReqPlayerChessData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayerChessData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayerChessData";
};
return ReqPlayerChessData;
})();
tutorial.ResPlayerChessData = (function() {
/**
* Properties of a ResPlayerChessData.
* @memberof tutorial
* @interface IResPlayerChessData
* @property {number|null} [dwUin] ResPlayerChessData dwUin
* @property {Object.<string,number>|null} [mChessData] ResPlayerChessData mChessData
* @property {Array.<number>|null} [ChessList] ResPlayerChessData ChessList
* @property {Array.<number>|null} [ChessBuff] ResPlayerChessData ChessBuff
*/
/**
* Constructs a new ResPlayerChessData.
* @memberof tutorial
* @classdesc 响应棋盘数据
* @implements IResPlayerChessData
* @constructor
* @param {tutorial.IResPlayerChessData=} [properties] Properties to set
*/
function ResPlayerChessData(properties) {
this.mChessData = {};
this.ChessList = [];
this.ChessBuff = [];
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]];
}
/**
* ResPlayerChessData dwUin.
* @member {number} dwUin
* @memberof tutorial.ResPlayerChessData
* @instance
*/
ResPlayerChessData.prototype.dwUin = 0;
/**
* ResPlayerChessData mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.ResPlayerChessData
* @instance
*/
ResPlayerChessData.prototype.mChessData = $util.emptyObject;
/**
* ResPlayerChessData ChessList.
* @member {Array.<number>} ChessList
* @memberof tutorial.ResPlayerChessData
* @instance
*/
ResPlayerChessData.prototype.ChessList = $util.emptyArray;
/**
* ResPlayerChessData ChessBuff.
* @member {Array.<number>} ChessBuff
* @memberof tutorial.ResPlayerChessData
* @instance
*/
ResPlayerChessData.prototype.ChessBuff = $util.emptyArray;
/**
* Creates a new ResPlayerChessData instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayerChessData
* @static
* @param {tutorial.IResPlayerChessData=} [properties] Properties to set
* @returns {tutorial.ResPlayerChessData} ResPlayerChessData instance
*/
ResPlayerChessData.create = function create(properties) {
return new ResPlayerChessData(properties);
};
/**
* Encodes the specified ResPlayerChessData message. Does not implicitly {@link tutorial.ResPlayerChessData.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayerChessData
* @static
* @param {tutorial.IResPlayerChessData} message ResPlayerChessData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerChessData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
if (message.ChessList != null && message.ChessList.length) {
writer.uint32(/* id 3, wireType 2 =*/26).fork();
for (var i = 0; i < message.ChessList.length; ++i)
writer.int32(message.ChessList[i]);
writer.ldelim();
}
if (message.ChessBuff != null && message.ChessBuff.length) {
writer.uint32(/* id 4, wireType 2 =*/34).fork();
for (var i = 0; i < message.ChessBuff.length; ++i)
writer.int32(message.ChessBuff[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified ResPlayerChessData message, length delimited. Does not implicitly {@link tutorial.ResPlayerChessData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayerChessData
* @static
* @param {tutorial.IResPlayerChessData} message ResPlayerChessData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerChessData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayerChessData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayerChessData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayerChessData} ResPlayerChessData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerChessData.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.ResPlayerChessData(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
case 3: {
if (!(message.ChessList && message.ChessList.length))
message.ChessList = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ChessList.push(reader.int32());
} else
message.ChessList.push(reader.int32());
break;
}
case 4: {
if (!(message.ChessBuff && message.ChessBuff.length))
message.ChessBuff = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ChessBuff.push(reader.int32());
} else
message.ChessBuff.push(reader.int32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayerChessData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayerChessData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayerChessData} ResPlayerChessData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerChessData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayerChessData message.
* @function verify
* @memberof tutorial.ResPlayerChessData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayerChessData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
if (message.ChessList != null && message.hasOwnProperty("ChessList")) {
if (!Array.isArray(message.ChessList))
return "ChessList: array expected";
for (var i = 0; i < message.ChessList.length; ++i)
if (!$util.isInteger(message.ChessList[i]))
return "ChessList: integer[] expected";
}
if (message.ChessBuff != null && message.hasOwnProperty("ChessBuff")) {
if (!Array.isArray(message.ChessBuff))
return "ChessBuff: array expected";
for (var i = 0; i < message.ChessBuff.length; ++i)
if (!$util.isInteger(message.ChessBuff[i]))
return "ChessBuff: integer[] expected";
}
return null;
};
/**
* Creates a ResPlayerChessData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayerChessData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayerChessData} ResPlayerChessData
*/
ResPlayerChessData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayerChessData)
return object;
var message = new $root.tutorial.ResPlayerChessData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.ResPlayerChessData.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
if (object.ChessList) {
if (!Array.isArray(object.ChessList))
throw TypeError(".tutorial.ResPlayerChessData.ChessList: array expected");
message.ChessList = [];
for (var i = 0; i < object.ChessList.length; ++i)
message.ChessList[i] = object.ChessList[i] | 0;
}
if (object.ChessBuff) {
if (!Array.isArray(object.ChessBuff))
throw TypeError(".tutorial.ResPlayerChessData.ChessBuff: array expected");
message.ChessBuff = [];
for (var i = 0; i < object.ChessBuff.length; ++i)
message.ChessBuff[i] = object.ChessBuff[i] | 0;
}
return message;
};
/**
* Creates a plain object from a ResPlayerChessData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayerChessData
* @static
* @param {tutorial.ResPlayerChessData} message ResPlayerChessData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayerChessData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.ChessList = [];
object.ChessBuff = [];
}
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
if (message.ChessList && message.ChessList.length) {
object.ChessList = [];
for (var j = 0; j < message.ChessList.length; ++j)
object.ChessList[j] = message.ChessList[j];
}
if (message.ChessBuff && message.ChessBuff.length) {
object.ChessBuff = [];
for (var j = 0; j < message.ChessBuff.length; ++j)
object.ChessBuff[j] = message.ChessBuff[j];
}
return object;
};
/**
* Converts this ResPlayerChessData to JSON.
* @function toJSON
* @memberof tutorial.ResPlayerChessData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayerChessData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayerChessData
* @function getTypeUrl
* @memberof tutorial.ResPlayerChessData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayerChessData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayerChessData";
};
return ResPlayerChessData;
})();
tutorial.ResPlayerChessInfo = (function() {
/**
* Properties of a ResPlayerChessInfo.
* @memberof tutorial
* @interface IResPlayerChessInfo
* @property {Array.<number>|null} [ChessList] ResPlayerChessInfo ChessList
* @property {Array.<number>|null} [ChessBuff] ResPlayerChessInfo ChessBuff
* @property {tutorial.IChessBag|null} [ChessBag] ResPlayerChessInfo ChessBag
* @property {Array.<string>|null} [RetireEmit] ResPlayerChessInfo RetireEmit
* @property {Array.<number>|null} [Honor] ResPlayerChessInfo Honor
*/
/**
* Constructs a new ResPlayerChessInfo.
* @memberof tutorial
* @classdesc Represents a ResPlayerChessInfo.
* @implements IResPlayerChessInfo
* @constructor
* @param {tutorial.IResPlayerChessInfo=} [properties] Properties to set
*/
function ResPlayerChessInfo(properties) {
this.ChessList = [];
this.ChessBuff = [];
this.RetireEmit = [];
this.Honor = [];
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]];
}
/**
* ResPlayerChessInfo ChessList.
* @member {Array.<number>} ChessList
* @memberof tutorial.ResPlayerChessInfo
* @instance
*/
ResPlayerChessInfo.prototype.ChessList = $util.emptyArray;
/**
* ResPlayerChessInfo ChessBuff.
* @member {Array.<number>} ChessBuff
* @memberof tutorial.ResPlayerChessInfo
* @instance
*/
ResPlayerChessInfo.prototype.ChessBuff = $util.emptyArray;
/**
* ResPlayerChessInfo ChessBag.
* @member {tutorial.IChessBag|null|undefined} ChessBag
* @memberof tutorial.ResPlayerChessInfo
* @instance
*/
ResPlayerChessInfo.prototype.ChessBag = null;
/**
* ResPlayerChessInfo RetireEmit.
* @member {Array.<string>} RetireEmit
* @memberof tutorial.ResPlayerChessInfo
* @instance
*/
ResPlayerChessInfo.prototype.RetireEmit = $util.emptyArray;
/**
* ResPlayerChessInfo Honor.
* @member {Array.<number>} Honor
* @memberof tutorial.ResPlayerChessInfo
* @instance
*/
ResPlayerChessInfo.prototype.Honor = $util.emptyArray;
/**
* Creates a new ResPlayerChessInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {tutorial.IResPlayerChessInfo=} [properties] Properties to set
* @returns {tutorial.ResPlayerChessInfo} ResPlayerChessInfo instance
*/
ResPlayerChessInfo.create = function create(properties) {
return new ResPlayerChessInfo(properties);
};
/**
* Encodes the specified ResPlayerChessInfo message. Does not implicitly {@link tutorial.ResPlayerChessInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {tutorial.IResPlayerChessInfo} message ResPlayerChessInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerChessInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ChessList != null && message.ChessList.length) {
writer.uint32(/* id 1, wireType 2 =*/10).fork();
for (var i = 0; i < message.ChessList.length; ++i)
writer.int32(message.ChessList[i]);
writer.ldelim();
}
if (message.ChessBuff != null && message.ChessBuff.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.ChessBuff.length; ++i)
writer.int32(message.ChessBuff[i]);
writer.ldelim();
}
if (message.ChessBag != null && Object.hasOwnProperty.call(message, "ChessBag"))
$root.tutorial.ChessBag.encode(message.ChessBag, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.RetireEmit != null && message.RetireEmit.length)
for (var i = 0; i < message.RetireEmit.length; ++i)
writer.uint32(/* id 4, wireType 2 =*/34).string(message.RetireEmit[i]);
if (message.Honor != null && message.Honor.length) {
writer.uint32(/* id 5, wireType 2 =*/42).fork();
for (var i = 0; i < message.Honor.length; ++i)
writer.int32(message.Honor[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified ResPlayerChessInfo message, length delimited. Does not implicitly {@link tutorial.ResPlayerChessInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {tutorial.IResPlayerChessInfo} message ResPlayerChessInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerChessInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayerChessInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayerChessInfo} ResPlayerChessInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerChessInfo.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.ResPlayerChessInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.ChessList && message.ChessList.length))
message.ChessList = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ChessList.push(reader.int32());
} else
message.ChessList.push(reader.int32());
break;
}
case 2: {
if (!(message.ChessBuff && message.ChessBuff.length))
message.ChessBuff = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ChessBuff.push(reader.int32());
} else
message.ChessBuff.push(reader.int32());
break;
}
case 3: {
message.ChessBag = $root.tutorial.ChessBag.decode(reader, reader.uint32());
break;
}
case 4: {
if (!(message.RetireEmit && message.RetireEmit.length))
message.RetireEmit = [];
message.RetireEmit.push(reader.string());
break;
}
case 5: {
if (!(message.Honor && message.Honor.length))
message.Honor = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Honor.push(reader.int32());
} else
message.Honor.push(reader.int32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayerChessInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayerChessInfo} ResPlayerChessInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerChessInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayerChessInfo message.
* @function verify
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayerChessInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ChessList != null && message.hasOwnProperty("ChessList")) {
if (!Array.isArray(message.ChessList))
return "ChessList: array expected";
for (var i = 0; i < message.ChessList.length; ++i)
if (!$util.isInteger(message.ChessList[i]))
return "ChessList: integer[] expected";
}
if (message.ChessBuff != null && message.hasOwnProperty("ChessBuff")) {
if (!Array.isArray(message.ChessBuff))
return "ChessBuff: array expected";
for (var i = 0; i < message.ChessBuff.length; ++i)
if (!$util.isInteger(message.ChessBuff[i]))
return "ChessBuff: integer[] expected";
}
if (message.ChessBag != null && message.hasOwnProperty("ChessBag")) {
var error = $root.tutorial.ChessBag.verify(message.ChessBag);
if (error)
return "ChessBag." + error;
}
if (message.RetireEmit != null && message.hasOwnProperty("RetireEmit")) {
if (!Array.isArray(message.RetireEmit))
return "RetireEmit: array expected";
for (var i = 0; i < message.RetireEmit.length; ++i)
if (!$util.isString(message.RetireEmit[i]))
return "RetireEmit: string[] expected";
}
if (message.Honor != null && message.hasOwnProperty("Honor")) {
if (!Array.isArray(message.Honor))
return "Honor: array expected";
for (var i = 0; i < message.Honor.length; ++i)
if (!$util.isInteger(message.Honor[i]))
return "Honor: integer[] expected";
}
return null;
};
/**
* Creates a ResPlayerChessInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayerChessInfo} ResPlayerChessInfo
*/
ResPlayerChessInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayerChessInfo)
return object;
var message = new $root.tutorial.ResPlayerChessInfo();
if (object.ChessList) {
if (!Array.isArray(object.ChessList))
throw TypeError(".tutorial.ResPlayerChessInfo.ChessList: array expected");
message.ChessList = [];
for (var i = 0; i < object.ChessList.length; ++i)
message.ChessList[i] = object.ChessList[i] | 0;
}
if (object.ChessBuff) {
if (!Array.isArray(object.ChessBuff))
throw TypeError(".tutorial.ResPlayerChessInfo.ChessBuff: array expected");
message.ChessBuff = [];
for (var i = 0; i < object.ChessBuff.length; ++i)
message.ChessBuff[i] = object.ChessBuff[i] | 0;
}
if (object.ChessBag != null) {
if (typeof object.ChessBag !== "object")
throw TypeError(".tutorial.ResPlayerChessInfo.ChessBag: object expected");
message.ChessBag = $root.tutorial.ChessBag.fromObject(object.ChessBag);
}
if (object.RetireEmit) {
if (!Array.isArray(object.RetireEmit))
throw TypeError(".tutorial.ResPlayerChessInfo.RetireEmit: array expected");
message.RetireEmit = [];
for (var i = 0; i < object.RetireEmit.length; ++i)
message.RetireEmit[i] = String(object.RetireEmit[i]);
}
if (object.Honor) {
if (!Array.isArray(object.Honor))
throw TypeError(".tutorial.ResPlayerChessInfo.Honor: array expected");
message.Honor = [];
for (var i = 0; i < object.Honor.length; ++i)
message.Honor[i] = object.Honor[i] | 0;
}
return message;
};
/**
* Creates a plain object from a ResPlayerChessInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {tutorial.ResPlayerChessInfo} message ResPlayerChessInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayerChessInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.ChessList = [];
object.ChessBuff = [];
object.RetireEmit = [];
object.Honor = [];
}
if (options.defaults)
object.ChessBag = null;
if (message.ChessList && message.ChessList.length) {
object.ChessList = [];
for (var j = 0; j < message.ChessList.length; ++j)
object.ChessList[j] = message.ChessList[j];
}
if (message.ChessBuff && message.ChessBuff.length) {
object.ChessBuff = [];
for (var j = 0; j < message.ChessBuff.length; ++j)
object.ChessBuff[j] = message.ChessBuff[j];
}
if (message.ChessBag != null && message.hasOwnProperty("ChessBag"))
object.ChessBag = $root.tutorial.ChessBag.toObject(message.ChessBag, options);
if (message.RetireEmit && message.RetireEmit.length) {
object.RetireEmit = [];
for (var j = 0; j < message.RetireEmit.length; ++j)
object.RetireEmit[j] = message.RetireEmit[j];
}
if (message.Honor && message.Honor.length) {
object.Honor = [];
for (var j = 0; j < message.Honor.length; ++j)
object.Honor[j] = message.Honor[j];
}
return object;
};
/**
* Converts this ResPlayerChessInfo to JSON.
* @function toJSON
* @memberof tutorial.ResPlayerChessInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayerChessInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayerChessInfo
* @function getTypeUrl
* @memberof tutorial.ResPlayerChessInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayerChessInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayerChessInfo";
};
return ResPlayerChessInfo;
})();
tutorial.ChessHandle = (function() {
/**
* Properties of a ChessHandle.
* @memberof tutorial
* @interface IChessHandle
* @property {tutorial.HANDLE_TYPE|null} [type] ChessHandle type
* @property {number|null} [Emit] ChessHandle Emit
* @property {number|null} [ChessId] ChessHandle ChessId
* @property {number|null} [Id] ChessHandle Id
* @property {Array.<number>|null} [ActType] ChessHandle ActType
*/
/**
* Constructs a new ChessHandle.
* @memberof tutorial
* @classdesc Represents a ChessHandle.
* @implements IChessHandle
* @constructor
* @param {tutorial.IChessHandle=} [properties] Properties to set
*/
function ChessHandle(properties) {
this.ActType = [];
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]];
}
/**
* ChessHandle type.
* @member {tutorial.HANDLE_TYPE} type
* @memberof tutorial.ChessHandle
* @instance
*/
ChessHandle.prototype.type = 0;
/**
* ChessHandle Emit.
* @member {number} Emit
* @memberof tutorial.ChessHandle
* @instance
*/
ChessHandle.prototype.Emit = 0;
/**
* ChessHandle ChessId.
* @member {number} ChessId
* @memberof tutorial.ChessHandle
* @instance
*/
ChessHandle.prototype.ChessId = 0;
/**
* ChessHandle Id.
* @member {number} Id
* @memberof tutorial.ChessHandle
* @instance
*/
ChessHandle.prototype.Id = 0;
/**
* ChessHandle ActType.
* @member {Array.<number>} ActType
* @memberof tutorial.ChessHandle
* @instance
*/
ChessHandle.prototype.ActType = $util.emptyArray;
/**
* Creates a new ChessHandle instance using the specified properties.
* @function create
* @memberof tutorial.ChessHandle
* @static
* @param {tutorial.IChessHandle=} [properties] Properties to set
* @returns {tutorial.ChessHandle} ChessHandle instance
*/
ChessHandle.create = function create(properties) {
return new ChessHandle(properties);
};
/**
* Encodes the specified ChessHandle message. Does not implicitly {@link tutorial.ChessHandle.verify|verify} messages.
* @function encode
* @memberof tutorial.ChessHandle
* @static
* @param {tutorial.IChessHandle} message ChessHandle message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChessHandle.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.type != null && Object.hasOwnProperty.call(message, "type"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
if (message.Emit != null && Object.hasOwnProperty.call(message, "Emit"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Emit);
if (message.ChessId != null && Object.hasOwnProperty.call(message, "ChessId"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ChessId);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Id);
if (message.ActType != null && message.ActType.length) {
writer.uint32(/* id 5, wireType 2 =*/42).fork();
for (var i = 0; i < message.ActType.length; ++i)
writer.int32(message.ActType[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified ChessHandle message, length delimited. Does not implicitly {@link tutorial.ChessHandle.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ChessHandle
* @static
* @param {tutorial.IChessHandle} message ChessHandle message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChessHandle.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ChessHandle message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ChessHandle
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ChessHandle} ChessHandle
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChessHandle.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.ChessHandle();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.type = reader.int32();
break;
}
case 2: {
message.Emit = reader.int32();
break;
}
case 3: {
message.ChessId = reader.int32();
break;
}
case 4: {
message.Id = reader.int32();
break;
}
case 5: {
if (!(message.ActType && message.ActType.length))
message.ActType = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ActType.push(reader.int32());
} else
message.ActType.push(reader.int32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ChessHandle message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ChessHandle
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ChessHandle} ChessHandle
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChessHandle.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ChessHandle message.
* @function verify
* @memberof tutorial.ChessHandle
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ChessHandle.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.type != null && message.hasOwnProperty("type"))
switch (message.type) {
default:
return "type: enum value expected";
case 0:
case 1:
case 2:
case 3:
case 4:
break;
}
if (message.Emit != null && message.hasOwnProperty("Emit"))
if (!$util.isInteger(message.Emit))
return "Emit: integer expected";
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
if (!$util.isInteger(message.ChessId))
return "ChessId: integer expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isInteger(message.Id))
return "Id: integer expected";
if (message.ActType != null && message.hasOwnProperty("ActType")) {
if (!Array.isArray(message.ActType))
return "ActType: array expected";
for (var i = 0; i < message.ActType.length; ++i)
if (!$util.isInteger(message.ActType[i]))
return "ActType: integer[] expected";
}
return null;
};
/**
* Creates a ChessHandle message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ChessHandle
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ChessHandle} ChessHandle
*/
ChessHandle.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ChessHandle)
return object;
var message = new $root.tutorial.ChessHandle();
switch (object.type) {
default:
if (typeof object.type === "number") {
message.type = object.type;
break;
}
break;
case "ADD":
case 0:
message.type = 0;
break;
case "COMPOSE":
case 1:
message.type = 1;
break;
case "BUY":
case 2:
message.type = 2;
break;
case "SELL":
case 3:
message.type = 3;
break;
case "REMOVE":
case 4:
message.type = 4;
break;
}
if (object.Emit != null)
message.Emit = object.Emit | 0;
if (object.ChessId != null)
message.ChessId = object.ChessId | 0;
if (object.Id != null)
message.Id = object.Id | 0;
if (object.ActType) {
if (!Array.isArray(object.ActType))
throw TypeError(".tutorial.ChessHandle.ActType: array expected");
message.ActType = [];
for (var i = 0; i < object.ActType.length; ++i)
message.ActType[i] = object.ActType[i] | 0;
}
return message;
};
/**
* Creates a plain object from a ChessHandle message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ChessHandle
* @static
* @param {tutorial.ChessHandle} message ChessHandle
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ChessHandle.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.ActType = [];
if (options.defaults) {
object.type = options.enums === String ? "ADD" : 0;
object.Emit = 0;
object.ChessId = 0;
object.Id = 0;
}
if (message.type != null && message.hasOwnProperty("type"))
object.type = options.enums === String ? $root.tutorial.HANDLE_TYPE[message.type] === undefined ? message.type : $root.tutorial.HANDLE_TYPE[message.type] : message.type;
if (message.Emit != null && message.hasOwnProperty("Emit"))
object.Emit = message.Emit;
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
object.ChessId = message.ChessId;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.ActType && message.ActType.length) {
object.ActType = [];
for (var j = 0; j < message.ActType.length; ++j)
object.ActType[j] = message.ActType[j];
}
return object;
};
/**
* Converts this ChessHandle to JSON.
* @function toJSON
* @memberof tutorial.ChessHandle
* @instance
* @returns {Object.<string,*>} JSON object
*/
ChessHandle.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ChessHandle
* @function getTypeUrl
* @memberof tutorial.ChessHandle
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ChessHandle.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ChessHandle";
};
return ChessHandle;
})();
tutorial.UpdatePlayerChessData = (function() {
/**
* Properties of an UpdatePlayerChessData.
* @memberof tutorial
* @interface IUpdatePlayerChessData
* @property {number|null} [dwUin] UpdatePlayerChessData dwUin
* @property {Object.<string,number>|null} [mChessData] UpdatePlayerChessData mChessData
* @property {Array.<tutorial.IChessHandle>|null} [mChessHandle] UpdatePlayerChessData mChessHandle
*/
/**
* Constructs a new UpdatePlayerChessData.
* @memberof tutorial
* @classdesc 同步棋盘数据
* @implements IUpdatePlayerChessData
* @constructor
* @param {tutorial.IUpdatePlayerChessData=} [properties] Properties to set
*/
function UpdatePlayerChessData(properties) {
this.mChessData = {};
this.mChessHandle = [];
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]];
}
/**
* UpdatePlayerChessData dwUin.
* @member {number} dwUin
* @memberof tutorial.UpdatePlayerChessData
* @instance
*/
UpdatePlayerChessData.prototype.dwUin = 0;
/**
* UpdatePlayerChessData mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.UpdatePlayerChessData
* @instance
*/
UpdatePlayerChessData.prototype.mChessData = $util.emptyObject;
/**
* UpdatePlayerChessData mChessHandle.
* @member {Array.<tutorial.IChessHandle>} mChessHandle
* @memberof tutorial.UpdatePlayerChessData
* @instance
*/
UpdatePlayerChessData.prototype.mChessHandle = $util.emptyArray;
/**
* Creates a new UpdatePlayerChessData instance using the specified properties.
* @function create
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {tutorial.IUpdatePlayerChessData=} [properties] Properties to set
* @returns {tutorial.UpdatePlayerChessData} UpdatePlayerChessData instance
*/
UpdatePlayerChessData.create = function create(properties) {
return new UpdatePlayerChessData(properties);
};
/**
* Encodes the specified UpdatePlayerChessData message. Does not implicitly {@link tutorial.UpdatePlayerChessData.verify|verify} messages.
* @function encode
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {tutorial.IUpdatePlayerChessData} message UpdatePlayerChessData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UpdatePlayerChessData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
if (message.mChessHandle != null && message.mChessHandle.length)
for (var i = 0; i < message.mChessHandle.length; ++i)
$root.tutorial.ChessHandle.encode(message.mChessHandle[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified UpdatePlayerChessData message, length delimited. Does not implicitly {@link tutorial.UpdatePlayerChessData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {tutorial.IUpdatePlayerChessData} message UpdatePlayerChessData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UpdatePlayerChessData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an UpdatePlayerChessData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.UpdatePlayerChessData} UpdatePlayerChessData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UpdatePlayerChessData.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.UpdatePlayerChessData(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
case 3: {
if (!(message.mChessHandle && message.mChessHandle.length))
message.mChessHandle = [];
message.mChessHandle.push($root.tutorial.ChessHandle.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an UpdatePlayerChessData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.UpdatePlayerChessData} UpdatePlayerChessData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UpdatePlayerChessData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an UpdatePlayerChessData message.
* @function verify
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UpdatePlayerChessData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
if (message.mChessHandle != null && message.hasOwnProperty("mChessHandle")) {
if (!Array.isArray(message.mChessHandle))
return "mChessHandle: array expected";
for (var i = 0; i < message.mChessHandle.length; ++i) {
var error = $root.tutorial.ChessHandle.verify(message.mChessHandle[i]);
if (error)
return "mChessHandle." + error;
}
}
return null;
};
/**
* Creates an UpdatePlayerChessData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.UpdatePlayerChessData} UpdatePlayerChessData
*/
UpdatePlayerChessData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.UpdatePlayerChessData)
return object;
var message = new $root.tutorial.UpdatePlayerChessData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.UpdatePlayerChessData.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
if (object.mChessHandle) {
if (!Array.isArray(object.mChessHandle))
throw TypeError(".tutorial.UpdatePlayerChessData.mChessHandle: array expected");
message.mChessHandle = [];
for (var i = 0; i < object.mChessHandle.length; ++i) {
if (typeof object.mChessHandle[i] !== "object")
throw TypeError(".tutorial.UpdatePlayerChessData.mChessHandle: object expected");
message.mChessHandle[i] = $root.tutorial.ChessHandle.fromObject(object.mChessHandle[i]);
}
}
return message;
};
/**
* Creates a plain object from an UpdatePlayerChessData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {tutorial.UpdatePlayerChessData} message UpdatePlayerChessData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UpdatePlayerChessData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.mChessHandle = [];
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
if (message.mChessHandle && message.mChessHandle.length) {
object.mChessHandle = [];
for (var j = 0; j < message.mChessHandle.length; ++j)
object.mChessHandle[j] = $root.tutorial.ChessHandle.toObject(message.mChessHandle[j], options);
}
return object;
};
/**
* Converts this UpdatePlayerChessData to JSON.
* @function toJSON
* @memberof tutorial.UpdatePlayerChessData
* @instance
* @returns {Object.<string,*>} JSON object
*/
UpdatePlayerChessData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for UpdatePlayerChessData
* @function getTypeUrl
* @memberof tutorial.UpdatePlayerChessData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
UpdatePlayerChessData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.UpdatePlayerChessData";
};
return UpdatePlayerChessData;
})();
tutorial.ResUpdatePlayerChessData = (function() {
/**
* Properties of a ResUpdatePlayerChessData.
* @memberof tutorial
* @interface IResUpdatePlayerChessData
* @property {tutorial.RES_CODE|null} [code] ResUpdatePlayerChessData code
* @property {string|null} [msg] ResUpdatePlayerChessData msg
*/
/**
* Constructs a new ResUpdatePlayerChessData.
* @memberof tutorial
* @classdesc Represents a ResUpdatePlayerChessData.
* @implements IResUpdatePlayerChessData
* @constructor
* @param {tutorial.IResUpdatePlayerChessData=} [properties] Properties to set
*/
function ResUpdatePlayerChessData(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]];
}
/**
* ResUpdatePlayerChessData code.
* @member {tutorial.RES_CODE} code
* @memberof tutorial.ResUpdatePlayerChessData
* @instance
*/
ResUpdatePlayerChessData.prototype.code = 0;
/**
* ResUpdatePlayerChessData msg.
* @member {string} msg
* @memberof tutorial.ResUpdatePlayerChessData
* @instance
*/
ResUpdatePlayerChessData.prototype.msg = "";
/**
* Creates a new ResUpdatePlayerChessData instance using the specified properties.
* @function create
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {tutorial.IResUpdatePlayerChessData=} [properties] Properties to set
* @returns {tutorial.ResUpdatePlayerChessData} ResUpdatePlayerChessData instance
*/
ResUpdatePlayerChessData.create = function create(properties) {
return new ResUpdatePlayerChessData(properties);
};
/**
* Encodes the specified ResUpdatePlayerChessData message. Does not implicitly {@link tutorial.ResUpdatePlayerChessData.verify|verify} messages.
* @function encode
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {tutorial.IResUpdatePlayerChessData} message ResUpdatePlayerChessData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResUpdatePlayerChessData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg);
return writer;
};
/**
* Encodes the specified ResUpdatePlayerChessData message, length delimited. Does not implicitly {@link tutorial.ResUpdatePlayerChessData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {tutorial.IResUpdatePlayerChessData} message ResUpdatePlayerChessData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResUpdatePlayerChessData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResUpdatePlayerChessData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResUpdatePlayerChessData} ResUpdatePlayerChessData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResUpdatePlayerChessData.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.ResUpdatePlayerChessData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.code = reader.int32();
break;
}
case 2: {
message.msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResUpdatePlayerChessData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResUpdatePlayerChessData} ResUpdatePlayerChessData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResUpdatePlayerChessData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResUpdatePlayerChessData message.
* @function verify
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResUpdatePlayerChessData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.code != null && message.hasOwnProperty("code"))
switch (message.code) {
default:
return "code: enum value expected";
case 0:
case 1:
break;
}
if (message.msg != null && message.hasOwnProperty("msg"))
if (!$util.isString(message.msg))
return "msg: string expected";
return null;
};
/**
* Creates a ResUpdatePlayerChessData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResUpdatePlayerChessData} ResUpdatePlayerChessData
*/
ResUpdatePlayerChessData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResUpdatePlayerChessData)
return object;
var message = new $root.tutorial.ResUpdatePlayerChessData();
switch (object.code) {
default:
if (typeof object.code === "number") {
message.code = object.code;
break;
}
break;
case "FAIL":
case 0:
message.code = 0;
break;
case "SUCCESS":
case 1:
message.code = 1;
break;
}
if (object.msg != null)
message.msg = String(object.msg);
return message;
};
/**
* Creates a plain object from a ResUpdatePlayerChessData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {tutorial.ResUpdatePlayerChessData} message ResUpdatePlayerChessData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResUpdatePlayerChessData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.code = options.enums === String ? "FAIL" : 0;
object.msg = "";
}
if (message.code != null && message.hasOwnProperty("code"))
object.code = options.enums === String ? $root.tutorial.RES_CODE[message.code] === undefined ? message.code : $root.tutorial.RES_CODE[message.code] : message.code;
if (message.msg != null && message.hasOwnProperty("msg"))
object.msg = message.msg;
return object;
};
/**
* Converts this ResUpdatePlayerChessData to JSON.
* @function toJSON
* @memberof tutorial.ResUpdatePlayerChessData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResUpdatePlayerChessData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResUpdatePlayerChessData
* @function getTypeUrl
* @memberof tutorial.ResUpdatePlayerChessData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResUpdatePlayerChessData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResUpdatePlayerChessData";
};
return ResUpdatePlayerChessData;
})();
tutorial.ReqGetChessFromBuff = (function() {
/**
* Properties of a ReqGetChessFromBuff.
* @memberof tutorial
* @interface IReqGetChessFromBuff
* @property {number|null} [ChessId] ReqGetChessFromBuff ChessId
* @property {Object.<string,number>|null} [mChessData] ReqGetChessFromBuff mChessData
*/
/**
* Constructs a new ReqGetChessFromBuff.
* @memberof tutorial
* @classdesc Represents a ReqGetChessFromBuff.
* @implements IReqGetChessFromBuff
* @constructor
* @param {tutorial.IReqGetChessFromBuff=} [properties] Properties to set
*/
function ReqGetChessFromBuff(properties) {
this.mChessData = {};
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]];
}
/**
* ReqGetChessFromBuff ChessId.
* @member {number} ChessId
* @memberof tutorial.ReqGetChessFromBuff
* @instance
*/
ReqGetChessFromBuff.prototype.ChessId = 0;
/**
* ReqGetChessFromBuff mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.ReqGetChessFromBuff
* @instance
*/
ReqGetChessFromBuff.prototype.mChessData = $util.emptyObject;
/**
* Creates a new ReqGetChessFromBuff instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {tutorial.IReqGetChessFromBuff=} [properties] Properties to set
* @returns {tutorial.ReqGetChessFromBuff} ReqGetChessFromBuff instance
*/
ReqGetChessFromBuff.create = function create(properties) {
return new ReqGetChessFromBuff(properties);
};
/**
* Encodes the specified ReqGetChessFromBuff message. Does not implicitly {@link tutorial.ReqGetChessFromBuff.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {tutorial.IReqGetChessFromBuff} message ReqGetChessFromBuff message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetChessFromBuff.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ChessId != null && Object.hasOwnProperty.call(message, "ChessId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ChessId);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqGetChessFromBuff message, length delimited. Does not implicitly {@link tutorial.ReqGetChessFromBuff.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {tutorial.IReqGetChessFromBuff} message ReqGetChessFromBuff message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetChessFromBuff.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetChessFromBuff message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetChessFromBuff} ReqGetChessFromBuff
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetChessFromBuff.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.ReqGetChessFromBuff(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ChessId = reader.int32();
break;
}
case 2: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetChessFromBuff message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetChessFromBuff} ReqGetChessFromBuff
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetChessFromBuff.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetChessFromBuff message.
* @function verify
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetChessFromBuff.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
if (!$util.isInteger(message.ChessId))
return "ChessId: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
return null;
};
/**
* Creates a ReqGetChessFromBuff message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetChessFromBuff} ReqGetChessFromBuff
*/
ReqGetChessFromBuff.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetChessFromBuff)
return object;
var message = new $root.tutorial.ReqGetChessFromBuff();
if (object.ChessId != null)
message.ChessId = object.ChessId | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.ReqGetChessFromBuff.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqGetChessFromBuff message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {tutorial.ReqGetChessFromBuff} message ReqGetChessFromBuff
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetChessFromBuff.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults)
object.ChessId = 0;
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
object.ChessId = message.ChessId;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
return object;
};
/**
* Converts this ReqGetChessFromBuff to JSON.
* @function toJSON
* @memberof tutorial.ReqGetChessFromBuff
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetChessFromBuff.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetChessFromBuff
* @function getTypeUrl
* @memberof tutorial.ReqGetChessFromBuff
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetChessFromBuff.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetChessFromBuff";
};
return ReqGetChessFromBuff;
})();
tutorial.ResGetChessFromBuff = (function() {
/**
* Properties of a ResGetChessFromBuff.
* @memberof tutorial
* @interface IResGetChessFromBuff
* @property {tutorial.RES_CODE|null} [code] ResGetChessFromBuff code
* @property {string|null} [msg] ResGetChessFromBuff msg
*/
/**
* Constructs a new ResGetChessFromBuff.
* @memberof tutorial
* @classdesc Represents a ResGetChessFromBuff.
* @implements IResGetChessFromBuff
* @constructor
* @param {tutorial.IResGetChessFromBuff=} [properties] Properties to set
*/
function ResGetChessFromBuff(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]];
}
/**
* ResGetChessFromBuff code.
* @member {tutorial.RES_CODE} code
* @memberof tutorial.ResGetChessFromBuff
* @instance
*/
ResGetChessFromBuff.prototype.code = 0;
/**
* ResGetChessFromBuff msg.
* @member {string} msg
* @memberof tutorial.ResGetChessFromBuff
* @instance
*/
ResGetChessFromBuff.prototype.msg = "";
/**
* Creates a new ResGetChessFromBuff instance using the specified properties.
* @function create
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {tutorial.IResGetChessFromBuff=} [properties] Properties to set
* @returns {tutorial.ResGetChessFromBuff} ResGetChessFromBuff instance
*/
ResGetChessFromBuff.create = function create(properties) {
return new ResGetChessFromBuff(properties);
};
/**
* Encodes the specified ResGetChessFromBuff message. Does not implicitly {@link tutorial.ResGetChessFromBuff.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {tutorial.IResGetChessFromBuff} message ResGetChessFromBuff message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetChessFromBuff.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg);
return writer;
};
/**
* Encodes the specified ResGetChessFromBuff message, length delimited. Does not implicitly {@link tutorial.ResGetChessFromBuff.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {tutorial.IResGetChessFromBuff} message ResGetChessFromBuff message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetChessFromBuff.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetChessFromBuff message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetChessFromBuff} ResGetChessFromBuff
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetChessFromBuff.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.ResGetChessFromBuff();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.code = reader.int32();
break;
}
case 2: {
message.msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetChessFromBuff message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetChessFromBuff} ResGetChessFromBuff
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetChessFromBuff.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetChessFromBuff message.
* @function verify
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetChessFromBuff.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.code != null && message.hasOwnProperty("code"))
switch (message.code) {
default:
return "code: enum value expected";
case 0:
case 1:
break;
}
if (message.msg != null && message.hasOwnProperty("msg"))
if (!$util.isString(message.msg))
return "msg: string expected";
return null;
};
/**
* Creates a ResGetChessFromBuff message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetChessFromBuff} ResGetChessFromBuff
*/
ResGetChessFromBuff.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetChessFromBuff)
return object;
var message = new $root.tutorial.ResGetChessFromBuff();
switch (object.code) {
default:
if (typeof object.code === "number") {
message.code = object.code;
break;
}
break;
case "FAIL":
case 0:
message.code = 0;
break;
case "SUCCESS":
case 1:
message.code = 1;
break;
}
if (object.msg != null)
message.msg = String(object.msg);
return message;
};
/**
* Creates a plain object from a ResGetChessFromBuff message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {tutorial.ResGetChessFromBuff} message ResGetChessFromBuff
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetChessFromBuff.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.code = options.enums === String ? "FAIL" : 0;
object.msg = "";
}
if (message.code != null && message.hasOwnProperty("code"))
object.code = options.enums === String ? $root.tutorial.RES_CODE[message.code] === undefined ? message.code : $root.tutorial.RES_CODE[message.code] : message.code;
if (message.msg != null && message.hasOwnProperty("msg"))
object.msg = message.msg;
return object;
};
/**
* Converts this ResGetChessFromBuff to JSON.
* @function toJSON
* @memberof tutorial.ResGetChessFromBuff
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetChessFromBuff.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetChessFromBuff
* @function getTypeUrl
* @memberof tutorial.ResGetChessFromBuff
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetChessFromBuff.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetChessFromBuff";
};
return ResGetChessFromBuff;
})();
tutorial.ReqChessEx = (function() {
/**
* Properties of a ReqChessEx.
* @memberof tutorial
* @interface IReqChessEx
* @property {number|null} [OldChessId] ReqChessEx OldChessId
* @property {number|null} [NewChessId] ReqChessEx NewChessId
* @property {number|null} [CostDia] ReqChessEx CostDia
* @property {number|null} [Type] ReqChessEx Type
* @property {Object.<string,number>|null} [mChessData] ReqChessEx mChessData
*/
/**
* Constructs a new ReqChessEx.
* @memberof tutorial
* @classdesc Represents a ReqChessEx.
* @implements IReqChessEx
* @constructor
* @param {tutorial.IReqChessEx=} [properties] Properties to set
*/
function ReqChessEx(properties) {
this.mChessData = {};
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]];
}
/**
* ReqChessEx OldChessId.
* @member {number} OldChessId
* @memberof tutorial.ReqChessEx
* @instance
*/
ReqChessEx.prototype.OldChessId = 0;
/**
* ReqChessEx NewChessId.
* @member {number} NewChessId
* @memberof tutorial.ReqChessEx
* @instance
*/
ReqChessEx.prototype.NewChessId = 0;
/**
* ReqChessEx CostDia.
* @member {number} CostDia
* @memberof tutorial.ReqChessEx
* @instance
*/
ReqChessEx.prototype.CostDia = 0;
/**
* ReqChessEx Type.
* @member {number} Type
* @memberof tutorial.ReqChessEx
* @instance
*/
ReqChessEx.prototype.Type = 0;
/**
* ReqChessEx mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.ReqChessEx
* @instance
*/
ReqChessEx.prototype.mChessData = $util.emptyObject;
/**
* Creates a new ReqChessEx instance using the specified properties.
* @function create
* @memberof tutorial.ReqChessEx
* @static
* @param {tutorial.IReqChessEx=} [properties] Properties to set
* @returns {tutorial.ReqChessEx} ReqChessEx instance
*/
ReqChessEx.create = function create(properties) {
return new ReqChessEx(properties);
};
/**
* Encodes the specified ReqChessEx message. Does not implicitly {@link tutorial.ReqChessEx.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqChessEx
* @static
* @param {tutorial.IReqChessEx} message ReqChessEx message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChessEx.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.OldChessId != null && Object.hasOwnProperty.call(message, "OldChessId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.OldChessId);
if (message.NewChessId != null && Object.hasOwnProperty.call(message, "NewChessId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.NewChessId);
if (message.CostDia != null && Object.hasOwnProperty.call(message, "CostDia"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.CostDia);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Type);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqChessEx message, length delimited. Does not implicitly {@link tutorial.ReqChessEx.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqChessEx
* @static
* @param {tutorial.IReqChessEx} message ReqChessEx message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChessEx.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqChessEx message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqChessEx
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqChessEx} ReqChessEx
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChessEx.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.ReqChessEx(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.OldChessId = reader.int32();
break;
}
case 2: {
message.NewChessId = reader.int32();
break;
}
case 3: {
message.CostDia = reader.int32();
break;
}
case 4: {
message.Type = reader.int32();
break;
}
case 5: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqChessEx message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqChessEx
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqChessEx} ReqChessEx
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChessEx.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqChessEx message.
* @function verify
* @memberof tutorial.ReqChessEx
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqChessEx.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.OldChessId != null && message.hasOwnProperty("OldChessId"))
if (!$util.isInteger(message.OldChessId))
return "OldChessId: integer expected";
if (message.NewChessId != null && message.hasOwnProperty("NewChessId"))
if (!$util.isInteger(message.NewChessId))
return "NewChessId: integer expected";
if (message.CostDia != null && message.hasOwnProperty("CostDia"))
if (!$util.isInteger(message.CostDia))
return "CostDia: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
return null;
};
/**
* Creates a ReqChessEx message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqChessEx
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqChessEx} ReqChessEx
*/
ReqChessEx.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqChessEx)
return object;
var message = new $root.tutorial.ReqChessEx();
if (object.OldChessId != null)
message.OldChessId = object.OldChessId | 0;
if (object.NewChessId != null)
message.NewChessId = object.NewChessId | 0;
if (object.CostDia != null)
message.CostDia = object.CostDia | 0;
if (object.Type != null)
message.Type = object.Type | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.ReqChessEx.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqChessEx message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqChessEx
* @static
* @param {tutorial.ReqChessEx} message ReqChessEx
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqChessEx.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults) {
object.OldChessId = 0;
object.NewChessId = 0;
object.CostDia = 0;
object.Type = 0;
}
if (message.OldChessId != null && message.hasOwnProperty("OldChessId"))
object.OldChessId = message.OldChessId;
if (message.NewChessId != null && message.hasOwnProperty("NewChessId"))
object.NewChessId = message.NewChessId;
if (message.CostDia != null && message.hasOwnProperty("CostDia"))
object.CostDia = message.CostDia;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
return object;
};
/**
* Converts this ReqChessEx to JSON.
* @function toJSON
* @memberof tutorial.ReqChessEx
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqChessEx.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqChessEx
* @function getTypeUrl
* @memberof tutorial.ReqChessEx
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqChessEx.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqChessEx";
};
return ReqChessEx;
})();
tutorial.ResChessEx = (function() {
/**
* Properties of a ResChessEx.
* @memberof tutorial
* @interface IResChessEx
* @property {tutorial.RES_CODE|null} [code] ResChessEx code
* @property {string|null} [msg] ResChessEx msg
*/
/**
* Constructs a new ResChessEx.
* @memberof tutorial
* @classdesc Represents a ResChessEx.
* @implements IResChessEx
* @constructor
* @param {tutorial.IResChessEx=} [properties] Properties to set
*/
function ResChessEx(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]];
}
/**
* ResChessEx code.
* @member {tutorial.RES_CODE} code
* @memberof tutorial.ResChessEx
* @instance
*/
ResChessEx.prototype.code = 0;
/**
* ResChessEx msg.
* @member {string} msg
* @memberof tutorial.ResChessEx
* @instance
*/
ResChessEx.prototype.msg = "";
/**
* Creates a new ResChessEx instance using the specified properties.
* @function create
* @memberof tutorial.ResChessEx
* @static
* @param {tutorial.IResChessEx=} [properties] Properties to set
* @returns {tutorial.ResChessEx} ResChessEx instance
*/
ResChessEx.create = function create(properties) {
return new ResChessEx(properties);
};
/**
* Encodes the specified ResChessEx message. Does not implicitly {@link tutorial.ResChessEx.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChessEx
* @static
* @param {tutorial.IResChessEx} message ResChessEx message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChessEx.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg);
return writer;
};
/**
* Encodes the specified ResChessEx message, length delimited. Does not implicitly {@link tutorial.ResChessEx.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChessEx
* @static
* @param {tutorial.IResChessEx} message ResChessEx message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChessEx.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChessEx message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChessEx
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChessEx} ResChessEx
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChessEx.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.ResChessEx();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.code = reader.int32();
break;
}
case 2: {
message.msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChessEx message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChessEx
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChessEx} ResChessEx
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChessEx.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChessEx message.
* @function verify
* @memberof tutorial.ResChessEx
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChessEx.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.code != null && message.hasOwnProperty("code"))
switch (message.code) {
default:
return "code: enum value expected";
case 0:
case 1:
break;
}
if (message.msg != null && message.hasOwnProperty("msg"))
if (!$util.isString(message.msg))
return "msg: string expected";
return null;
};
/**
* Creates a ResChessEx message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChessEx
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChessEx} ResChessEx
*/
ResChessEx.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChessEx)
return object;
var message = new $root.tutorial.ResChessEx();
switch (object.code) {
default:
if (typeof object.code === "number") {
message.code = object.code;
break;
}
break;
case "FAIL":
case 0:
message.code = 0;
break;
case "SUCCESS":
case 1:
message.code = 1;
break;
}
if (object.msg != null)
message.msg = String(object.msg);
return message;
};
/**
* Creates a plain object from a ResChessEx message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChessEx
* @static
* @param {tutorial.ResChessEx} message ResChessEx
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChessEx.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.code = options.enums === String ? "FAIL" : 0;
object.msg = "";
}
if (message.code != null && message.hasOwnProperty("code"))
object.code = options.enums === String ? $root.tutorial.RES_CODE[message.code] === undefined ? message.code : $root.tutorial.RES_CODE[message.code] : message.code;
if (message.msg != null && message.hasOwnProperty("msg"))
object.msg = message.msg;
return object;
};
/**
* Converts this ResChessEx to JSON.
* @function toJSON
* @memberof tutorial.ResChessEx
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChessEx.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChessEx
* @function getTypeUrl
* @memberof tutorial.ResChessEx
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChessEx.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChessEx";
};
return ResChessEx;
})();
tutorial.ReqPlayroomOutline = (function() {
/**
* Properties of a ReqPlayroomOutline.
* @memberof tutorial
* @interface IReqPlayroomOutline
* @property {number|null} [OldChessId] ReqPlayroomOutline OldChessId
* @property {number|null} [NewChessId] ReqPlayroomOutline NewChessId
* @property {number|null} [CostDia] ReqPlayroomOutline CostDia
* @property {number|null} [Type] ReqPlayroomOutline Type
* @property {Object.<string,number>|null} [mChessData] ReqPlayroomOutline mChessData
*/
/**
* Constructs a new ReqPlayroomOutline.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomOutline.
* @implements IReqPlayroomOutline
* @constructor
* @param {tutorial.IReqPlayroomOutline=} [properties] Properties to set
*/
function ReqPlayroomOutline(properties) {
this.mChessData = {};
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]];
}
/**
* ReqPlayroomOutline OldChessId.
* @member {number} OldChessId
* @memberof tutorial.ReqPlayroomOutline
* @instance
*/
ReqPlayroomOutline.prototype.OldChessId = 0;
/**
* ReqPlayroomOutline NewChessId.
* @member {number} NewChessId
* @memberof tutorial.ReqPlayroomOutline
* @instance
*/
ReqPlayroomOutline.prototype.NewChessId = 0;
/**
* ReqPlayroomOutline CostDia.
* @member {number} CostDia
* @memberof tutorial.ReqPlayroomOutline
* @instance
*/
ReqPlayroomOutline.prototype.CostDia = 0;
/**
* ReqPlayroomOutline Type.
* @member {number} Type
* @memberof tutorial.ReqPlayroomOutline
* @instance
*/
ReqPlayroomOutline.prototype.Type = 0;
/**
* ReqPlayroomOutline mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.ReqPlayroomOutline
* @instance
*/
ReqPlayroomOutline.prototype.mChessData = $util.emptyObject;
/**
* Creates a new ReqPlayroomOutline instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {tutorial.IReqPlayroomOutline=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomOutline} ReqPlayroomOutline instance
*/
ReqPlayroomOutline.create = function create(properties) {
return new ReqPlayroomOutline(properties);
};
/**
* Encodes the specified ReqPlayroomOutline message. Does not implicitly {@link tutorial.ReqPlayroomOutline.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {tutorial.IReqPlayroomOutline} message ReqPlayroomOutline message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomOutline.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.OldChessId != null && Object.hasOwnProperty.call(message, "OldChessId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.OldChessId);
if (message.NewChessId != null && Object.hasOwnProperty.call(message, "NewChessId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.NewChessId);
if (message.CostDia != null && Object.hasOwnProperty.call(message, "CostDia"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.CostDia);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Type);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqPlayroomOutline message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomOutline.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {tutorial.IReqPlayroomOutline} message ReqPlayroomOutline message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomOutline.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomOutline message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomOutline} ReqPlayroomOutline
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomOutline.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.ReqPlayroomOutline(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.OldChessId = reader.int32();
break;
}
case 2: {
message.NewChessId = reader.int32();
break;
}
case 3: {
message.CostDia = reader.int32();
break;
}
case 4: {
message.Type = reader.int32();
break;
}
case 5: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomOutline message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomOutline} ReqPlayroomOutline
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomOutline.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomOutline message.
* @function verify
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomOutline.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.OldChessId != null && message.hasOwnProperty("OldChessId"))
if (!$util.isInteger(message.OldChessId))
return "OldChessId: integer expected";
if (message.NewChessId != null && message.hasOwnProperty("NewChessId"))
if (!$util.isInteger(message.NewChessId))
return "NewChessId: integer expected";
if (message.CostDia != null && message.hasOwnProperty("CostDia"))
if (!$util.isInteger(message.CostDia))
return "CostDia: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
return null;
};
/**
* Creates a ReqPlayroomOutline message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomOutline} ReqPlayroomOutline
*/
ReqPlayroomOutline.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomOutline)
return object;
var message = new $root.tutorial.ReqPlayroomOutline();
if (object.OldChessId != null)
message.OldChessId = object.OldChessId | 0;
if (object.NewChessId != null)
message.NewChessId = object.NewChessId | 0;
if (object.CostDia != null)
message.CostDia = object.CostDia | 0;
if (object.Type != null)
message.Type = object.Type | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.ReqPlayroomOutline.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqPlayroomOutline message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {tutorial.ReqPlayroomOutline} message ReqPlayroomOutline
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomOutline.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults) {
object.OldChessId = 0;
object.NewChessId = 0;
object.CostDia = 0;
object.Type = 0;
}
if (message.OldChessId != null && message.hasOwnProperty("OldChessId"))
object.OldChessId = message.OldChessId;
if (message.NewChessId != null && message.hasOwnProperty("NewChessId"))
object.NewChessId = message.NewChessId;
if (message.CostDia != null && message.hasOwnProperty("CostDia"))
object.CostDia = message.CostDia;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
return object;
};
/**
* Converts this ReqPlayroomOutline to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomOutline
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomOutline.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomOutline
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomOutline
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomOutline.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomOutline";
};
return ReqPlayroomOutline;
})();
tutorial.ResPlayroomOutline = (function() {
/**
* Properties of a ResPlayroomOutline.
* @memberof tutorial
* @interface IResPlayroomOutline
* @property {tutorial.RES_CODE|null} [code] ResPlayroomOutline code
* @property {string|null} [msg] ResPlayroomOutline msg
*/
/**
* Constructs a new ResPlayroomOutline.
* @memberof tutorial
* @classdesc Represents a ResPlayroomOutline.
* @implements IResPlayroomOutline
* @constructor
* @param {tutorial.IResPlayroomOutline=} [properties] Properties to set
*/
function ResPlayroomOutline(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]];
}
/**
* ResPlayroomOutline code.
* @member {tutorial.RES_CODE} code
* @memberof tutorial.ResPlayroomOutline
* @instance
*/
ResPlayroomOutline.prototype.code = 0;
/**
* ResPlayroomOutline msg.
* @member {string} msg
* @memberof tutorial.ResPlayroomOutline
* @instance
*/
ResPlayroomOutline.prototype.msg = "";
/**
* Creates a new ResPlayroomOutline instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {tutorial.IResPlayroomOutline=} [properties] Properties to set
* @returns {tutorial.ResPlayroomOutline} ResPlayroomOutline instance
*/
ResPlayroomOutline.create = function create(properties) {
return new ResPlayroomOutline(properties);
};
/**
* Encodes the specified ResPlayroomOutline message. Does not implicitly {@link tutorial.ResPlayroomOutline.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {tutorial.IResPlayroomOutline} message ResPlayroomOutline message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomOutline.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg);
return writer;
};
/**
* Encodes the specified ResPlayroomOutline message, length delimited. Does not implicitly {@link tutorial.ResPlayroomOutline.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {tutorial.IResPlayroomOutline} message ResPlayroomOutline message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomOutline.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomOutline message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomOutline} ResPlayroomOutline
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomOutline.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.ResPlayroomOutline();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.code = reader.int32();
break;
}
case 2: {
message.msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomOutline message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomOutline} ResPlayroomOutline
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomOutline.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomOutline message.
* @function verify
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomOutline.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.code != null && message.hasOwnProperty("code"))
switch (message.code) {
default:
return "code: enum value expected";
case 0:
case 1:
break;
}
if (message.msg != null && message.hasOwnProperty("msg"))
if (!$util.isString(message.msg))
return "msg: string expected";
return null;
};
/**
* Creates a ResPlayroomOutline message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomOutline} ResPlayroomOutline
*/
ResPlayroomOutline.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomOutline)
return object;
var message = new $root.tutorial.ResPlayroomOutline();
switch (object.code) {
default:
if (typeof object.code === "number") {
message.code = object.code;
break;
}
break;
case "FAIL":
case 0:
message.code = 0;
break;
case "SUCCESS":
case 1:
message.code = 1;
break;
}
if (object.msg != null)
message.msg = String(object.msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomOutline message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {tutorial.ResPlayroomOutline} message ResPlayroomOutline
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomOutline.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.code = options.enums === String ? "FAIL" : 0;
object.msg = "";
}
if (message.code != null && message.hasOwnProperty("code"))
object.code = options.enums === String ? $root.tutorial.RES_CODE[message.code] === undefined ? message.code : $root.tutorial.RES_CODE[message.code] : message.code;
if (message.msg != null && message.hasOwnProperty("msg"))
object.msg = message.msg;
return object;
};
/**
* Converts this ResPlayroomOutline to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomOutline
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomOutline.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomOutline
* @function getTypeUrl
* @memberof tutorial.ResPlayroomOutline
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomOutline.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomOutline";
};
return ResPlayroomOutline;
})();
tutorial.ChessBag = (function() {
/**
* Properties of a ChessBag.
* @memberof tutorial
* @interface IChessBag
* @property {Array.<tutorial.IChessBagGrid>|null} [ChessBagGrids] ChessBag ChessBagGrids
* @property {number|null} [ChessBuyCnt] ChessBag ChessBuyCnt
* @property {number|null} [ChessFreeCnt] ChessBag ChessFreeCnt
*/
/**
* Constructs a new ChessBag.
* @memberof tutorial
* @classdesc Represents a ChessBag.
* @implements IChessBag
* @constructor
* @param {tutorial.IChessBag=} [properties] Properties to set
*/
function ChessBag(properties) {
this.ChessBagGrids = [];
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]];
}
/**
* ChessBag ChessBagGrids.
* @member {Array.<tutorial.IChessBagGrid>} ChessBagGrids
* @memberof tutorial.ChessBag
* @instance
*/
ChessBag.prototype.ChessBagGrids = $util.emptyArray;
/**
* ChessBag ChessBuyCnt.
* @member {number} ChessBuyCnt
* @memberof tutorial.ChessBag
* @instance
*/
ChessBag.prototype.ChessBuyCnt = 0;
/**
* ChessBag ChessFreeCnt.
* @member {number} ChessFreeCnt
* @memberof tutorial.ChessBag
* @instance
*/
ChessBag.prototype.ChessFreeCnt = 0;
/**
* Creates a new ChessBag instance using the specified properties.
* @function create
* @memberof tutorial.ChessBag
* @static
* @param {tutorial.IChessBag=} [properties] Properties to set
* @returns {tutorial.ChessBag} ChessBag instance
*/
ChessBag.create = function create(properties) {
return new ChessBag(properties);
};
/**
* Encodes the specified ChessBag message. Does not implicitly {@link tutorial.ChessBag.verify|verify} messages.
* @function encode
* @memberof tutorial.ChessBag
* @static
* @param {tutorial.IChessBag} message ChessBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChessBag.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ChessBagGrids != null && message.ChessBagGrids.length)
for (var i = 0; i < message.ChessBagGrids.length; ++i)
$root.tutorial.ChessBagGrid.encode(message.ChessBagGrids[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.ChessBuyCnt != null && Object.hasOwnProperty.call(message, "ChessBuyCnt"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ChessBuyCnt);
if (message.ChessFreeCnt != null && Object.hasOwnProperty.call(message, "ChessFreeCnt"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ChessFreeCnt);
return writer;
};
/**
* Encodes the specified ChessBag message, length delimited. Does not implicitly {@link tutorial.ChessBag.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ChessBag
* @static
* @param {tutorial.IChessBag} message ChessBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChessBag.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ChessBag message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ChessBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ChessBag} ChessBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChessBag.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.ChessBag();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.ChessBagGrids && message.ChessBagGrids.length))
message.ChessBagGrids = [];
message.ChessBagGrids.push($root.tutorial.ChessBagGrid.decode(reader, reader.uint32()));
break;
}
case 2: {
message.ChessBuyCnt = reader.int32();
break;
}
case 3: {
message.ChessFreeCnt = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ChessBag message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ChessBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ChessBag} ChessBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChessBag.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ChessBag message.
* @function verify
* @memberof tutorial.ChessBag
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ChessBag.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ChessBagGrids != null && message.hasOwnProperty("ChessBagGrids")) {
if (!Array.isArray(message.ChessBagGrids))
return "ChessBagGrids: array expected";
for (var i = 0; i < message.ChessBagGrids.length; ++i) {
var error = $root.tutorial.ChessBagGrid.verify(message.ChessBagGrids[i]);
if (error)
return "ChessBagGrids." + error;
}
}
if (message.ChessBuyCnt != null && message.hasOwnProperty("ChessBuyCnt"))
if (!$util.isInteger(message.ChessBuyCnt))
return "ChessBuyCnt: integer expected";
if (message.ChessFreeCnt != null && message.hasOwnProperty("ChessFreeCnt"))
if (!$util.isInteger(message.ChessFreeCnt))
return "ChessFreeCnt: integer expected";
return null;
};
/**
* Creates a ChessBag message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ChessBag
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ChessBag} ChessBag
*/
ChessBag.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ChessBag)
return object;
var message = new $root.tutorial.ChessBag();
if (object.ChessBagGrids) {
if (!Array.isArray(object.ChessBagGrids))
throw TypeError(".tutorial.ChessBag.ChessBagGrids: array expected");
message.ChessBagGrids = [];
for (var i = 0; i < object.ChessBagGrids.length; ++i) {
if (typeof object.ChessBagGrids[i] !== "object")
throw TypeError(".tutorial.ChessBag.ChessBagGrids: object expected");
message.ChessBagGrids[i] = $root.tutorial.ChessBagGrid.fromObject(object.ChessBagGrids[i]);
}
}
if (object.ChessBuyCnt != null)
message.ChessBuyCnt = object.ChessBuyCnt | 0;
if (object.ChessFreeCnt != null)
message.ChessFreeCnt = object.ChessFreeCnt | 0;
return message;
};
/**
* Creates a plain object from a ChessBag message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ChessBag
* @static
* @param {tutorial.ChessBag} message ChessBag
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ChessBag.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.ChessBagGrids = [];
if (options.defaults) {
object.ChessBuyCnt = 0;
object.ChessFreeCnt = 0;
}
if (message.ChessBagGrids && message.ChessBagGrids.length) {
object.ChessBagGrids = [];
for (var j = 0; j < message.ChessBagGrids.length; ++j)
object.ChessBagGrids[j] = $root.tutorial.ChessBagGrid.toObject(message.ChessBagGrids[j], options);
}
if (message.ChessBuyCnt != null && message.hasOwnProperty("ChessBuyCnt"))
object.ChessBuyCnt = message.ChessBuyCnt;
if (message.ChessFreeCnt != null && message.hasOwnProperty("ChessFreeCnt"))
object.ChessFreeCnt = message.ChessFreeCnt;
return object;
};
/**
* Converts this ChessBag to JSON.
* @function toJSON
* @memberof tutorial.ChessBag
* @instance
* @returns {Object.<string,*>} JSON object
*/
ChessBag.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ChessBag
* @function getTypeUrl
* @memberof tutorial.ChessBag
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ChessBag.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ChessBag";
};
return ChessBag;
})();
tutorial.ChessBagGrid = (function() {
/**
* Properties of a ChessBagGrid.
* @memberof tutorial
* @interface IChessBagGrid
* @property {number|null} [Id] ChessBagGrid Id
* @property {number|null} [ChessId] ChessBagGrid ChessId
* @property {number|null} [EmitId] ChessBagGrid EmitId
*/
/**
* Constructs a new ChessBagGrid.
* @memberof tutorial
* @classdesc Represents a ChessBagGrid.
* @implements IChessBagGrid
* @constructor
* @param {tutorial.IChessBagGrid=} [properties] Properties to set
*/
function ChessBagGrid(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]];
}
/**
* ChessBagGrid Id.
* @member {number} Id
* @memberof tutorial.ChessBagGrid
* @instance
*/
ChessBagGrid.prototype.Id = 0;
/**
* ChessBagGrid ChessId.
* @member {number} ChessId
* @memberof tutorial.ChessBagGrid
* @instance
*/
ChessBagGrid.prototype.ChessId = 0;
/**
* ChessBagGrid EmitId.
* @member {number} EmitId
* @memberof tutorial.ChessBagGrid
* @instance
*/
ChessBagGrid.prototype.EmitId = 0;
/**
* Creates a new ChessBagGrid instance using the specified properties.
* @function create
* @memberof tutorial.ChessBagGrid
* @static
* @param {tutorial.IChessBagGrid=} [properties] Properties to set
* @returns {tutorial.ChessBagGrid} ChessBagGrid instance
*/
ChessBagGrid.create = function create(properties) {
return new ChessBagGrid(properties);
};
/**
* Encodes the specified ChessBagGrid message. Does not implicitly {@link tutorial.ChessBagGrid.verify|verify} messages.
* @function encode
* @memberof tutorial.ChessBagGrid
* @static
* @param {tutorial.IChessBagGrid} message ChessBagGrid message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChessBagGrid.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.ChessId != null && Object.hasOwnProperty.call(message, "ChessId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ChessId);
if (message.EmitId != null && Object.hasOwnProperty.call(message, "EmitId"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.EmitId);
return writer;
};
/**
* Encodes the specified ChessBagGrid message, length delimited. Does not implicitly {@link tutorial.ChessBagGrid.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ChessBagGrid
* @static
* @param {tutorial.IChessBagGrid} message ChessBagGrid message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChessBagGrid.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ChessBagGrid message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ChessBagGrid
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ChessBagGrid} ChessBagGrid
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChessBagGrid.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.ChessBagGrid();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.ChessId = reader.int32();
break;
}
case 3: {
message.EmitId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ChessBagGrid message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ChessBagGrid
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ChessBagGrid} ChessBagGrid
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChessBagGrid.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ChessBagGrid message.
* @function verify
* @memberof tutorial.ChessBagGrid
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ChessBagGrid.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))
return "Id: integer expected";
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
if (!$util.isInteger(message.ChessId))
return "ChessId: integer expected";
if (message.EmitId != null && message.hasOwnProperty("EmitId"))
if (!$util.isInteger(message.EmitId))
return "EmitId: integer expected";
return null;
};
/**
* Creates a ChessBagGrid message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ChessBagGrid
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ChessBagGrid} ChessBagGrid
*/
ChessBagGrid.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ChessBagGrid)
return object;
var message = new $root.tutorial.ChessBagGrid();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.ChessId != null)
message.ChessId = object.ChessId | 0;
if (object.EmitId != null)
message.EmitId = object.EmitId | 0;
return message;
};
/**
* Creates a plain object from a ChessBagGrid message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ChessBagGrid
* @static
* @param {tutorial.ChessBagGrid} message ChessBagGrid
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ChessBagGrid.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.ChessId = 0;
object.EmitId = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
object.ChessId = message.ChessId;
if (message.EmitId != null && message.hasOwnProperty("EmitId"))
object.EmitId = message.EmitId;
return object;
};
/**
* Converts this ChessBagGrid to JSON.
* @function toJSON
* @memberof tutorial.ChessBagGrid
* @instance
* @returns {Object.<string,*>} JSON object
*/
ChessBagGrid.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ChessBagGrid
* @function getTypeUrl
* @memberof tutorial.ChessBagGrid
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ChessBagGrid.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ChessBagGrid";
};
return ChessBagGrid;
})();
tutorial.ReqPutChessInBag = (function() {
/**
* Properties of a ReqPutChessInBag.
* @memberof tutorial
* @interface IReqPutChessInBag
* @property {number|null} [ChessId] ReqPutChessInBag ChessId
* @property {number|null} [BagId] ReqPutChessInBag BagId
* @property {number|null} [EmitId] ReqPutChessInBag EmitId
* @property {Object.<string,number>|null} [mChessData] ReqPutChessInBag mChessData
*/
/**
* Constructs a new ReqPutChessInBag.
* @memberof tutorial
* @classdesc Represents a ReqPutChessInBag.
* @implements IReqPutChessInBag
* @constructor
* @param {tutorial.IReqPutChessInBag=} [properties] Properties to set
*/
function ReqPutChessInBag(properties) {
this.mChessData = {};
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]];
}
/**
* ReqPutChessInBag ChessId.
* @member {number} ChessId
* @memberof tutorial.ReqPutChessInBag
* @instance
*/
ReqPutChessInBag.prototype.ChessId = 0;
/**
* ReqPutChessInBag BagId.
* @member {number} BagId
* @memberof tutorial.ReqPutChessInBag
* @instance
*/
ReqPutChessInBag.prototype.BagId = 0;
/**
* ReqPutChessInBag EmitId.
* @member {number} EmitId
* @memberof tutorial.ReqPutChessInBag
* @instance
*/
ReqPutChessInBag.prototype.EmitId = 0;
/**
* ReqPutChessInBag mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.ReqPutChessInBag
* @instance
*/
ReqPutChessInBag.prototype.mChessData = $util.emptyObject;
/**
* Creates a new ReqPutChessInBag instance using the specified properties.
* @function create
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {tutorial.IReqPutChessInBag=} [properties] Properties to set
* @returns {tutorial.ReqPutChessInBag} ReqPutChessInBag instance
*/
ReqPutChessInBag.create = function create(properties) {
return new ReqPutChessInBag(properties);
};
/**
* Encodes the specified ReqPutChessInBag message. Does not implicitly {@link tutorial.ReqPutChessInBag.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {tutorial.IReqPutChessInBag} message ReqPutChessInBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPutChessInBag.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ChessId != null && Object.hasOwnProperty.call(message, "ChessId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ChessId);
if (message.BagId != null && Object.hasOwnProperty.call(message, "BagId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.BagId);
if (message.EmitId != null && Object.hasOwnProperty.call(message, "EmitId"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.EmitId);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqPutChessInBag message, length delimited. Does not implicitly {@link tutorial.ReqPutChessInBag.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {tutorial.IReqPutChessInBag} message ReqPutChessInBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPutChessInBag.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPutChessInBag message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPutChessInBag} ReqPutChessInBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPutChessInBag.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.ReqPutChessInBag(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ChessId = reader.int32();
break;
}
case 2: {
message.BagId = reader.int32();
break;
}
case 3: {
message.EmitId = reader.int32();
break;
}
case 4: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPutChessInBag message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPutChessInBag} ReqPutChessInBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPutChessInBag.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPutChessInBag message.
* @function verify
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPutChessInBag.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
if (!$util.isInteger(message.ChessId))
return "ChessId: integer expected";
if (message.BagId != null && message.hasOwnProperty("BagId"))
if (!$util.isInteger(message.BagId))
return "BagId: integer expected";
if (message.EmitId != null && message.hasOwnProperty("EmitId"))
if (!$util.isInteger(message.EmitId))
return "EmitId: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
return null;
};
/**
* Creates a ReqPutChessInBag message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPutChessInBag} ReqPutChessInBag
*/
ReqPutChessInBag.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPutChessInBag)
return object;
var message = new $root.tutorial.ReqPutChessInBag();
if (object.ChessId != null)
message.ChessId = object.ChessId | 0;
if (object.BagId != null)
message.BagId = object.BagId | 0;
if (object.EmitId != null)
message.EmitId = object.EmitId | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.ReqPutChessInBag.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqPutChessInBag message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {tutorial.ReqPutChessInBag} message ReqPutChessInBag
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPutChessInBag.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults) {
object.ChessId = 0;
object.BagId = 0;
object.EmitId = 0;
}
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
object.ChessId = message.ChessId;
if (message.BagId != null && message.hasOwnProperty("BagId"))
object.BagId = message.BagId;
if (message.EmitId != null && message.hasOwnProperty("EmitId"))
object.EmitId = message.EmitId;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
return object;
};
/**
* Converts this ReqPutChessInBag to JSON.
* @function toJSON
* @memberof tutorial.ReqPutChessInBag
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPutChessInBag.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPutChessInBag
* @function getTypeUrl
* @memberof tutorial.ReqPutChessInBag
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPutChessInBag.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPutChessInBag";
};
return ReqPutChessInBag;
})();
tutorial.ResPutChessInBag = (function() {
/**
* Properties of a ResPutChessInBag.
* @memberof tutorial
* @interface IResPutChessInBag
* @property {tutorial.RES_CODE|null} [code] ResPutChessInBag code
* @property {string|null} [msg] ResPutChessInBag msg
*/
/**
* Constructs a new ResPutChessInBag.
* @memberof tutorial
* @classdesc Represents a ResPutChessInBag.
* @implements IResPutChessInBag
* @constructor
* @param {tutorial.IResPutChessInBag=} [properties] Properties to set
*/
function ResPutChessInBag(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]];
}
/**
* ResPutChessInBag code.
* @member {tutorial.RES_CODE} code
* @memberof tutorial.ResPutChessInBag
* @instance
*/
ResPutChessInBag.prototype.code = 0;
/**
* ResPutChessInBag msg.
* @member {string} msg
* @memberof tutorial.ResPutChessInBag
* @instance
*/
ResPutChessInBag.prototype.msg = "";
/**
* Creates a new ResPutChessInBag instance using the specified properties.
* @function create
* @memberof tutorial.ResPutChessInBag
* @static
* @param {tutorial.IResPutChessInBag=} [properties] Properties to set
* @returns {tutorial.ResPutChessInBag} ResPutChessInBag instance
*/
ResPutChessInBag.create = function create(properties) {
return new ResPutChessInBag(properties);
};
/**
* Encodes the specified ResPutChessInBag message. Does not implicitly {@link tutorial.ResPutChessInBag.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPutChessInBag
* @static
* @param {tutorial.IResPutChessInBag} message ResPutChessInBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPutChessInBag.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg);
return writer;
};
/**
* Encodes the specified ResPutChessInBag message, length delimited. Does not implicitly {@link tutorial.ResPutChessInBag.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPutChessInBag
* @static
* @param {tutorial.IResPutChessInBag} message ResPutChessInBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPutChessInBag.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPutChessInBag message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPutChessInBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPutChessInBag} ResPutChessInBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPutChessInBag.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.ResPutChessInBag();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.code = reader.int32();
break;
}
case 2: {
message.msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPutChessInBag message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPutChessInBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPutChessInBag} ResPutChessInBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPutChessInBag.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPutChessInBag message.
* @function verify
* @memberof tutorial.ResPutChessInBag
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPutChessInBag.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.code != null && message.hasOwnProperty("code"))
switch (message.code) {
default:
return "code: enum value expected";
case 0:
case 1:
break;
}
if (message.msg != null && message.hasOwnProperty("msg"))
if (!$util.isString(message.msg))
return "msg: string expected";
return null;
};
/**
* Creates a ResPutChessInBag message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPutChessInBag
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPutChessInBag} ResPutChessInBag
*/
ResPutChessInBag.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPutChessInBag)
return object;
var message = new $root.tutorial.ResPutChessInBag();
switch (object.code) {
default:
if (typeof object.code === "number") {
message.code = object.code;
break;
}
break;
case "FAIL":
case 0:
message.code = 0;
break;
case "SUCCESS":
case 1:
message.code = 1;
break;
}
if (object.msg != null)
message.msg = String(object.msg);
return message;
};
/**
* Creates a plain object from a ResPutChessInBag message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPutChessInBag
* @static
* @param {tutorial.ResPutChessInBag} message ResPutChessInBag
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPutChessInBag.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.code = options.enums === String ? "FAIL" : 0;
object.msg = "";
}
if (message.code != null && message.hasOwnProperty("code"))
object.code = options.enums === String ? $root.tutorial.RES_CODE[message.code] === undefined ? message.code : $root.tutorial.RES_CODE[message.code] : message.code;
if (message.msg != null && message.hasOwnProperty("msg"))
object.msg = message.msg;
return object;
};
/**
* Converts this ResPutChessInBag to JSON.
* @function toJSON
* @memberof tutorial.ResPutChessInBag
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPutChessInBag.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPutChessInBag
* @function getTypeUrl
* @memberof tutorial.ResPutChessInBag
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPutChessInBag.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPutChessInBag";
};
return ResPutChessInBag;
})();
tutorial.ReqTakeChessOutBag = (function() {
/**
* Properties of a ReqTakeChessOutBag.
* @memberof tutorial
* @interface IReqTakeChessOutBag
* @property {number|null} [BagId] ReqTakeChessOutBag BagId
* @property {Object.<string,number>|null} [mChessData] ReqTakeChessOutBag mChessData
*/
/**
* Constructs a new ReqTakeChessOutBag.
* @memberof tutorial
* @classdesc Represents a ReqTakeChessOutBag.
* @implements IReqTakeChessOutBag
* @constructor
* @param {tutorial.IReqTakeChessOutBag=} [properties] Properties to set
*/
function ReqTakeChessOutBag(properties) {
this.mChessData = {};
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]];
}
/**
* ReqTakeChessOutBag BagId.
* @member {number} BagId
* @memberof tutorial.ReqTakeChessOutBag
* @instance
*/
ReqTakeChessOutBag.prototype.BagId = 0;
/**
* ReqTakeChessOutBag mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.ReqTakeChessOutBag
* @instance
*/
ReqTakeChessOutBag.prototype.mChessData = $util.emptyObject;
/**
* Creates a new ReqTakeChessOutBag instance using the specified properties.
* @function create
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {tutorial.IReqTakeChessOutBag=} [properties] Properties to set
* @returns {tutorial.ReqTakeChessOutBag} ReqTakeChessOutBag instance
*/
ReqTakeChessOutBag.create = function create(properties) {
return new ReqTakeChessOutBag(properties);
};
/**
* Encodes the specified ReqTakeChessOutBag message. Does not implicitly {@link tutorial.ReqTakeChessOutBag.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {tutorial.IReqTakeChessOutBag} message ReqTakeChessOutBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqTakeChessOutBag.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.BagId != null && Object.hasOwnProperty.call(message, "BagId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.BagId);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqTakeChessOutBag message, length delimited. Does not implicitly {@link tutorial.ReqTakeChessOutBag.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {tutorial.IReqTakeChessOutBag} message ReqTakeChessOutBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqTakeChessOutBag.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqTakeChessOutBag message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqTakeChessOutBag} ReqTakeChessOutBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqTakeChessOutBag.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.ReqTakeChessOutBag(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.BagId = reader.int32();
break;
}
case 2: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqTakeChessOutBag message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqTakeChessOutBag} ReqTakeChessOutBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqTakeChessOutBag.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqTakeChessOutBag message.
* @function verify
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqTakeChessOutBag.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.BagId != null && message.hasOwnProperty("BagId"))
if (!$util.isInteger(message.BagId))
return "BagId: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
return null;
};
/**
* Creates a ReqTakeChessOutBag message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqTakeChessOutBag} ReqTakeChessOutBag
*/
ReqTakeChessOutBag.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqTakeChessOutBag)
return object;
var message = new $root.tutorial.ReqTakeChessOutBag();
if (object.BagId != null)
message.BagId = object.BagId | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.ReqTakeChessOutBag.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqTakeChessOutBag message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {tutorial.ReqTakeChessOutBag} message ReqTakeChessOutBag
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqTakeChessOutBag.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults)
object.BagId = 0;
if (message.BagId != null && message.hasOwnProperty("BagId"))
object.BagId = message.BagId;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
return object;
};
/**
* Converts this ReqTakeChessOutBag to JSON.
* @function toJSON
* @memberof tutorial.ReqTakeChessOutBag
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqTakeChessOutBag.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqTakeChessOutBag
* @function getTypeUrl
* @memberof tutorial.ReqTakeChessOutBag
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqTakeChessOutBag.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqTakeChessOutBag";
};
return ReqTakeChessOutBag;
})();
tutorial.ResTakeChessOutBag = (function() {
/**
* Properties of a ResTakeChessOutBag.
* @memberof tutorial
* @interface IResTakeChessOutBag
* @property {tutorial.RES_CODE|null} [code] ResTakeChessOutBag code
* @property {string|null} [msg] ResTakeChessOutBag msg
*/
/**
* Constructs a new ResTakeChessOutBag.
* @memberof tutorial
* @classdesc Represents a ResTakeChessOutBag.
* @implements IResTakeChessOutBag
* @constructor
* @param {tutorial.IResTakeChessOutBag=} [properties] Properties to set
*/
function ResTakeChessOutBag(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]];
}
/**
* ResTakeChessOutBag code.
* @member {tutorial.RES_CODE} code
* @memberof tutorial.ResTakeChessOutBag
* @instance
*/
ResTakeChessOutBag.prototype.code = 0;
/**
* ResTakeChessOutBag msg.
* @member {string} msg
* @memberof tutorial.ResTakeChessOutBag
* @instance
*/
ResTakeChessOutBag.prototype.msg = "";
/**
* Creates a new ResTakeChessOutBag instance using the specified properties.
* @function create
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {tutorial.IResTakeChessOutBag=} [properties] Properties to set
* @returns {tutorial.ResTakeChessOutBag} ResTakeChessOutBag instance
*/
ResTakeChessOutBag.create = function create(properties) {
return new ResTakeChessOutBag(properties);
};
/**
* Encodes the specified ResTakeChessOutBag message. Does not implicitly {@link tutorial.ResTakeChessOutBag.verify|verify} messages.
* @function encode
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {tutorial.IResTakeChessOutBag} message ResTakeChessOutBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResTakeChessOutBag.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg);
return writer;
};
/**
* Encodes the specified ResTakeChessOutBag message, length delimited. Does not implicitly {@link tutorial.ResTakeChessOutBag.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {tutorial.IResTakeChessOutBag} message ResTakeChessOutBag message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResTakeChessOutBag.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResTakeChessOutBag message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResTakeChessOutBag} ResTakeChessOutBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResTakeChessOutBag.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.ResTakeChessOutBag();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.code = reader.int32();
break;
}
case 2: {
message.msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResTakeChessOutBag message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResTakeChessOutBag} ResTakeChessOutBag
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResTakeChessOutBag.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResTakeChessOutBag message.
* @function verify
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResTakeChessOutBag.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.code != null && message.hasOwnProperty("code"))
switch (message.code) {
default:
return "code: enum value expected";
case 0:
case 1:
break;
}
if (message.msg != null && message.hasOwnProperty("msg"))
if (!$util.isString(message.msg))
return "msg: string expected";
return null;
};
/**
* Creates a ResTakeChessOutBag message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResTakeChessOutBag} ResTakeChessOutBag
*/
ResTakeChessOutBag.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResTakeChessOutBag)
return object;
var message = new $root.tutorial.ResTakeChessOutBag();
switch (object.code) {
default:
if (typeof object.code === "number") {
message.code = object.code;
break;
}
break;
case "FAIL":
case 0:
message.code = 0;
break;
case "SUCCESS":
case 1:
message.code = 1;
break;
}
if (object.msg != null)
message.msg = String(object.msg);
return message;
};
/**
* Creates a plain object from a ResTakeChessOutBag message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {tutorial.ResTakeChessOutBag} message ResTakeChessOutBag
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResTakeChessOutBag.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.code = options.enums === String ? "FAIL" : 0;
object.msg = "";
}
if (message.code != null && message.hasOwnProperty("code"))
object.code = options.enums === String ? $root.tutorial.RES_CODE[message.code] === undefined ? message.code : $root.tutorial.RES_CODE[message.code] : message.code;
if (message.msg != null && message.hasOwnProperty("msg"))
object.msg = message.msg;
return object;
};
/**
* Converts this ResTakeChessOutBag to JSON.
* @function toJSON
* @memberof tutorial.ResTakeChessOutBag
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResTakeChessOutBag.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResTakeChessOutBag
* @function getTypeUrl
* @memberof tutorial.ResTakeChessOutBag
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResTakeChessOutBag.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResTakeChessOutBag";
};
return ResTakeChessOutBag;
})();
tutorial.ReqBuyChessBagGrid = (function() {
/**
* Properties of a ReqBuyChessBagGrid.
* @memberof tutorial
* @interface IReqBuyChessBagGrid
*/
/**
* Constructs a new ReqBuyChessBagGrid.
* @memberof tutorial
* @classdesc Represents a ReqBuyChessBagGrid.
* @implements IReqBuyChessBagGrid
* @constructor
* @param {tutorial.IReqBuyChessBagGrid=} [properties] Properties to set
*/
function ReqBuyChessBagGrid(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]];
}
/**
* Creates a new ReqBuyChessBagGrid instance using the specified properties.
* @function create
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {tutorial.IReqBuyChessBagGrid=} [properties] Properties to set
* @returns {tutorial.ReqBuyChessBagGrid} ReqBuyChessBagGrid instance
*/
ReqBuyChessBagGrid.create = function create(properties) {
return new ReqBuyChessBagGrid(properties);
};
/**
* Encodes the specified ReqBuyChessBagGrid message. Does not implicitly {@link tutorial.ReqBuyChessBagGrid.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {tutorial.IReqBuyChessBagGrid} message ReqBuyChessBagGrid message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBuyChessBagGrid.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqBuyChessBagGrid message, length delimited. Does not implicitly {@link tutorial.ReqBuyChessBagGrid.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {tutorial.IReqBuyChessBagGrid} message ReqBuyChessBagGrid message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBuyChessBagGrid.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqBuyChessBagGrid message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqBuyChessBagGrid} ReqBuyChessBagGrid
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBuyChessBagGrid.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.ReqBuyChessBagGrid();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqBuyChessBagGrid message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqBuyChessBagGrid} ReqBuyChessBagGrid
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBuyChessBagGrid.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqBuyChessBagGrid message.
* @function verify
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqBuyChessBagGrid.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqBuyChessBagGrid message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqBuyChessBagGrid} ReqBuyChessBagGrid
*/
ReqBuyChessBagGrid.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqBuyChessBagGrid)
return object;
return new $root.tutorial.ReqBuyChessBagGrid();
};
/**
* Creates a plain object from a ReqBuyChessBagGrid message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {tutorial.ReqBuyChessBagGrid} message ReqBuyChessBagGrid
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqBuyChessBagGrid.toObject = function toObject() {
return {};
};
/**
* Converts this ReqBuyChessBagGrid to JSON.
* @function toJSON
* @memberof tutorial.ReqBuyChessBagGrid
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqBuyChessBagGrid.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqBuyChessBagGrid
* @function getTypeUrl
* @memberof tutorial.ReqBuyChessBagGrid
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqBuyChessBagGrid.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqBuyChessBagGrid";
};
return ReqBuyChessBagGrid;
})();
tutorial.ResBuyChessBagGrid = (function() {
/**
* Properties of a ResBuyChessBagGrid.
* @memberof tutorial
* @interface IResBuyChessBagGrid
* @property {tutorial.RES_CODE|null} [code] ResBuyChessBagGrid code
* @property {string|null} [msg] ResBuyChessBagGrid msg
*/
/**
* Constructs a new ResBuyChessBagGrid.
* @memberof tutorial
* @classdesc Represents a ResBuyChessBagGrid.
* @implements IResBuyChessBagGrid
* @constructor
* @param {tutorial.IResBuyChessBagGrid=} [properties] Properties to set
*/
function ResBuyChessBagGrid(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]];
}
/**
* ResBuyChessBagGrid code.
* @member {tutorial.RES_CODE} code
* @memberof tutorial.ResBuyChessBagGrid
* @instance
*/
ResBuyChessBagGrid.prototype.code = 0;
/**
* ResBuyChessBagGrid msg.
* @member {string} msg
* @memberof tutorial.ResBuyChessBagGrid
* @instance
*/
ResBuyChessBagGrid.prototype.msg = "";
/**
* Creates a new ResBuyChessBagGrid instance using the specified properties.
* @function create
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {tutorial.IResBuyChessBagGrid=} [properties] Properties to set
* @returns {tutorial.ResBuyChessBagGrid} ResBuyChessBagGrid instance
*/
ResBuyChessBagGrid.create = function create(properties) {
return new ResBuyChessBagGrid(properties);
};
/**
* Encodes the specified ResBuyChessBagGrid message. Does not implicitly {@link tutorial.ResBuyChessBagGrid.verify|verify} messages.
* @function encode
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {tutorial.IResBuyChessBagGrid} message ResBuyChessBagGrid message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBuyChessBagGrid.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg);
return writer;
};
/**
* Encodes the specified ResBuyChessBagGrid message, length delimited. Does not implicitly {@link tutorial.ResBuyChessBagGrid.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {tutorial.IResBuyChessBagGrid} message ResBuyChessBagGrid message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBuyChessBagGrid.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResBuyChessBagGrid message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResBuyChessBagGrid} ResBuyChessBagGrid
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBuyChessBagGrid.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.ResBuyChessBagGrid();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.code = reader.int32();
break;
}
case 2: {
message.msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResBuyChessBagGrid message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResBuyChessBagGrid} ResBuyChessBagGrid
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBuyChessBagGrid.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResBuyChessBagGrid message.
* @function verify
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResBuyChessBagGrid.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.code != null && message.hasOwnProperty("code"))
switch (message.code) {
default:
return "code: enum value expected";
case 0:
case 1:
break;
}
if (message.msg != null && message.hasOwnProperty("msg"))
if (!$util.isString(message.msg))
return "msg: string expected";
return null;
};
/**
* Creates a ResBuyChessBagGrid message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResBuyChessBagGrid} ResBuyChessBagGrid
*/
ResBuyChessBagGrid.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResBuyChessBagGrid)
return object;
var message = new $root.tutorial.ResBuyChessBagGrid();
switch (object.code) {
default:
if (typeof object.code === "number") {
message.code = object.code;
break;
}
break;
case "FAIL":
case 0:
message.code = 0;
break;
case "SUCCESS":
case 1:
message.code = 1;
break;
}
if (object.msg != null)
message.msg = String(object.msg);
return message;
};
/**
* Creates a plain object from a ResBuyChessBagGrid message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {tutorial.ResBuyChessBagGrid} message ResBuyChessBagGrid
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResBuyChessBagGrid.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.code = options.enums === String ? "FAIL" : 0;
object.msg = "";
}
if (message.code != null && message.hasOwnProperty("code"))
object.code = options.enums === String ? $root.tutorial.RES_CODE[message.code] === undefined ? message.code : $root.tutorial.RES_CODE[message.code] : message.code;
if (message.msg != null && message.hasOwnProperty("msg"))
object.msg = message.msg;
return object;
};
/**
* Converts this ResBuyChessBagGrid to JSON.
* @function toJSON
* @memberof tutorial.ResBuyChessBagGrid
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResBuyChessBagGrid.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResBuyChessBagGrid
* @function getTypeUrl
* @memberof tutorial.ResBuyChessBagGrid
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResBuyChessBagGrid.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResBuyChessBagGrid";
};
return ResBuyChessBagGrid;
})();
tutorial.ReqPlayerProfileData = (function() {
/**
* Properties of a ReqPlayerProfileData.
* @memberof tutorial
* @interface IReqPlayerProfileData
* @property {number|null} [dwUin] ReqPlayerProfileData dwUin
*/
/**
* Constructs a new ReqPlayerProfileData.
* @memberof tutorial
* @classdesc 请求玩家身份信息
* @implements IReqPlayerProfileData
* @constructor
* @param {tutorial.IReqPlayerProfileData=} [properties] Properties to set
*/
function ReqPlayerProfileData(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]];
}
/**
* ReqPlayerProfileData dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqPlayerProfileData
* @instance
*/
ReqPlayerProfileData.prototype.dwUin = 0;
/**
* Creates a new ReqPlayerProfileData instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {tutorial.IReqPlayerProfileData=} [properties] Properties to set
* @returns {tutorial.ReqPlayerProfileData} ReqPlayerProfileData instance
*/
ReqPlayerProfileData.create = function create(properties) {
return new ReqPlayerProfileData(properties);
};
/**
* Encodes the specified ReqPlayerProfileData message. Does not implicitly {@link tutorial.ReqPlayerProfileData.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {tutorial.IReqPlayerProfileData} message ReqPlayerProfileData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayerProfileData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqPlayerProfileData message, length delimited. Does not implicitly {@link tutorial.ReqPlayerProfileData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {tutorial.IReqPlayerProfileData} message ReqPlayerProfileData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayerProfileData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayerProfileData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayerProfileData} ReqPlayerProfileData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayerProfileData.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.ReqPlayerProfileData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayerProfileData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayerProfileData} ReqPlayerProfileData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayerProfileData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayerProfileData message.
* @function verify
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayerProfileData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqPlayerProfileData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayerProfileData} ReqPlayerProfileData
*/
ReqPlayerProfileData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayerProfileData)
return object;
var message = new $root.tutorial.ReqPlayerProfileData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayerProfileData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {tutorial.ReqPlayerProfileData} message ReqPlayerProfileData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayerProfileData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqPlayerProfileData to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayerProfileData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayerProfileData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayerProfileData
* @function getTypeUrl
* @memberof tutorial.ReqPlayerProfileData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayerProfileData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayerProfileData";
};
return ReqPlayerProfileData;
})();
tutorial.ResPlayerProfileData = (function() {
/**
* Properties of a ResPlayerProfileData.
* @memberof tutorial
* @interface IResPlayerProfileData
* @property {number|null} [dwUin] ResPlayerProfileData dwUin
* @property {number|null} [ImageFrame] ResPlayerProfileData ImageFrame
* @property {number|null} [ImageIcon] ResPlayerProfileData ImageIcon
* @property {number|null} [DecorateCnt] ResPlayerProfileData DecorateCnt
* @property {string|null} [NickName] ResPlayerProfileData NickName
* @property {string|null} [PicURL] ResPlayerProfileData PicURL
* @property {string|null} [UnlockFrame] ResPlayerProfileData UnlockFrame
* @property {string|null} [UnlockIcon] ResPlayerProfileData UnlockIcon
* @property {number|null} [ActiveTime] ResPlayerProfileData ActiveTime
*/
/**
* Constructs a new ResPlayerProfileData.
* @memberof tutorial
* @classdesc Represents a ResPlayerProfileData.
* @implements IResPlayerProfileData
* @constructor
* @param {tutorial.IResPlayerProfileData=} [properties] Properties to set
*/
function ResPlayerProfileData(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]];
}
/**
* ResPlayerProfileData dwUin.
* @member {number} dwUin
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.dwUin = 0;
/**
* ResPlayerProfileData ImageFrame.
* @member {number} ImageFrame
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.ImageFrame = 0;
/**
* ResPlayerProfileData ImageIcon.
* @member {number} ImageIcon
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.ImageIcon = 0;
/**
* ResPlayerProfileData DecorateCnt.
* @member {number} DecorateCnt
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.DecorateCnt = 0;
/**
* ResPlayerProfileData NickName.
* @member {string} NickName
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.NickName = "";
/**
* ResPlayerProfileData PicURL.
* @member {string} PicURL
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.PicURL = "";
/**
* ResPlayerProfileData UnlockFrame.
* @member {string} UnlockFrame
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.UnlockFrame = "";
/**
* ResPlayerProfileData UnlockIcon.
* @member {string} UnlockIcon
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.UnlockIcon = "";
/**
* ResPlayerProfileData ActiveTime.
* @member {number} ActiveTime
* @memberof tutorial.ResPlayerProfileData
* @instance
*/
ResPlayerProfileData.prototype.ActiveTime = 0;
/**
* Creates a new ResPlayerProfileData instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {tutorial.IResPlayerProfileData=} [properties] Properties to set
* @returns {tutorial.ResPlayerProfileData} ResPlayerProfileData instance
*/
ResPlayerProfileData.create = function create(properties) {
return new ResPlayerProfileData(properties);
};
/**
* Encodes the specified ResPlayerProfileData message. Does not implicitly {@link tutorial.ResPlayerProfileData.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {tutorial.IResPlayerProfileData} message ResPlayerProfileData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerProfileData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.ImageFrame != null && Object.hasOwnProperty.call(message, "ImageFrame"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ImageFrame);
if (message.ImageIcon != null && Object.hasOwnProperty.call(message, "ImageIcon"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ImageIcon);
if (message.DecorateCnt != null && Object.hasOwnProperty.call(message, "DecorateCnt"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.DecorateCnt);
if (message.NickName != null && Object.hasOwnProperty.call(message, "NickName"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.NickName);
if (message.PicURL != null && Object.hasOwnProperty.call(message, "PicURL"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.PicURL);
if (message.UnlockFrame != null && Object.hasOwnProperty.call(message, "UnlockFrame"))
writer.uint32(/* id 7, wireType 2 =*/58).string(message.UnlockFrame);
if (message.UnlockIcon != null && Object.hasOwnProperty.call(message, "UnlockIcon"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.UnlockIcon);
if (message.ActiveTime != null && Object.hasOwnProperty.call(message, "ActiveTime"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.ActiveTime);
return writer;
};
/**
* Encodes the specified ResPlayerProfileData message, length delimited. Does not implicitly {@link tutorial.ResPlayerProfileData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {tutorial.IResPlayerProfileData} message ResPlayerProfileData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerProfileData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayerProfileData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayerProfileData} ResPlayerProfileData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerProfileData.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.ResPlayerProfileData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.ImageFrame = reader.int32();
break;
}
case 3: {
message.ImageIcon = reader.int32();
break;
}
case 4: {
message.DecorateCnt = reader.int32();
break;
}
case 5: {
message.NickName = reader.string();
break;
}
case 6: {
message.PicURL = reader.string();
break;
}
case 7: {
message.UnlockFrame = reader.string();
break;
}
case 8: {
message.UnlockIcon = reader.string();
break;
}
case 9: {
message.ActiveTime = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayerProfileData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayerProfileData} ResPlayerProfileData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerProfileData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayerProfileData message.
* @function verify
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayerProfileData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.ImageFrame != null && message.hasOwnProperty("ImageFrame"))
if (!$util.isInteger(message.ImageFrame))
return "ImageFrame: integer expected";
if (message.ImageIcon != null && message.hasOwnProperty("ImageIcon"))
if (!$util.isInteger(message.ImageIcon))
return "ImageIcon: integer expected";
if (message.DecorateCnt != null && message.hasOwnProperty("DecorateCnt"))
if (!$util.isInteger(message.DecorateCnt))
return "DecorateCnt: integer expected";
if (message.NickName != null && message.hasOwnProperty("NickName"))
if (!$util.isString(message.NickName))
return "NickName: string expected";
if (message.PicURL != null && message.hasOwnProperty("PicURL"))
if (!$util.isString(message.PicURL))
return "PicURL: string expected";
if (message.UnlockFrame != null && message.hasOwnProperty("UnlockFrame"))
if (!$util.isString(message.UnlockFrame))
return "UnlockFrame: string expected";
if (message.UnlockIcon != null && message.hasOwnProperty("UnlockIcon"))
if (!$util.isString(message.UnlockIcon))
return "UnlockIcon: string expected";
if (message.ActiveTime != null && message.hasOwnProperty("ActiveTime"))
if (!$util.isInteger(message.ActiveTime))
return "ActiveTime: integer expected";
return null;
};
/**
* Creates a ResPlayerProfileData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayerProfileData} ResPlayerProfileData
*/
ResPlayerProfileData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayerProfileData)
return object;
var message = new $root.tutorial.ResPlayerProfileData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.ImageFrame != null)
message.ImageFrame = object.ImageFrame | 0;
if (object.ImageIcon != null)
message.ImageIcon = object.ImageIcon | 0;
if (object.DecorateCnt != null)
message.DecorateCnt = object.DecorateCnt | 0;
if (object.NickName != null)
message.NickName = String(object.NickName);
if (object.PicURL != null)
message.PicURL = String(object.PicURL);
if (object.UnlockFrame != null)
message.UnlockFrame = String(object.UnlockFrame);
if (object.UnlockIcon != null)
message.UnlockIcon = String(object.UnlockIcon);
if (object.ActiveTime != null)
message.ActiveTime = object.ActiveTime | 0;
return message;
};
/**
* Creates a plain object from a ResPlayerProfileData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {tutorial.ResPlayerProfileData} message ResPlayerProfileData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayerProfileData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.ImageFrame = 0;
object.ImageIcon = 0;
object.DecorateCnt = 0;
object.NickName = "";
object.PicURL = "";
object.UnlockFrame = "";
object.UnlockIcon = "";
object.ActiveTime = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.ImageFrame != null && message.hasOwnProperty("ImageFrame"))
object.ImageFrame = message.ImageFrame;
if (message.ImageIcon != null && message.hasOwnProperty("ImageIcon"))
object.ImageIcon = message.ImageIcon;
if (message.DecorateCnt != null && message.hasOwnProperty("DecorateCnt"))
object.DecorateCnt = message.DecorateCnt;
if (message.NickName != null && message.hasOwnProperty("NickName"))
object.NickName = message.NickName;
if (message.PicURL != null && message.hasOwnProperty("PicURL"))
object.PicURL = message.PicURL;
if (message.UnlockFrame != null && message.hasOwnProperty("UnlockFrame"))
object.UnlockFrame = message.UnlockFrame;
if (message.UnlockIcon != null && message.hasOwnProperty("UnlockIcon"))
object.UnlockIcon = message.UnlockIcon;
if (message.ActiveTime != null && message.hasOwnProperty("ActiveTime"))
object.ActiveTime = message.ActiveTime;
return object;
};
/**
* Converts this ResPlayerProfileData to JSON.
* @function toJSON
* @memberof tutorial.ResPlayerProfileData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayerProfileData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayerProfileData
* @function getTypeUrl
* @memberof tutorial.ResPlayerProfileData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayerProfileData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayerProfileData";
};
return ResPlayerProfileData;
})();
tutorial.ReqPlayerBriefProfileData = (function() {
/**
* Properties of a ReqPlayerBriefProfileData.
* @memberof tutorial
* @interface IReqPlayerBriefProfileData
* @property {number|null} [dwUin] ReqPlayerBriefProfileData dwUin
*/
/**
* Constructs a new ReqPlayerBriefProfileData.
* @memberof tutorial
* @classdesc 请求玩家身份信息
* @implements IReqPlayerBriefProfileData
* @constructor
* @param {tutorial.IReqPlayerBriefProfileData=} [properties] Properties to set
*/
function ReqPlayerBriefProfileData(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]];
}
/**
* ReqPlayerBriefProfileData dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqPlayerBriefProfileData
* @instance
*/
ReqPlayerBriefProfileData.prototype.dwUin = 0;
/**
* Creates a new ReqPlayerBriefProfileData instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {tutorial.IReqPlayerBriefProfileData=} [properties] Properties to set
* @returns {tutorial.ReqPlayerBriefProfileData} ReqPlayerBriefProfileData instance
*/
ReqPlayerBriefProfileData.create = function create(properties) {
return new ReqPlayerBriefProfileData(properties);
};
/**
* Encodes the specified ReqPlayerBriefProfileData message. Does not implicitly {@link tutorial.ReqPlayerBriefProfileData.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {tutorial.IReqPlayerBriefProfileData} message ReqPlayerBriefProfileData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayerBriefProfileData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqPlayerBriefProfileData message, length delimited. Does not implicitly {@link tutorial.ReqPlayerBriefProfileData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {tutorial.IReqPlayerBriefProfileData} message ReqPlayerBriefProfileData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayerBriefProfileData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayerBriefProfileData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayerBriefProfileData} ReqPlayerBriefProfileData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayerBriefProfileData.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.ReqPlayerBriefProfileData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayerBriefProfileData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayerBriefProfileData} ReqPlayerBriefProfileData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayerBriefProfileData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayerBriefProfileData message.
* @function verify
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayerBriefProfileData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqPlayerBriefProfileData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayerBriefProfileData} ReqPlayerBriefProfileData
*/
ReqPlayerBriefProfileData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayerBriefProfileData)
return object;
var message = new $root.tutorial.ReqPlayerBriefProfileData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayerBriefProfileData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {tutorial.ReqPlayerBriefProfileData} message ReqPlayerBriefProfileData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayerBriefProfileData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqPlayerBriefProfileData to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayerBriefProfileData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayerBriefProfileData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayerBriefProfileData
* @function getTypeUrl
* @memberof tutorial.ReqPlayerBriefProfileData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayerBriefProfileData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayerBriefProfileData";
};
return ReqPlayerBriefProfileData;
})();
tutorial.ResPlayerBriefProfileData = (function() {
/**
* Properties of a ResPlayerBriefProfileData.
* @memberof tutorial
* @interface IResPlayerBriefProfileData
* @property {number|null} [dwUin] ResPlayerBriefProfileData dwUin
* @property {number|null} [ImageFrame] ResPlayerBriefProfileData ImageFrame
* @property {number|null} [ImageIcon] ResPlayerBriefProfileData ImageIcon
* @property {number|null} [DecorateCnt] ResPlayerBriefProfileData DecorateCnt
* @property {string|null} [NickName] ResPlayerBriefProfileData NickName
* @property {string|null} [PicURL] ResPlayerBriefProfileData PicURL
* @property {number|null} [ActiveTime] ResPlayerBriefProfileData ActiveTime
*/
/**
* Constructs a new ResPlayerBriefProfileData.
* @memberof tutorial
* @classdesc Represents a ResPlayerBriefProfileData.
* @implements IResPlayerBriefProfileData
* @constructor
* @param {tutorial.IResPlayerBriefProfileData=} [properties] Properties to set
*/
function ResPlayerBriefProfileData(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]];
}
/**
* ResPlayerBriefProfileData dwUin.
* @member {number} dwUin
* @memberof tutorial.ResPlayerBriefProfileData
* @instance
*/
ResPlayerBriefProfileData.prototype.dwUin = 0;
/**
* ResPlayerBriefProfileData ImageFrame.
* @member {number} ImageFrame
* @memberof tutorial.ResPlayerBriefProfileData
* @instance
*/
ResPlayerBriefProfileData.prototype.ImageFrame = 0;
/**
* ResPlayerBriefProfileData ImageIcon.
* @member {number} ImageIcon
* @memberof tutorial.ResPlayerBriefProfileData
* @instance
*/
ResPlayerBriefProfileData.prototype.ImageIcon = 0;
/**
* ResPlayerBriefProfileData DecorateCnt.
* @member {number} DecorateCnt
* @memberof tutorial.ResPlayerBriefProfileData
* @instance
*/
ResPlayerBriefProfileData.prototype.DecorateCnt = 0;
/**
* ResPlayerBriefProfileData NickName.
* @member {string} NickName
* @memberof tutorial.ResPlayerBriefProfileData
* @instance
*/
ResPlayerBriefProfileData.prototype.NickName = "";
/**
* ResPlayerBriefProfileData PicURL.
* @member {string} PicURL
* @memberof tutorial.ResPlayerBriefProfileData
* @instance
*/
ResPlayerBriefProfileData.prototype.PicURL = "";
/**
* ResPlayerBriefProfileData ActiveTime.
* @member {number} ActiveTime
* @memberof tutorial.ResPlayerBriefProfileData
* @instance
*/
ResPlayerBriefProfileData.prototype.ActiveTime = 0;
/**
* Creates a new ResPlayerBriefProfileData instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {tutorial.IResPlayerBriefProfileData=} [properties] Properties to set
* @returns {tutorial.ResPlayerBriefProfileData} ResPlayerBriefProfileData instance
*/
ResPlayerBriefProfileData.create = function create(properties) {
return new ResPlayerBriefProfileData(properties);
};
/**
* Encodes the specified ResPlayerBriefProfileData message. Does not implicitly {@link tutorial.ResPlayerBriefProfileData.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {tutorial.IResPlayerBriefProfileData} message ResPlayerBriefProfileData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerBriefProfileData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
if (message.ImageFrame != null && Object.hasOwnProperty.call(message, "ImageFrame"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ImageFrame);
if (message.ImageIcon != null && Object.hasOwnProperty.call(message, "ImageIcon"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ImageIcon);
if (message.DecorateCnt != null && Object.hasOwnProperty.call(message, "DecorateCnt"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.DecorateCnt);
if (message.NickName != null && Object.hasOwnProperty.call(message, "NickName"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.NickName);
if (message.PicURL != null && Object.hasOwnProperty.call(message, "PicURL"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.PicURL);
if (message.ActiveTime != null && Object.hasOwnProperty.call(message, "ActiveTime"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.ActiveTime);
return writer;
};
/**
* Encodes the specified ResPlayerBriefProfileData message, length delimited. Does not implicitly {@link tutorial.ResPlayerBriefProfileData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {tutorial.IResPlayerBriefProfileData} message ResPlayerBriefProfileData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerBriefProfileData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayerBriefProfileData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayerBriefProfileData} ResPlayerBriefProfileData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerBriefProfileData.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.ResPlayerBriefProfileData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
case 2: {
message.ImageFrame = reader.int32();
break;
}
case 3: {
message.ImageIcon = reader.int32();
break;
}
case 4: {
message.DecorateCnt = reader.int32();
break;
}
case 5: {
message.NickName = reader.string();
break;
}
case 6: {
message.PicURL = reader.string();
break;
}
case 7: {
message.ActiveTime = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayerBriefProfileData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayerBriefProfileData} ResPlayerBriefProfileData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerBriefProfileData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayerBriefProfileData message.
* @function verify
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayerBriefProfileData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
if (message.ImageFrame != null && message.hasOwnProperty("ImageFrame"))
if (!$util.isInteger(message.ImageFrame))
return "ImageFrame: integer expected";
if (message.ImageIcon != null && message.hasOwnProperty("ImageIcon"))
if (!$util.isInteger(message.ImageIcon))
return "ImageIcon: integer expected";
if (message.DecorateCnt != null && message.hasOwnProperty("DecorateCnt"))
if (!$util.isInteger(message.DecorateCnt))
return "DecorateCnt: integer expected";
if (message.NickName != null && message.hasOwnProperty("NickName"))
if (!$util.isString(message.NickName))
return "NickName: string expected";
if (message.PicURL != null && message.hasOwnProperty("PicURL"))
if (!$util.isString(message.PicURL))
return "PicURL: string expected";
if (message.ActiveTime != null && message.hasOwnProperty("ActiveTime"))
if (!$util.isInteger(message.ActiveTime))
return "ActiveTime: integer expected";
return null;
};
/**
* Creates a ResPlayerBriefProfileData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayerBriefProfileData} ResPlayerBriefProfileData
*/
ResPlayerBriefProfileData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayerBriefProfileData)
return object;
var message = new $root.tutorial.ResPlayerBriefProfileData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
if (object.ImageFrame != null)
message.ImageFrame = object.ImageFrame | 0;
if (object.ImageIcon != null)
message.ImageIcon = object.ImageIcon | 0;
if (object.DecorateCnt != null)
message.DecorateCnt = object.DecorateCnt | 0;
if (object.NickName != null)
message.NickName = String(object.NickName);
if (object.PicURL != null)
message.PicURL = String(object.PicURL);
if (object.ActiveTime != null)
message.ActiveTime = object.ActiveTime | 0;
return message;
};
/**
* Creates a plain object from a ResPlayerBriefProfileData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {tutorial.ResPlayerBriefProfileData} message ResPlayerBriefProfileData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayerBriefProfileData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.dwUin = 0;
object.ImageFrame = 0;
object.ImageIcon = 0;
object.DecorateCnt = 0;
object.NickName = "";
object.PicURL = "";
object.ActiveTime = 0;
}
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
if (message.ImageFrame != null && message.hasOwnProperty("ImageFrame"))
object.ImageFrame = message.ImageFrame;
if (message.ImageIcon != null && message.hasOwnProperty("ImageIcon"))
object.ImageIcon = message.ImageIcon;
if (message.DecorateCnt != null && message.hasOwnProperty("DecorateCnt"))
object.DecorateCnt = message.DecorateCnt;
if (message.NickName != null && message.hasOwnProperty("NickName"))
object.NickName = message.NickName;
if (message.PicURL != null && message.hasOwnProperty("PicURL"))
object.PicURL = message.PicURL;
if (message.ActiveTime != null && message.hasOwnProperty("ActiveTime"))
object.ActiveTime = message.ActiveTime;
return object;
};
/**
* Converts this ResPlayerBriefProfileData to JSON.
* @function toJSON
* @memberof tutorial.ResPlayerBriefProfileData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayerBriefProfileData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayerBriefProfileData
* @function getTypeUrl
* @memberof tutorial.ResPlayerBriefProfileData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayerBriefProfileData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayerBriefProfileData";
};
return ResPlayerBriefProfileData;
})();
tutorial.ReqSetEnergyMul = (function() {
/**
* Properties of a ReqSetEnergyMul.
* @memberof tutorial
* @interface IReqSetEnergyMul
* @property {number|null} [EnergyMul] ReqSetEnergyMul EnergyMul
*/
/**
* Constructs a new ReqSetEnergyMul.
* @memberof tutorial
* @classdesc Represents a ReqSetEnergyMul.
* @implements IReqSetEnergyMul
* @constructor
* @param {tutorial.IReqSetEnergyMul=} [properties] Properties to set
*/
function ReqSetEnergyMul(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]];
}
/**
* ReqSetEnergyMul EnergyMul.
* @member {number} EnergyMul
* @memberof tutorial.ReqSetEnergyMul
* @instance
*/
ReqSetEnergyMul.prototype.EnergyMul = 0;
/**
* Creates a new ReqSetEnergyMul instance using the specified properties.
* @function create
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {tutorial.IReqSetEnergyMul=} [properties] Properties to set
* @returns {tutorial.ReqSetEnergyMul} ReqSetEnergyMul instance
*/
ReqSetEnergyMul.create = function create(properties) {
return new ReqSetEnergyMul(properties);
};
/**
* Encodes the specified ReqSetEnergyMul message. Does not implicitly {@link tutorial.ReqSetEnergyMul.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {tutorial.IReqSetEnergyMul} message ReqSetEnergyMul message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetEnergyMul.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.EnergyMul != null && Object.hasOwnProperty.call(message, "EnergyMul"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.EnergyMul);
return writer;
};
/**
* Encodes the specified ReqSetEnergyMul message, length delimited. Does not implicitly {@link tutorial.ReqSetEnergyMul.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {tutorial.IReqSetEnergyMul} message ReqSetEnergyMul message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetEnergyMul.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSetEnergyMul message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSetEnergyMul} ReqSetEnergyMul
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetEnergyMul.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.ReqSetEnergyMul();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.EnergyMul = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSetEnergyMul message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSetEnergyMul} ReqSetEnergyMul
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetEnergyMul.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSetEnergyMul message.
* @function verify
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSetEnergyMul.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.EnergyMul != null && message.hasOwnProperty("EnergyMul"))
if (!$util.isInteger(message.EnergyMul))
return "EnergyMul: integer expected";
return null;
};
/**
* Creates a ReqSetEnergyMul message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSetEnergyMul} ReqSetEnergyMul
*/
ReqSetEnergyMul.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSetEnergyMul)
return object;
var message = new $root.tutorial.ReqSetEnergyMul();
if (object.EnergyMul != null)
message.EnergyMul = object.EnergyMul | 0;
return message;
};
/**
* Creates a plain object from a ReqSetEnergyMul message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {tutorial.ReqSetEnergyMul} message ReqSetEnergyMul
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSetEnergyMul.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.EnergyMul = 0;
if (message.EnergyMul != null && message.hasOwnProperty("EnergyMul"))
object.EnergyMul = message.EnergyMul;
return object;
};
/**
* Converts this ReqSetEnergyMul to JSON.
* @function toJSON
* @memberof tutorial.ReqSetEnergyMul
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSetEnergyMul.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSetEnergyMul
* @function getTypeUrl
* @memberof tutorial.ReqSetEnergyMul
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSetEnergyMul.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSetEnergyMul";
};
return ReqSetEnergyMul;
})();
tutorial.ResSetEnergyMul = (function() {
/**
* Properties of a ResSetEnergyMul.
* @memberof tutorial
* @interface IResSetEnergyMul
* @property {tutorial.RES_CODE|null} [ResultCode] ResSetEnergyMul ResultCode
* @property {string|null} [Msg] ResSetEnergyMul Msg
*/
/**
* Constructs a new ResSetEnergyMul.
* @memberof tutorial
* @classdesc Represents a ResSetEnergyMul.
* @implements IResSetEnergyMul
* @constructor
* @param {tutorial.IResSetEnergyMul=} [properties] Properties to set
*/
function ResSetEnergyMul(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]];
}
/**
* ResSetEnergyMul ResultCode.
* @member {tutorial.RES_CODE} ResultCode
* @memberof tutorial.ResSetEnergyMul
* @instance
*/
ResSetEnergyMul.prototype.ResultCode = 0;
/**
* ResSetEnergyMul Msg.
* @member {string} Msg
* @memberof tutorial.ResSetEnergyMul
* @instance
*/
ResSetEnergyMul.prototype.Msg = "";
/**
* Creates a new ResSetEnergyMul instance using the specified properties.
* @function create
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {tutorial.IResSetEnergyMul=} [properties] Properties to set
* @returns {tutorial.ResSetEnergyMul} ResSetEnergyMul instance
*/
ResSetEnergyMul.create = function create(properties) {
return new ResSetEnergyMul(properties);
};
/**
* Encodes the specified ResSetEnergyMul message. Does not implicitly {@link tutorial.ResSetEnergyMul.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {tutorial.IResSetEnergyMul} message ResSetEnergyMul message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetEnergyMul.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResSetEnergyMul message, length delimited. Does not implicitly {@link tutorial.ResSetEnergyMul.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {tutorial.IResSetEnergyMul} message ResSetEnergyMul message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetEnergyMul.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSetEnergyMul message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSetEnergyMul} ResSetEnergyMul
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetEnergyMul.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.ResSetEnergyMul();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSetEnergyMul message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSetEnergyMul} ResSetEnergyMul
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetEnergyMul.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSetEnergyMul message.
* @function verify
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSetEnergyMul.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
switch (message.ResultCode) {
default:
return "ResultCode: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResSetEnergyMul message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSetEnergyMul} ResSetEnergyMul
*/
ResSetEnergyMul.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSetEnergyMul)
return object;
var message = new $root.tutorial.ResSetEnergyMul();
switch (object.ResultCode) {
default:
if (typeof object.ResultCode === "number") {
message.ResultCode = object.ResultCode;
break;
}
break;
case "FAIL":
case 0:
message.ResultCode = 0;
break;
case "SUCCESS":
case 1:
message.ResultCode = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResSetEnergyMul message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {tutorial.ResSetEnergyMul} message ResSetEnergyMul
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSetEnergyMul.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.ResultCode = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = options.enums === String ? $root.tutorial.RES_CODE[message.ResultCode] === undefined ? message.ResultCode : $root.tutorial.RES_CODE[message.ResultCode] : message.ResultCode;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResSetEnergyMul to JSON.
* @function toJSON
* @memberof tutorial.ResSetEnergyMul
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSetEnergyMul.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSetEnergyMul
* @function getTypeUrl
* @memberof tutorial.ResSetEnergyMul
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSetEnergyMul.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSetEnergyMul";
};
return ResSetEnergyMul;
})();
tutorial.BaseInfo = (function() {
/**
* Properties of a BaseInfo.
* @memberof tutorial
* @interface IBaseInfo
* @property {number|null} [EnergyMul] BaseInfo EnergyMul
* @property {boolean|null} [IsFirstBuy] BaseInfo IsFirstBuy
* @property {number|null} [EnergyBuy] BaseInfo EnergyBuy
*/
/**
* Constructs a new BaseInfo.
* @memberof tutorial
* @classdesc Represents a BaseInfo.
* @implements IBaseInfo
* @constructor
* @param {tutorial.IBaseInfo=} [properties] Properties to set
*/
function BaseInfo(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]];
}
/**
* BaseInfo EnergyMul.
* @member {number} EnergyMul
* @memberof tutorial.BaseInfo
* @instance
*/
BaseInfo.prototype.EnergyMul = 0;
/**
* BaseInfo IsFirstBuy.
* @member {boolean} IsFirstBuy
* @memberof tutorial.BaseInfo
* @instance
*/
BaseInfo.prototype.IsFirstBuy = false;
/**
* BaseInfo EnergyBuy.
* @member {number} EnergyBuy
* @memberof tutorial.BaseInfo
* @instance
*/
BaseInfo.prototype.EnergyBuy = 0;
/**
* Creates a new BaseInfo instance using the specified properties.
* @function create
* @memberof tutorial.BaseInfo
* @static
* @param {tutorial.IBaseInfo=} [properties] Properties to set
* @returns {tutorial.BaseInfo} BaseInfo instance
*/
BaseInfo.create = function create(properties) {
return new BaseInfo(properties);
};
/**
* Encodes the specified BaseInfo message. Does not implicitly {@link tutorial.BaseInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.BaseInfo
* @static
* @param {tutorial.IBaseInfo} message BaseInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
BaseInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.EnergyMul != null && Object.hasOwnProperty.call(message, "EnergyMul"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.EnergyMul);
if (message.IsFirstBuy != null && Object.hasOwnProperty.call(message, "IsFirstBuy"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.IsFirstBuy);
if (message.EnergyBuy != null && Object.hasOwnProperty.call(message, "EnergyBuy"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.EnergyBuy);
return writer;
};
/**
* Encodes the specified BaseInfo message, length delimited. Does not implicitly {@link tutorial.BaseInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.BaseInfo
* @static
* @param {tutorial.IBaseInfo} message BaseInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
BaseInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a BaseInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.BaseInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.BaseInfo} BaseInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
BaseInfo.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.BaseInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.EnergyMul = reader.int32();
break;
}
case 2: {
message.IsFirstBuy = reader.bool();
break;
}
case 3: {
message.EnergyBuy = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a BaseInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.BaseInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.BaseInfo} BaseInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
BaseInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a BaseInfo message.
* @function verify
* @memberof tutorial.BaseInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
BaseInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.EnergyMul != null && message.hasOwnProperty("EnergyMul"))
if (!$util.isInteger(message.EnergyMul))
return "EnergyMul: integer expected";
if (message.IsFirstBuy != null && message.hasOwnProperty("IsFirstBuy"))
if (typeof message.IsFirstBuy !== "boolean")
return "IsFirstBuy: boolean expected";
if (message.EnergyBuy != null && message.hasOwnProperty("EnergyBuy"))
if (!$util.isInteger(message.EnergyBuy))
return "EnergyBuy: integer expected";
return null;
};
/**
* Creates a BaseInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.BaseInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.BaseInfo} BaseInfo
*/
BaseInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.BaseInfo)
return object;
var message = new $root.tutorial.BaseInfo();
if (object.EnergyMul != null)
message.EnergyMul = object.EnergyMul | 0;
if (object.IsFirstBuy != null)
message.IsFirstBuy = Boolean(object.IsFirstBuy);
if (object.EnergyBuy != null)
message.EnergyBuy = object.EnergyBuy | 0;
return message;
};
/**
* Creates a plain object from a BaseInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.BaseInfo
* @static
* @param {tutorial.BaseInfo} message BaseInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
BaseInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.EnergyMul = 0;
object.IsFirstBuy = false;
object.EnergyBuy = 0;
}
if (message.EnergyMul != null && message.hasOwnProperty("EnergyMul"))
object.EnergyMul = message.EnergyMul;
if (message.IsFirstBuy != null && message.hasOwnProperty("IsFirstBuy"))
object.IsFirstBuy = message.IsFirstBuy;
if (message.EnergyBuy != null && message.hasOwnProperty("EnergyBuy"))
object.EnergyBuy = message.EnergyBuy;
return object;
};
/**
* Converts this BaseInfo to JSON.
* @function toJSON
* @memberof tutorial.BaseInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
BaseInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for BaseInfo
* @function getTypeUrl
* @memberof tutorial.BaseInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
BaseInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.BaseInfo";
};
return BaseInfo;
})();
tutorial.ReqUserInfo = (function() {
/**
* Properties of a ReqUserInfo.
* @memberof tutorial
* @interface IReqUserInfo
*/
/**
* Constructs a new ReqUserInfo.
* @memberof tutorial
* @classdesc Represents a ReqUserInfo.
* @implements IReqUserInfo
* @constructor
* @param {tutorial.IReqUserInfo=} [properties] Properties to set
*/
function ReqUserInfo(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]];
}
/**
* Creates a new ReqUserInfo instance using the specified properties.
* @function create
* @memberof tutorial.ReqUserInfo
* @static
* @param {tutorial.IReqUserInfo=} [properties] Properties to set
* @returns {tutorial.ReqUserInfo} ReqUserInfo instance
*/
ReqUserInfo.create = function create(properties) {
return new ReqUserInfo(properties);
};
/**
* Encodes the specified ReqUserInfo message. Does not implicitly {@link tutorial.ReqUserInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqUserInfo
* @static
* @param {tutorial.IReqUserInfo} message ReqUserInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqUserInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqUserInfo message, length delimited. Does not implicitly {@link tutorial.ReqUserInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqUserInfo
* @static
* @param {tutorial.IReqUserInfo} message ReqUserInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqUserInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqUserInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqUserInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqUserInfo} ReqUserInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqUserInfo.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.ReqUserInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqUserInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqUserInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqUserInfo} ReqUserInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqUserInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqUserInfo message.
* @function verify
* @memberof tutorial.ReqUserInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqUserInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqUserInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqUserInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqUserInfo} ReqUserInfo
*/
ReqUserInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqUserInfo)
return object;
return new $root.tutorial.ReqUserInfo();
};
/**
* Creates a plain object from a ReqUserInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqUserInfo
* @static
* @param {tutorial.ReqUserInfo} message ReqUserInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqUserInfo.toObject = function toObject() {
return {};
};
/**
* Converts this ReqUserInfo to JSON.
* @function toJSON
* @memberof tutorial.ReqUserInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqUserInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqUserInfo
* @function getTypeUrl
* @memberof tutorial.ReqUserInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqUserInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqUserInfo";
};
return ReqUserInfo;
})();
tutorial.UserInfo = (function() {
/**
* Properties of a UserInfo.
* @memberof tutorial
* @interface IUserInfo
* @property {number|null} [Uid] UserInfo Uid
* @property {string|null} [Nickname] UserInfo Nickname
* @property {number|null} [Avatar] UserInfo Avatar
* @property {number|null} [Face] UserInfo Face
* @property {number|null} [DecorateCnt] UserInfo DecorateCnt
* @property {Array.<tutorial.IAvatarInfo>|null} [AvatarList] UserInfo AvatarList
* @property {Array.<tutorial.IFaceInfo>|null} [FaceList] UserInfo FaceList
* @property {number|null} [Login] UserInfo Login
* @property {string|null} [PetName] UserInfo PetName
*/
/**
* Constructs a new UserInfo.
* @memberof tutorial
* @classdesc Represents a UserInfo.
* @implements IUserInfo
* @constructor
* @param {tutorial.IUserInfo=} [properties] Properties to set
*/
function UserInfo(properties) {
this.AvatarList = [];
this.FaceList = [];
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]];
}
/**
* UserInfo Uid.
* @member {number} Uid
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.Uid = 0;
/**
* UserInfo Nickname.
* @member {string} Nickname
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.Nickname = "";
/**
* UserInfo Avatar.
* @member {number} Avatar
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.Avatar = 0;
/**
* UserInfo Face.
* @member {number} Face
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.Face = 0;
/**
* UserInfo DecorateCnt.
* @member {number} DecorateCnt
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.DecorateCnt = 0;
/**
* UserInfo AvatarList.
* @member {Array.<tutorial.IAvatarInfo>} AvatarList
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.AvatarList = $util.emptyArray;
/**
* UserInfo FaceList.
* @member {Array.<tutorial.IFaceInfo>} FaceList
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.FaceList = $util.emptyArray;
/**
* UserInfo Login.
* @member {number} Login
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.Login = 0;
/**
* UserInfo PetName.
* @member {string} PetName
* @memberof tutorial.UserInfo
* @instance
*/
UserInfo.prototype.PetName = "";
/**
* Creates a new UserInfo instance using the specified properties.
* @function create
* @memberof tutorial.UserInfo
* @static
* @param {tutorial.IUserInfo=} [properties] Properties to set
* @returns {tutorial.UserInfo} UserInfo instance
*/
UserInfo.create = function create(properties) {
return new UserInfo(properties);
};
/**
* Encodes the specified UserInfo message. Does not implicitly {@link tutorial.UserInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.UserInfo
* @static
* @param {tutorial.IUserInfo} message UserInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UserInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.Nickname != null && Object.hasOwnProperty.call(message, "Nickname"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Nickname);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Avatar);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Face);
if (message.DecorateCnt != null && Object.hasOwnProperty.call(message, "DecorateCnt"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.DecorateCnt);
if (message.AvatarList != null && message.AvatarList.length)
for (var i = 0; i < message.AvatarList.length; ++i)
$root.tutorial.AvatarInfo.encode(message.AvatarList[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.FaceList != null && message.FaceList.length)
for (var i = 0; i < message.FaceList.length; ++i)
$root.tutorial.FaceInfo.encode(message.FaceList[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.Login != null && Object.hasOwnProperty.call(message, "Login"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.Login);
if (message.PetName != null && Object.hasOwnProperty.call(message, "PetName"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.PetName);
return writer;
};
/**
* Encodes the specified UserInfo message, length delimited. Does not implicitly {@link tutorial.UserInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.UserInfo
* @static
* @param {tutorial.IUserInfo} message UserInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UserInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a UserInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.UserInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.UserInfo} UserInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UserInfo.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.UserInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.Nickname = reader.string();
break;
}
case 3: {
message.Avatar = reader.int32();
break;
}
case 4: {
message.Face = reader.int32();
break;
}
case 5: {
message.DecorateCnt = reader.int32();
break;
}
case 6: {
if (!(message.AvatarList && message.AvatarList.length))
message.AvatarList = [];
message.AvatarList.push($root.tutorial.AvatarInfo.decode(reader, reader.uint32()));
break;
}
case 7: {
if (!(message.FaceList && message.FaceList.length))
message.FaceList = [];
message.FaceList.push($root.tutorial.FaceInfo.decode(reader, reader.uint32()));
break;
}
case 8: {
message.Login = reader.int32();
break;
}
case 9: {
message.PetName = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a UserInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.UserInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.UserInfo} UserInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UserInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a UserInfo message.
* @function verify
* @memberof tutorial.UserInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UserInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.Nickname != null && message.hasOwnProperty("Nickname"))
if (!$util.isString(message.Nickname))
return "Nickname: string expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.DecorateCnt != null && message.hasOwnProperty("DecorateCnt"))
if (!$util.isInteger(message.DecorateCnt))
return "DecorateCnt: integer expected";
if (message.AvatarList != null && message.hasOwnProperty("AvatarList")) {
if (!Array.isArray(message.AvatarList))
return "AvatarList: array expected";
for (var i = 0; i < message.AvatarList.length; ++i) {
var error = $root.tutorial.AvatarInfo.verify(message.AvatarList[i]);
if (error)
return "AvatarList." + error;
}
}
if (message.FaceList != null && message.hasOwnProperty("FaceList")) {
if (!Array.isArray(message.FaceList))
return "FaceList: array expected";
for (var i = 0; i < message.FaceList.length; ++i) {
var error = $root.tutorial.FaceInfo.verify(message.FaceList[i]);
if (error)
return "FaceList." + error;
}
}
if (message.Login != null && message.hasOwnProperty("Login"))
if (!$util.isInteger(message.Login))
return "Login: integer expected";
if (message.PetName != null && message.hasOwnProperty("PetName"))
if (!$util.isString(message.PetName))
return "PetName: string expected";
return null;
};
/**
* Creates a UserInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.UserInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.UserInfo} UserInfo
*/
UserInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.UserInfo)
return object;
var message = new $root.tutorial.UserInfo();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.Nickname != null)
message.Nickname = String(object.Nickname);
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
if (object.Face != null)
message.Face = object.Face | 0;
if (object.DecorateCnt != null)
message.DecorateCnt = object.DecorateCnt | 0;
if (object.AvatarList) {
if (!Array.isArray(object.AvatarList))
throw TypeError(".tutorial.UserInfo.AvatarList: array expected");
message.AvatarList = [];
for (var i = 0; i < object.AvatarList.length; ++i) {
if (typeof object.AvatarList[i] !== "object")
throw TypeError(".tutorial.UserInfo.AvatarList: object expected");
message.AvatarList[i] = $root.tutorial.AvatarInfo.fromObject(object.AvatarList[i]);
}
}
if (object.FaceList) {
if (!Array.isArray(object.FaceList))
throw TypeError(".tutorial.UserInfo.FaceList: array expected");
message.FaceList = [];
for (var i = 0; i < object.FaceList.length; ++i) {
if (typeof object.FaceList[i] !== "object")
throw TypeError(".tutorial.UserInfo.FaceList: object expected");
message.FaceList[i] = $root.tutorial.FaceInfo.fromObject(object.FaceList[i]);
}
}
if (object.Login != null)
message.Login = object.Login | 0;
if (object.PetName != null)
message.PetName = String(object.PetName);
return message;
};
/**
* Creates a plain object from a UserInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.UserInfo
* @static
* @param {tutorial.UserInfo} message UserInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UserInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.AvatarList = [];
object.FaceList = [];
}
if (options.defaults) {
object.Uid = 0;
object.Nickname = "";
object.Avatar = 0;
object.Face = 0;
object.DecorateCnt = 0;
object.Login = 0;
object.PetName = "";
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.Nickname != null && message.hasOwnProperty("Nickname"))
object.Nickname = message.Nickname;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.DecorateCnt != null && message.hasOwnProperty("DecorateCnt"))
object.DecorateCnt = message.DecorateCnt;
if (message.AvatarList && message.AvatarList.length) {
object.AvatarList = [];
for (var j = 0; j < message.AvatarList.length; ++j)
object.AvatarList[j] = $root.tutorial.AvatarInfo.toObject(message.AvatarList[j], options);
}
if (message.FaceList && message.FaceList.length) {
object.FaceList = [];
for (var j = 0; j < message.FaceList.length; ++j)
object.FaceList[j] = $root.tutorial.FaceInfo.toObject(message.FaceList[j], options);
}
if (message.Login != null && message.hasOwnProperty("Login"))
object.Login = message.Login;
if (message.PetName != null && message.hasOwnProperty("PetName"))
object.PetName = message.PetName;
return object;
};
/**
* Converts this UserInfo to JSON.
* @function toJSON
* @memberof tutorial.UserInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
UserInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for UserInfo
* @function getTypeUrl
* @memberof tutorial.UserInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
UserInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.UserInfo";
};
return UserInfo;
})();
tutorial.ReqSetName = (function() {
/**
* Properties of a ReqSetName.
* @memberof tutorial
* @interface IReqSetName
* @property {string|null} [Name] ReqSetName Name
*/
/**
* Constructs a new ReqSetName.
* @memberof tutorial
* @classdesc Represents a ReqSetName.
* @implements IReqSetName
* @constructor
* @param {tutorial.IReqSetName=} [properties] Properties to set
*/
function ReqSetName(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]];
}
/**
* ReqSetName Name.
* @member {string} Name
* @memberof tutorial.ReqSetName
* @instance
*/
ReqSetName.prototype.Name = "";
/**
* Creates a new ReqSetName instance using the specified properties.
* @function create
* @memberof tutorial.ReqSetName
* @static
* @param {tutorial.IReqSetName=} [properties] Properties to set
* @returns {tutorial.ReqSetName} ReqSetName instance
*/
ReqSetName.create = function create(properties) {
return new ReqSetName(properties);
};
/**
* Encodes the specified ReqSetName message. Does not implicitly {@link tutorial.ReqSetName.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSetName
* @static
* @param {tutorial.IReqSetName} message ReqSetName message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetName.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Name);
return writer;
};
/**
* Encodes the specified ReqSetName message, length delimited. Does not implicitly {@link tutorial.ReqSetName.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSetName
* @static
* @param {tutorial.IReqSetName} message ReqSetName message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetName.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSetName message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSetName
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSetName} ReqSetName
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetName.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.ReqSetName();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Name = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSetName message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSetName
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSetName} ReqSetName
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetName.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSetName message.
* @function verify
* @memberof tutorial.ReqSetName
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSetName.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
return null;
};
/**
* Creates a ReqSetName message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSetName
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSetName} ReqSetName
*/
ReqSetName.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSetName)
return object;
var message = new $root.tutorial.ReqSetName();
if (object.Name != null)
message.Name = String(object.Name);
return message;
};
/**
* Creates a plain object from a ReqSetName message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSetName
* @static
* @param {tutorial.ReqSetName} message ReqSetName
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSetName.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Name = "";
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
return object;
};
/**
* Converts this ReqSetName to JSON.
* @function toJSON
* @memberof tutorial.ReqSetName
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSetName.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSetName
* @function getTypeUrl
* @memberof tutorial.ReqSetName
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSetName.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSetName";
};
return ReqSetName;
})();
tutorial.ResSetName = (function() {
/**
* Properties of a ResSetName.
* @memberof tutorial
* @interface IResSetName
* @property {tutorial.RES_CODE|null} [ResultCode] ResSetName ResultCode
* @property {string|null} [Msg] ResSetName Msg
*/
/**
* Constructs a new ResSetName.
* @memberof tutorial
* @classdesc Represents a ResSetName.
* @implements IResSetName
* @constructor
* @param {tutorial.IResSetName=} [properties] Properties to set
*/
function ResSetName(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]];
}
/**
* ResSetName ResultCode.
* @member {tutorial.RES_CODE} ResultCode
* @memberof tutorial.ResSetName
* @instance
*/
ResSetName.prototype.ResultCode = 0;
/**
* ResSetName Msg.
* @member {string} Msg
* @memberof tutorial.ResSetName
* @instance
*/
ResSetName.prototype.Msg = "";
/**
* Creates a new ResSetName instance using the specified properties.
* @function create
* @memberof tutorial.ResSetName
* @static
* @param {tutorial.IResSetName=} [properties] Properties to set
* @returns {tutorial.ResSetName} ResSetName instance
*/
ResSetName.create = function create(properties) {
return new ResSetName(properties);
};
/**
* Encodes the specified ResSetName message. Does not implicitly {@link tutorial.ResSetName.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSetName
* @static
* @param {tutorial.IResSetName} message ResSetName message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetName.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResSetName message, length delimited. Does not implicitly {@link tutorial.ResSetName.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSetName
* @static
* @param {tutorial.IResSetName} message ResSetName message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetName.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSetName message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSetName
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSetName} ResSetName
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetName.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.ResSetName();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSetName message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSetName
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSetName} ResSetName
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetName.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSetName message.
* @function verify
* @memberof tutorial.ResSetName
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSetName.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
switch (message.ResultCode) {
default:
return "ResultCode: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResSetName message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSetName
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSetName} ResSetName
*/
ResSetName.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSetName)
return object;
var message = new $root.tutorial.ResSetName();
switch (object.ResultCode) {
default:
if (typeof object.ResultCode === "number") {
message.ResultCode = object.ResultCode;
break;
}
break;
case "FAIL":
case 0:
message.ResultCode = 0;
break;
case "SUCCESS":
case 1:
message.ResultCode = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResSetName message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSetName
* @static
* @param {tutorial.ResSetName} message ResSetName
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSetName.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.ResultCode = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = options.enums === String ? $root.tutorial.RES_CODE[message.ResultCode] === undefined ? message.ResultCode : $root.tutorial.RES_CODE[message.ResultCode] : message.ResultCode;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResSetName to JSON.
* @function toJSON
* @memberof tutorial.ResSetName
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSetName.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSetName
* @function getTypeUrl
* @memberof tutorial.ResSetName
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSetName.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSetName";
};
return ResSetName;
})();
tutorial.ReqSetPetName = (function() {
/**
* Properties of a ReqSetPetName.
* @memberof tutorial
* @interface IReqSetPetName
* @property {string|null} [Name] ReqSetPetName Name
*/
/**
* Constructs a new ReqSetPetName.
* @memberof tutorial
* @classdesc Represents a ReqSetPetName.
* @implements IReqSetPetName
* @constructor
* @param {tutorial.IReqSetPetName=} [properties] Properties to set
*/
function ReqSetPetName(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]];
}
/**
* ReqSetPetName Name.
* @member {string} Name
* @memberof tutorial.ReqSetPetName
* @instance
*/
ReqSetPetName.prototype.Name = "";
/**
* Creates a new ReqSetPetName instance using the specified properties.
* @function create
* @memberof tutorial.ReqSetPetName
* @static
* @param {tutorial.IReqSetPetName=} [properties] Properties to set
* @returns {tutorial.ReqSetPetName} ReqSetPetName instance
*/
ReqSetPetName.create = function create(properties) {
return new ReqSetPetName(properties);
};
/**
* Encodes the specified ReqSetPetName message. Does not implicitly {@link tutorial.ReqSetPetName.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSetPetName
* @static
* @param {tutorial.IReqSetPetName} message ReqSetPetName message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetPetName.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Name);
return writer;
};
/**
* Encodes the specified ReqSetPetName message, length delimited. Does not implicitly {@link tutorial.ReqSetPetName.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSetPetName
* @static
* @param {tutorial.IReqSetPetName} message ReqSetPetName message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetPetName.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSetPetName message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSetPetName
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSetPetName} ReqSetPetName
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetPetName.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.ReqSetPetName();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Name = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSetPetName message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSetPetName
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSetPetName} ReqSetPetName
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetPetName.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSetPetName message.
* @function verify
* @memberof tutorial.ReqSetPetName
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSetPetName.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
return null;
};
/**
* Creates a ReqSetPetName message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSetPetName
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSetPetName} ReqSetPetName
*/
ReqSetPetName.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSetPetName)
return object;
var message = new $root.tutorial.ReqSetPetName();
if (object.Name != null)
message.Name = String(object.Name);
return message;
};
/**
* Creates a plain object from a ReqSetPetName message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSetPetName
* @static
* @param {tutorial.ReqSetPetName} message ReqSetPetName
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSetPetName.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Name = "";
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
return object;
};
/**
* Converts this ReqSetPetName to JSON.
* @function toJSON
* @memberof tutorial.ReqSetPetName
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSetPetName.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSetPetName
* @function getTypeUrl
* @memberof tutorial.ReqSetPetName
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSetPetName.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSetPetName";
};
return ReqSetPetName;
})();
tutorial.ResSetPetName = (function() {
/**
* Properties of a ResSetPetName.
* @memberof tutorial
* @interface IResSetPetName
* @property {tutorial.RES_CODE|null} [ResultCode] ResSetPetName ResultCode
* @property {string|null} [Msg] ResSetPetName Msg
*/
/**
* Constructs a new ResSetPetName.
* @memberof tutorial
* @classdesc Represents a ResSetPetName.
* @implements IResSetPetName
* @constructor
* @param {tutorial.IResSetPetName=} [properties] Properties to set
*/
function ResSetPetName(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]];
}
/**
* ResSetPetName ResultCode.
* @member {tutorial.RES_CODE} ResultCode
* @memberof tutorial.ResSetPetName
* @instance
*/
ResSetPetName.prototype.ResultCode = 0;
/**
* ResSetPetName Msg.
* @member {string} Msg
* @memberof tutorial.ResSetPetName
* @instance
*/
ResSetPetName.prototype.Msg = "";
/**
* Creates a new ResSetPetName instance using the specified properties.
* @function create
* @memberof tutorial.ResSetPetName
* @static
* @param {tutorial.IResSetPetName=} [properties] Properties to set
* @returns {tutorial.ResSetPetName} ResSetPetName instance
*/
ResSetPetName.create = function create(properties) {
return new ResSetPetName(properties);
};
/**
* Encodes the specified ResSetPetName message. Does not implicitly {@link tutorial.ResSetPetName.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSetPetName
* @static
* @param {tutorial.IResSetPetName} message ResSetPetName message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetPetName.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResSetPetName message, length delimited. Does not implicitly {@link tutorial.ResSetPetName.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSetPetName
* @static
* @param {tutorial.IResSetPetName} message ResSetPetName message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetPetName.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSetPetName message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSetPetName
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSetPetName} ResSetPetName
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetPetName.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.ResSetPetName();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSetPetName message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSetPetName
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSetPetName} ResSetPetName
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetPetName.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSetPetName message.
* @function verify
* @memberof tutorial.ResSetPetName
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSetPetName.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
switch (message.ResultCode) {
default:
return "ResultCode: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResSetPetName message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSetPetName
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSetPetName} ResSetPetName
*/
ResSetPetName.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSetPetName)
return object;
var message = new $root.tutorial.ResSetPetName();
switch (object.ResultCode) {
default:
if (typeof object.ResultCode === "number") {
message.ResultCode = object.ResultCode;
break;
}
break;
case "FAIL":
case 0:
message.ResultCode = 0;
break;
case "SUCCESS":
case 1:
message.ResultCode = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResSetPetName message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSetPetName
* @static
* @param {tutorial.ResSetPetName} message ResSetPetName
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSetPetName.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.ResultCode = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = options.enums === String ? $root.tutorial.RES_CODE[message.ResultCode] === undefined ? message.ResultCode : $root.tutorial.RES_CODE[message.ResultCode] : message.ResultCode;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResSetPetName to JSON.
* @function toJSON
* @memberof tutorial.ResSetPetName
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSetPetName.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSetPetName
* @function getTypeUrl
* @memberof tutorial.ResSetPetName
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSetPetName.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSetPetName";
};
return ResSetPetName;
})();
tutorial.ReqBuyEnergy = (function() {
/**
* Properties of a ReqBuyEnergy.
* @memberof tutorial
* @interface IReqBuyEnergy
* @property {number|null} [Energy] ReqBuyEnergy Energy
*/
/**
* Constructs a new ReqBuyEnergy.
* @memberof tutorial
* @classdesc Represents a ReqBuyEnergy.
* @implements IReqBuyEnergy
* @constructor
* @param {tutorial.IReqBuyEnergy=} [properties] Properties to set
*/
function ReqBuyEnergy(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]];
}
/**
* ReqBuyEnergy Energy.
* @member {number} Energy
* @memberof tutorial.ReqBuyEnergy
* @instance
*/
ReqBuyEnergy.prototype.Energy = 0;
/**
* Creates a new ReqBuyEnergy instance using the specified properties.
* @function create
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {tutorial.IReqBuyEnergy=} [properties] Properties to set
* @returns {tutorial.ReqBuyEnergy} ReqBuyEnergy instance
*/
ReqBuyEnergy.create = function create(properties) {
return new ReqBuyEnergy(properties);
};
/**
* Encodes the specified ReqBuyEnergy message. Does not implicitly {@link tutorial.ReqBuyEnergy.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {tutorial.IReqBuyEnergy} message ReqBuyEnergy message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBuyEnergy.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Energy != null && Object.hasOwnProperty.call(message, "Energy"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Energy);
return writer;
};
/**
* Encodes the specified ReqBuyEnergy message, length delimited. Does not implicitly {@link tutorial.ReqBuyEnergy.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {tutorial.IReqBuyEnergy} message ReqBuyEnergy message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBuyEnergy.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqBuyEnergy message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqBuyEnergy} ReqBuyEnergy
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBuyEnergy.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.ReqBuyEnergy();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Energy = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqBuyEnergy message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqBuyEnergy} ReqBuyEnergy
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBuyEnergy.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqBuyEnergy message.
* @function verify
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqBuyEnergy.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Energy != null && message.hasOwnProperty("Energy"))
if (!$util.isInteger(message.Energy))
return "Energy: integer expected";
return null;
};
/**
* Creates a ReqBuyEnergy message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqBuyEnergy} ReqBuyEnergy
*/
ReqBuyEnergy.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqBuyEnergy)
return object;
var message = new $root.tutorial.ReqBuyEnergy();
if (object.Energy != null)
message.Energy = object.Energy | 0;
return message;
};
/**
* Creates a plain object from a ReqBuyEnergy message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {tutorial.ReqBuyEnergy} message ReqBuyEnergy
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqBuyEnergy.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Energy = 0;
if (message.Energy != null && message.hasOwnProperty("Energy"))
object.Energy = message.Energy;
return object;
};
/**
* Converts this ReqBuyEnergy to JSON.
* @function toJSON
* @memberof tutorial.ReqBuyEnergy
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqBuyEnergy.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqBuyEnergy
* @function getTypeUrl
* @memberof tutorial.ReqBuyEnergy
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqBuyEnergy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqBuyEnergy";
};
return ReqBuyEnergy;
})();
tutorial.ResBuyEnergy = (function() {
/**
* Properties of a ResBuyEnergy.
* @memberof tutorial
* @interface IResBuyEnergy
* @property {tutorial.RES_CODE|null} [Code] ResBuyEnergy Code
* @property {string|null} [Msg] ResBuyEnergy Msg
*/
/**
* Constructs a new ResBuyEnergy.
* @memberof tutorial
* @classdesc Represents a ResBuyEnergy.
* @implements IResBuyEnergy
* @constructor
* @param {tutorial.IResBuyEnergy=} [properties] Properties to set
*/
function ResBuyEnergy(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]];
}
/**
* ResBuyEnergy Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResBuyEnergy
* @instance
*/
ResBuyEnergy.prototype.Code = 0;
/**
* ResBuyEnergy Msg.
* @member {string} Msg
* @memberof tutorial.ResBuyEnergy
* @instance
*/
ResBuyEnergy.prototype.Msg = "";
/**
* Creates a new ResBuyEnergy instance using the specified properties.
* @function create
* @memberof tutorial.ResBuyEnergy
* @static
* @param {tutorial.IResBuyEnergy=} [properties] Properties to set
* @returns {tutorial.ResBuyEnergy} ResBuyEnergy instance
*/
ResBuyEnergy.create = function create(properties) {
return new ResBuyEnergy(properties);
};
/**
* Encodes the specified ResBuyEnergy message. Does not implicitly {@link tutorial.ResBuyEnergy.verify|verify} messages.
* @function encode
* @memberof tutorial.ResBuyEnergy
* @static
* @param {tutorial.IResBuyEnergy} message ResBuyEnergy message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBuyEnergy.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResBuyEnergy message, length delimited. Does not implicitly {@link tutorial.ResBuyEnergy.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResBuyEnergy
* @static
* @param {tutorial.IResBuyEnergy} message ResBuyEnergy message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBuyEnergy.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResBuyEnergy message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResBuyEnergy
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResBuyEnergy} ResBuyEnergy
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBuyEnergy.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.ResBuyEnergy();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResBuyEnergy message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResBuyEnergy
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResBuyEnergy} ResBuyEnergy
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBuyEnergy.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResBuyEnergy message.
* @function verify
* @memberof tutorial.ResBuyEnergy
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResBuyEnergy.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResBuyEnergy message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResBuyEnergy
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResBuyEnergy} ResBuyEnergy
*/
ResBuyEnergy.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResBuyEnergy)
return object;
var message = new $root.tutorial.ResBuyEnergy();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResBuyEnergy message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResBuyEnergy
* @static
* @param {tutorial.ResBuyEnergy} message ResBuyEnergy
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResBuyEnergy.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResBuyEnergy to JSON.
* @function toJSON
* @memberof tutorial.ResBuyEnergy
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResBuyEnergy.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResBuyEnergy
* @function getTypeUrl
* @memberof tutorial.ResBuyEnergy
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResBuyEnergy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResBuyEnergy";
};
return ResBuyEnergy;
})();
tutorial.ReqGetHandbookReward = (function() {
/**
* Properties of a ReqGetHandbookReward.
* @memberof tutorial
* @interface IReqGetHandbookReward
* @property {number|null} [ChessId] ReqGetHandbookReward ChessId
*/
/**
* Constructs a new ReqGetHandbookReward.
* @memberof tutorial
* @classdesc Represents a ReqGetHandbookReward.
* @implements IReqGetHandbookReward
* @constructor
* @param {tutorial.IReqGetHandbookReward=} [properties] Properties to set
*/
function ReqGetHandbookReward(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]];
}
/**
* ReqGetHandbookReward ChessId.
* @member {number} ChessId
* @memberof tutorial.ReqGetHandbookReward
* @instance
*/
ReqGetHandbookReward.prototype.ChessId = 0;
/**
* Creates a new ReqGetHandbookReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {tutorial.IReqGetHandbookReward=} [properties] Properties to set
* @returns {tutorial.ReqGetHandbookReward} ReqGetHandbookReward instance
*/
ReqGetHandbookReward.create = function create(properties) {
return new ReqGetHandbookReward(properties);
};
/**
* Encodes the specified ReqGetHandbookReward message. Does not implicitly {@link tutorial.ReqGetHandbookReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {tutorial.IReqGetHandbookReward} message ReqGetHandbookReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetHandbookReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ChessId != null && Object.hasOwnProperty.call(message, "ChessId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ChessId);
return writer;
};
/**
* Encodes the specified ReqGetHandbookReward message, length delimited. Does not implicitly {@link tutorial.ReqGetHandbookReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {tutorial.IReqGetHandbookReward} message ReqGetHandbookReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetHandbookReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetHandbookReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetHandbookReward} ReqGetHandbookReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetHandbookReward.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.ReqGetHandbookReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ChessId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetHandbookReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetHandbookReward} ReqGetHandbookReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetHandbookReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetHandbookReward message.
* @function verify
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetHandbookReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
if (!$util.isInteger(message.ChessId))
return "ChessId: integer expected";
return null;
};
/**
* Creates a ReqGetHandbookReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetHandbookReward} ReqGetHandbookReward
*/
ReqGetHandbookReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetHandbookReward)
return object;
var message = new $root.tutorial.ReqGetHandbookReward();
if (object.ChessId != null)
message.ChessId = object.ChessId | 0;
return message;
};
/**
* Creates a plain object from a ReqGetHandbookReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {tutorial.ReqGetHandbookReward} message ReqGetHandbookReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetHandbookReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.ChessId = 0;
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
object.ChessId = message.ChessId;
return object;
};
/**
* Converts this ReqGetHandbookReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGetHandbookReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetHandbookReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetHandbookReward
* @function getTypeUrl
* @memberof tutorial.ReqGetHandbookReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetHandbookReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetHandbookReward";
};
return ReqGetHandbookReward;
})();
tutorial.HandbookInfo = (function() {
/**
* Properties of a HandbookInfo.
* @memberof tutorial
* @interface IHandbookInfo
* @property {number|null} [ChessId] HandbookInfo ChessId
* @property {number|null} [Status] HandbookInfo Status
*/
/**
* Constructs a new HandbookInfo.
* @memberof tutorial
* @classdesc Represents a HandbookInfo.
* @implements IHandbookInfo
* @constructor
* @param {tutorial.IHandbookInfo=} [properties] Properties to set
*/
function HandbookInfo(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]];
}
/**
* HandbookInfo ChessId.
* @member {number} ChessId
* @memberof tutorial.HandbookInfo
* @instance
*/
HandbookInfo.prototype.ChessId = 0;
/**
* HandbookInfo Status.
* @member {number} Status
* @memberof tutorial.HandbookInfo
* @instance
*/
HandbookInfo.prototype.Status = 0;
/**
* Creates a new HandbookInfo instance using the specified properties.
* @function create
* @memberof tutorial.HandbookInfo
* @static
* @param {tutorial.IHandbookInfo=} [properties] Properties to set
* @returns {tutorial.HandbookInfo} HandbookInfo instance
*/
HandbookInfo.create = function create(properties) {
return new HandbookInfo(properties);
};
/**
* Encodes the specified HandbookInfo message. Does not implicitly {@link tutorial.HandbookInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.HandbookInfo
* @static
* @param {tutorial.IHandbookInfo} message HandbookInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
HandbookInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ChessId != null && Object.hasOwnProperty.call(message, "ChessId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ChessId);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Status);
return writer;
};
/**
* Encodes the specified HandbookInfo message, length delimited. Does not implicitly {@link tutorial.HandbookInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.HandbookInfo
* @static
* @param {tutorial.IHandbookInfo} message HandbookInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
HandbookInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a HandbookInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.HandbookInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.HandbookInfo} HandbookInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
HandbookInfo.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.HandbookInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ChessId = reader.int32();
break;
}
case 2: {
message.Status = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a HandbookInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.HandbookInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.HandbookInfo} HandbookInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
HandbookInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a HandbookInfo message.
* @function verify
* @memberof tutorial.HandbookInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
HandbookInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
if (!$util.isInteger(message.ChessId))
return "ChessId: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
return null;
};
/**
* Creates a HandbookInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.HandbookInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.HandbookInfo} HandbookInfo
*/
HandbookInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.HandbookInfo)
return object;
var message = new $root.tutorial.HandbookInfo();
if (object.ChessId != null)
message.ChessId = object.ChessId | 0;
if (object.Status != null)
message.Status = object.Status | 0;
return message;
};
/**
* Creates a plain object from a HandbookInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.HandbookInfo
* @static
* @param {tutorial.HandbookInfo} message HandbookInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
HandbookInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.ChessId = 0;
object.Status = 0;
}
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
object.ChessId = message.ChessId;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
return object;
};
/**
* Converts this HandbookInfo to JSON.
* @function toJSON
* @memberof tutorial.HandbookInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
HandbookInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for HandbookInfo
* @function getTypeUrl
* @memberof tutorial.HandbookInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
HandbookInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.HandbookInfo";
};
return HandbookInfo;
})();
tutorial.Handbook = (function() {
/**
* Properties of a Handbook.
* @memberof tutorial
* @interface IHandbook
* @property {Array.<tutorial.IHandbookInfo>|null} [Handbooks] Handbook Handbooks
*/
/**
* Constructs a new Handbook.
* @memberof tutorial
* @classdesc Represents a Handbook.
* @implements IHandbook
* @constructor
* @param {tutorial.IHandbook=} [properties] Properties to set
*/
function Handbook(properties) {
this.Handbooks = [];
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]];
}
/**
* Handbook Handbooks.
* @member {Array.<tutorial.IHandbookInfo>} Handbooks
* @memberof tutorial.Handbook
* @instance
*/
Handbook.prototype.Handbooks = $util.emptyArray;
/**
* Creates a new Handbook instance using the specified properties.
* @function create
* @memberof tutorial.Handbook
* @static
* @param {tutorial.IHandbook=} [properties] Properties to set
* @returns {tutorial.Handbook} Handbook instance
*/
Handbook.create = function create(properties) {
return new Handbook(properties);
};
/**
* Encodes the specified Handbook message. Does not implicitly {@link tutorial.Handbook.verify|verify} messages.
* @function encode
* @memberof tutorial.Handbook
* @static
* @param {tutorial.IHandbook} message Handbook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Handbook.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Handbooks != null && message.Handbooks.length)
for (var i = 0; i < message.Handbooks.length; ++i)
$root.tutorial.HandbookInfo.encode(message.Handbooks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified Handbook message, length delimited. Does not implicitly {@link tutorial.Handbook.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.Handbook
* @static
* @param {tutorial.IHandbook} message Handbook message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Handbook.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a Handbook message from the specified reader or buffer.
* @function decode
* @memberof tutorial.Handbook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.Handbook} Handbook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Handbook.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.Handbook();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.Handbooks && message.Handbooks.length))
message.Handbooks = [];
message.Handbooks.push($root.tutorial.HandbookInfo.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a Handbook message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.Handbook
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.Handbook} Handbook
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Handbook.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a Handbook message.
* @function verify
* @memberof tutorial.Handbook
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Handbook.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Handbooks != null && message.hasOwnProperty("Handbooks")) {
if (!Array.isArray(message.Handbooks))
return "Handbooks: array expected";
for (var i = 0; i < message.Handbooks.length; ++i) {
var error = $root.tutorial.HandbookInfo.verify(message.Handbooks[i]);
if (error)
return "Handbooks." + error;
}
}
return null;
};
/**
* Creates a Handbook message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.Handbook
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.Handbook} Handbook
*/
Handbook.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.Handbook)
return object;
var message = new $root.tutorial.Handbook();
if (object.Handbooks) {
if (!Array.isArray(object.Handbooks))
throw TypeError(".tutorial.Handbook.Handbooks: array expected");
message.Handbooks = [];
for (var i = 0; i < object.Handbooks.length; ++i) {
if (typeof object.Handbooks[i] !== "object")
throw TypeError(".tutorial.Handbook.Handbooks: object expected");
message.Handbooks[i] = $root.tutorial.HandbookInfo.fromObject(object.Handbooks[i]);
}
}
return message;
};
/**
* Creates a plain object from a Handbook message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.Handbook
* @static
* @param {tutorial.Handbook} message Handbook
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Handbook.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Handbooks = [];
if (message.Handbooks && message.Handbooks.length) {
object.Handbooks = [];
for (var j = 0; j < message.Handbooks.length; ++j)
object.Handbooks[j] = $root.tutorial.HandbookInfo.toObject(message.Handbooks[j], options);
}
return object;
};
/**
* Converts this Handbook to JSON.
* @function toJSON
* @memberof tutorial.Handbook
* @instance
* @returns {Object.<string,*>} JSON object
*/
Handbook.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for Handbook
* @function getTypeUrl
* @memberof tutorial.Handbook
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Handbook.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.Handbook";
};
return Handbook;
})();
tutorial.ResGetHandbookReward = (function() {
/**
* Properties of a ResGetHandbookReward.
* @memberof tutorial
* @interface IResGetHandbookReward
* @property {tutorial.RES_CODE|null} [Code] ResGetHandbookReward Code
* @property {string|null} [Msg] ResGetHandbookReward Msg
*/
/**
* Constructs a new ResGetHandbookReward.
* @memberof tutorial
* @classdesc Represents a ResGetHandbookReward.
* @implements IResGetHandbookReward
* @constructor
* @param {tutorial.IResGetHandbookReward=} [properties] Properties to set
*/
function ResGetHandbookReward(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]];
}
/**
* ResGetHandbookReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGetHandbookReward
* @instance
*/
ResGetHandbookReward.prototype.Code = 0;
/**
* ResGetHandbookReward Msg.
* @member {string} Msg
* @memberof tutorial.ResGetHandbookReward
* @instance
*/
ResGetHandbookReward.prototype.Msg = "";
/**
* Creates a new ResGetHandbookReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {tutorial.IResGetHandbookReward=} [properties] Properties to set
* @returns {tutorial.ResGetHandbookReward} ResGetHandbookReward instance
*/
ResGetHandbookReward.create = function create(properties) {
return new ResGetHandbookReward(properties);
};
/**
* Encodes the specified ResGetHandbookReward message. Does not implicitly {@link tutorial.ResGetHandbookReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {tutorial.IResGetHandbookReward} message ResGetHandbookReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetHandbookReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResGetHandbookReward message, length delimited. Does not implicitly {@link tutorial.ResGetHandbookReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {tutorial.IResGetHandbookReward} message ResGetHandbookReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetHandbookReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetHandbookReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetHandbookReward} ResGetHandbookReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetHandbookReward.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.ResGetHandbookReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetHandbookReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetHandbookReward} ResGetHandbookReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetHandbookReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetHandbookReward message.
* @function verify
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetHandbookReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResGetHandbookReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetHandbookReward} ResGetHandbookReward
*/
ResGetHandbookReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetHandbookReward)
return object;
var message = new $root.tutorial.ResGetHandbookReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResGetHandbookReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {tutorial.ResGetHandbookReward} message ResGetHandbookReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetHandbookReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResGetHandbookReward to JSON.
* @function toJSON
* @memberof tutorial.ResGetHandbookReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetHandbookReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetHandbookReward
* @function getTypeUrl
* @memberof tutorial.ResGetHandbookReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetHandbookReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetHandbookReward";
};
return ResGetHandbookReward;
})();
tutorial.ReqRewardOrder = (function() {
/**
* Properties of a ReqRewardOrder.
* @memberof tutorial
* @interface IReqRewardOrder
* @property {number|null} [OrderId] ReqRewardOrder OrderId
* @property {Object.<string,number>|null} [mChessData] ReqRewardOrder mChessData
*/
/**
* Constructs a new ReqRewardOrder.
* @memberof tutorial
* @classdesc Represents a ReqRewardOrder.
* @implements IReqRewardOrder
* @constructor
* @param {tutorial.IReqRewardOrder=} [properties] Properties to set
*/
function ReqRewardOrder(properties) {
this.mChessData = {};
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]];
}
/**
* ReqRewardOrder OrderId.
* @member {number} OrderId
* @memberof tutorial.ReqRewardOrder
* @instance
*/
ReqRewardOrder.prototype.OrderId = 0;
/**
* ReqRewardOrder mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.ReqRewardOrder
* @instance
*/
ReqRewardOrder.prototype.mChessData = $util.emptyObject;
/**
* Creates a new ReqRewardOrder instance using the specified properties.
* @function create
* @memberof tutorial.ReqRewardOrder
* @static
* @param {tutorial.IReqRewardOrder=} [properties] Properties to set
* @returns {tutorial.ReqRewardOrder} ReqRewardOrder instance
*/
ReqRewardOrder.create = function create(properties) {
return new ReqRewardOrder(properties);
};
/**
* Encodes the specified ReqRewardOrder message. Does not implicitly {@link tutorial.ReqRewardOrder.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRewardOrder
* @static
* @param {tutorial.IReqRewardOrder} message ReqRewardOrder message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRewardOrder.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.OrderId != null && Object.hasOwnProperty.call(message, "OrderId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.OrderId);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqRewardOrder message, length delimited. Does not implicitly {@link tutorial.ReqRewardOrder.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRewardOrder
* @static
* @param {tutorial.IReqRewardOrder} message ReqRewardOrder message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRewardOrder.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRewardOrder message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRewardOrder
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRewardOrder} ReqRewardOrder
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRewardOrder.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.ReqRewardOrder(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.OrderId = reader.int32();
break;
}
case 2: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRewardOrder message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRewardOrder
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRewardOrder} ReqRewardOrder
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRewardOrder.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRewardOrder message.
* @function verify
* @memberof tutorial.ReqRewardOrder
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRewardOrder.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.OrderId != null && message.hasOwnProperty("OrderId"))
if (!$util.isInteger(message.OrderId))
return "OrderId: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
return null;
};
/**
* Creates a ReqRewardOrder message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRewardOrder
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRewardOrder} ReqRewardOrder
*/
ReqRewardOrder.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRewardOrder)
return object;
var message = new $root.tutorial.ReqRewardOrder();
if (object.OrderId != null)
message.OrderId = object.OrderId | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.ReqRewardOrder.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqRewardOrder message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRewardOrder
* @static
* @param {tutorial.ReqRewardOrder} message ReqRewardOrder
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRewardOrder.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults)
object.OrderId = 0;
if (message.OrderId != null && message.hasOwnProperty("OrderId"))
object.OrderId = message.OrderId;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
return object;
};
/**
* Converts this ReqRewardOrder to JSON.
* @function toJSON
* @memberof tutorial.ReqRewardOrder
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRewardOrder.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRewardOrder
* @function getTypeUrl
* @memberof tutorial.ReqRewardOrder
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRewardOrder.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRewardOrder";
};
return ReqRewardOrder;
})();
tutorial.ResRewardOrder = (function() {
/**
* Properties of a ResRewardOrder.
* @memberof tutorial
* @interface IResRewardOrder
* @property {tutorial.RES_CODE|null} [Code] ResRewardOrder Code
* @property {string|null} [Msg] ResRewardOrder Msg
*/
/**
* Constructs a new ResRewardOrder.
* @memberof tutorial
* @classdesc Represents a ResRewardOrder.
* @implements IResRewardOrder
* @constructor
* @param {tutorial.IResRewardOrder=} [properties] Properties to set
*/
function ResRewardOrder(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]];
}
/**
* ResRewardOrder Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResRewardOrder
* @instance
*/
ResRewardOrder.prototype.Code = 0;
/**
* ResRewardOrder Msg.
* @member {string} Msg
* @memberof tutorial.ResRewardOrder
* @instance
*/
ResRewardOrder.prototype.Msg = "";
/**
* Creates a new ResRewardOrder instance using the specified properties.
* @function create
* @memberof tutorial.ResRewardOrder
* @static
* @param {tutorial.IResRewardOrder=} [properties] Properties to set
* @returns {tutorial.ResRewardOrder} ResRewardOrder instance
*/
ResRewardOrder.create = function create(properties) {
return new ResRewardOrder(properties);
};
/**
* Encodes the specified ResRewardOrder message. Does not implicitly {@link tutorial.ResRewardOrder.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRewardOrder
* @static
* @param {tutorial.IResRewardOrder} message ResRewardOrder message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRewardOrder.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResRewardOrder message, length delimited. Does not implicitly {@link tutorial.ResRewardOrder.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRewardOrder
* @static
* @param {tutorial.IResRewardOrder} message ResRewardOrder message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRewardOrder.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRewardOrder message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRewardOrder
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRewardOrder} ResRewardOrder
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRewardOrder.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.ResRewardOrder();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRewardOrder message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRewardOrder
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRewardOrder} ResRewardOrder
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRewardOrder.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRewardOrder message.
* @function verify
* @memberof tutorial.ResRewardOrder
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRewardOrder.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResRewardOrder message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRewardOrder
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRewardOrder} ResRewardOrder
*/
ResRewardOrder.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRewardOrder)
return object;
var message = new $root.tutorial.ResRewardOrder();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResRewardOrder message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRewardOrder
* @static
* @param {tutorial.ResRewardOrder} message ResRewardOrder
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRewardOrder.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResRewardOrder to JSON.
* @function toJSON
* @memberof tutorial.ResRewardOrder
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRewardOrder.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRewardOrder
* @function getTypeUrl
* @memberof tutorial.ResRewardOrder
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRewardOrder.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRewardOrder";
};
return ResRewardOrder;
})();
tutorial.Order = (function() {
/**
* Properties of an Order.
* @memberof tutorial
* @interface IOrder
* @property {number|null} [Id] Order Id
* @property {Array.<number>|null} [ChessId] Order ChessId
* @property {number|null} [type] Order type
*/
/**
* Constructs a new Order.
* @memberof tutorial
* @classdesc Represents an Order.
* @implements IOrder
* @constructor
* @param {tutorial.IOrder=} [properties] Properties to set
*/
function Order(properties) {
this.ChessId = [];
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]];
}
/**
* Order Id.
* @member {number} Id
* @memberof tutorial.Order
* @instance
*/
Order.prototype.Id = 0;
/**
* Order ChessId.
* @member {Array.<number>} ChessId
* @memberof tutorial.Order
* @instance
*/
Order.prototype.ChessId = $util.emptyArray;
/**
* Order type.
* @member {number} type
* @memberof tutorial.Order
* @instance
*/
Order.prototype.type = 0;
/**
* Creates a new Order instance using the specified properties.
* @function create
* @memberof tutorial.Order
* @static
* @param {tutorial.IOrder=} [properties] Properties to set
* @returns {tutorial.Order} Order instance
*/
Order.create = function create(properties) {
return new Order(properties);
};
/**
* Encodes the specified Order message. Does not implicitly {@link tutorial.Order.verify|verify} messages.
* @function encode
* @memberof tutorial.Order
* @static
* @param {tutorial.IOrder} message Order message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Order.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.ChessId != null && message.ChessId.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.ChessId.length; ++i)
writer.int32(message.ChessId[i]);
writer.ldelim();
}
if (message.type != null && Object.hasOwnProperty.call(message, "type"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type);
return writer;
};
/**
* Encodes the specified Order message, length delimited. Does not implicitly {@link tutorial.Order.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.Order
* @static
* @param {tutorial.IOrder} message Order message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Order.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an Order message from the specified reader or buffer.
* @function decode
* @memberof tutorial.Order
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.Order} Order
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Order.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.Order();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
if (!(message.ChessId && message.ChessId.length))
message.ChessId = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ChessId.push(reader.int32());
} else
message.ChessId.push(reader.int32());
break;
}
case 3: {
message.type = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an Order message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.Order
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.Order} Order
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Order.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an Order message.
* @function verify
* @memberof tutorial.Order
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Order.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))
return "Id: integer expected";
if (message.ChessId != null && message.hasOwnProperty("ChessId")) {
if (!Array.isArray(message.ChessId))
return "ChessId: array expected";
for (var i = 0; i < message.ChessId.length; ++i)
if (!$util.isInteger(message.ChessId[i]))
return "ChessId: integer[] expected";
}
if (message.type != null && message.hasOwnProperty("type"))
if (!$util.isInteger(message.type))
return "type: integer expected";
return null;
};
/**
* Creates an Order message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.Order
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.Order} Order
*/
Order.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.Order)
return object;
var message = new $root.tutorial.Order();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.ChessId) {
if (!Array.isArray(object.ChessId))
throw TypeError(".tutorial.Order.ChessId: array expected");
message.ChessId = [];
for (var i = 0; i < object.ChessId.length; ++i)
message.ChessId[i] = object.ChessId[i] | 0;
}
if (object.type != null)
message.type = object.type | 0;
return message;
};
/**
* Creates a plain object from an Order message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.Order
* @static
* @param {tutorial.Order} message Order
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Order.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.ChessId = [];
if (options.defaults) {
object.Id = 0;
object.type = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.ChessId && message.ChessId.length) {
object.ChessId = [];
for (var j = 0; j < message.ChessId.length; ++j)
object.ChessId[j] = message.ChessId[j];
}
if (message.type != null && message.hasOwnProperty("type"))
object.type = message.type;
return object;
};
/**
* Converts this Order to JSON.
* @function toJSON
* @memberof tutorial.Order
* @instance
* @returns {Object.<string,*>} JSON object
*/
Order.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for Order
* @function getTypeUrl
* @memberof tutorial.Order
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Order.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.Order";
};
return Order;
})();
tutorial.ResOrderList = (function() {
/**
* Properties of a ResOrderList.
* @memberof tutorial
* @interface IResOrderList
* @property {Array.<tutorial.IOrder>|null} [OrderList] ResOrderList OrderList
*/
/**
* Constructs a new ResOrderList.
* @memberof tutorial
* @classdesc Represents a ResOrderList.
* @implements IResOrderList
* @constructor
* @param {tutorial.IResOrderList=} [properties] Properties to set
*/
function ResOrderList(properties) {
this.OrderList = [];
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]];
}
/**
* ResOrderList OrderList.
* @member {Array.<tutorial.IOrder>} OrderList
* @memberof tutorial.ResOrderList
* @instance
*/
ResOrderList.prototype.OrderList = $util.emptyArray;
/**
* Creates a new ResOrderList instance using the specified properties.
* @function create
* @memberof tutorial.ResOrderList
* @static
* @param {tutorial.IResOrderList=} [properties] Properties to set
* @returns {tutorial.ResOrderList} ResOrderList instance
*/
ResOrderList.create = function create(properties) {
return new ResOrderList(properties);
};
/**
* Encodes the specified ResOrderList message. Does not implicitly {@link tutorial.ResOrderList.verify|verify} messages.
* @function encode
* @memberof tutorial.ResOrderList
* @static
* @param {tutorial.IResOrderList} message ResOrderList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResOrderList.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.OrderList != null && message.OrderList.length)
for (var i = 0; i < message.OrderList.length; ++i)
$root.tutorial.Order.encode(message.OrderList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResOrderList message, length delimited. Does not implicitly {@link tutorial.ResOrderList.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResOrderList
* @static
* @param {tutorial.IResOrderList} message ResOrderList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResOrderList.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResOrderList message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResOrderList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResOrderList} ResOrderList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResOrderList.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.ResOrderList();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.OrderList && message.OrderList.length))
message.OrderList = [];
message.OrderList.push($root.tutorial.Order.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResOrderList message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResOrderList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResOrderList} ResOrderList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResOrderList.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResOrderList message.
* @function verify
* @memberof tutorial.ResOrderList
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResOrderList.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.OrderList != null && message.hasOwnProperty("OrderList")) {
if (!Array.isArray(message.OrderList))
return "OrderList: array expected";
for (var i = 0; i < message.OrderList.length; ++i) {
var error = $root.tutorial.Order.verify(message.OrderList[i]);
if (error)
return "OrderList." + error;
}
}
return null;
};
/**
* Creates a ResOrderList message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResOrderList
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResOrderList} ResOrderList
*/
ResOrderList.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResOrderList)
return object;
var message = new $root.tutorial.ResOrderList();
if (object.OrderList) {
if (!Array.isArray(object.OrderList))
throw TypeError(".tutorial.ResOrderList.OrderList: array expected");
message.OrderList = [];
for (var i = 0; i < object.OrderList.length; ++i) {
if (typeof object.OrderList[i] !== "object")
throw TypeError(".tutorial.ResOrderList.OrderList: object expected");
message.OrderList[i] = $root.tutorial.Order.fromObject(object.OrderList[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResOrderList message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResOrderList
* @static
* @param {tutorial.ResOrderList} message ResOrderList
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResOrderList.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.OrderList = [];
if (message.OrderList && message.OrderList.length) {
object.OrderList = [];
for (var j = 0; j < message.OrderList.length; ++j)
object.OrderList[j] = $root.tutorial.Order.toObject(message.OrderList[j], options);
}
return object;
};
/**
* Converts this ResOrderList to JSON.
* @function toJSON
* @memberof tutorial.ResOrderList
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResOrderList.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResOrderList
* @function getTypeUrl
* @memberof tutorial.ResOrderList
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResOrderList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResOrderList";
};
return ResOrderList;
})();
tutorial.ResDecorateInfo = (function() {
/**
* Properties of a ResDecorateInfo.
* @memberof tutorial
* @interface IResDecorateInfo
* @property {number|null} [AreaId] ResDecorateInfo AreaId
* @property {Array.<number>|null} [mFinishList] ResDecorateInfo mFinishList
*/
/**
* Constructs a new ResDecorateInfo.
* @memberof tutorial
* @classdesc Represents a ResDecorateInfo.
* @implements IResDecorateInfo
* @constructor
* @param {tutorial.IResDecorateInfo=} [properties] Properties to set
*/
function ResDecorateInfo(properties) {
this.mFinishList = [];
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]];
}
/**
* ResDecorateInfo AreaId.
* @member {number} AreaId
* @memberof tutorial.ResDecorateInfo
* @instance
*/
ResDecorateInfo.prototype.AreaId = 0;
/**
* ResDecorateInfo mFinishList.
* @member {Array.<number>} mFinishList
* @memberof tutorial.ResDecorateInfo
* @instance
*/
ResDecorateInfo.prototype.mFinishList = $util.emptyArray;
/**
* Creates a new ResDecorateInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResDecorateInfo
* @static
* @param {tutorial.IResDecorateInfo=} [properties] Properties to set
* @returns {tutorial.ResDecorateInfo} ResDecorateInfo instance
*/
ResDecorateInfo.create = function create(properties) {
return new ResDecorateInfo(properties);
};
/**
* Encodes the specified ResDecorateInfo message. Does not implicitly {@link tutorial.ResDecorateInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResDecorateInfo
* @static
* @param {tutorial.IResDecorateInfo} message ResDecorateInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDecorateInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.AreaId != null && Object.hasOwnProperty.call(message, "AreaId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.AreaId);
if (message.mFinishList != null && message.mFinishList.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.mFinishList.length; ++i)
writer.int32(message.mFinishList[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified ResDecorateInfo message, length delimited. Does not implicitly {@link tutorial.ResDecorateInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResDecorateInfo
* @static
* @param {tutorial.IResDecorateInfo} message ResDecorateInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDecorateInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResDecorateInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResDecorateInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResDecorateInfo} ResDecorateInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDecorateInfo.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.ResDecorateInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.AreaId = reader.int32();
break;
}
case 2: {
if (!(message.mFinishList && message.mFinishList.length))
message.mFinishList = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.mFinishList.push(reader.int32());
} else
message.mFinishList.push(reader.int32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResDecorateInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResDecorateInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResDecorateInfo} ResDecorateInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDecorateInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResDecorateInfo message.
* @function verify
* @memberof tutorial.ResDecorateInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResDecorateInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.AreaId != null && message.hasOwnProperty("AreaId"))
if (!$util.isInteger(message.AreaId))
return "AreaId: integer expected";
if (message.mFinishList != null && message.hasOwnProperty("mFinishList")) {
if (!Array.isArray(message.mFinishList))
return "mFinishList: array expected";
for (var i = 0; i < message.mFinishList.length; ++i)
if (!$util.isInteger(message.mFinishList[i]))
return "mFinishList: integer[] expected";
}
return null;
};
/**
* Creates a ResDecorateInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResDecorateInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResDecorateInfo} ResDecorateInfo
*/
ResDecorateInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResDecorateInfo)
return object;
var message = new $root.tutorial.ResDecorateInfo();
if (object.AreaId != null)
message.AreaId = object.AreaId | 0;
if (object.mFinishList) {
if (!Array.isArray(object.mFinishList))
throw TypeError(".tutorial.ResDecorateInfo.mFinishList: array expected");
message.mFinishList = [];
for (var i = 0; i < object.mFinishList.length; ++i)
message.mFinishList[i] = object.mFinishList[i] | 0;
}
return message;
};
/**
* Creates a plain object from a ResDecorateInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResDecorateInfo
* @static
* @param {tutorial.ResDecorateInfo} message ResDecorateInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResDecorateInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.mFinishList = [];
if (options.defaults)
object.AreaId = 0;
if (message.AreaId != null && message.hasOwnProperty("AreaId"))
object.AreaId = message.AreaId;
if (message.mFinishList && message.mFinishList.length) {
object.mFinishList = [];
for (var j = 0; j < message.mFinishList.length; ++j)
object.mFinishList[j] = message.mFinishList[j];
}
return object;
};
/**
* Converts this ResDecorateInfo to JSON.
* @function toJSON
* @memberof tutorial.ResDecorateInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResDecorateInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResDecorateInfo
* @function getTypeUrl
* @memberof tutorial.ResDecorateInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResDecorateInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResDecorateInfo";
};
return ResDecorateInfo;
})();
tutorial.ReqDecorate = (function() {
/**
* Properties of a ReqDecorate.
* @memberof tutorial
* @interface IReqDecorate
* @property {number|null} [AreaId] ReqDecorate AreaId
* @property {number|null} [DecorateId] ReqDecorate DecorateId
*/
/**
* Constructs a new ReqDecorate.
* @memberof tutorial
* @classdesc Represents a ReqDecorate.
* @implements IReqDecorate
* @constructor
* @param {tutorial.IReqDecorate=} [properties] Properties to set
*/
function ReqDecorate(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]];
}
/**
* ReqDecorate AreaId.
* @member {number} AreaId
* @memberof tutorial.ReqDecorate
* @instance
*/
ReqDecorate.prototype.AreaId = 0;
/**
* ReqDecorate DecorateId.
* @member {number} DecorateId
* @memberof tutorial.ReqDecorate
* @instance
*/
ReqDecorate.prototype.DecorateId = 0;
/**
* Creates a new ReqDecorate instance using the specified properties.
* @function create
* @memberof tutorial.ReqDecorate
* @static
* @param {tutorial.IReqDecorate=} [properties] Properties to set
* @returns {tutorial.ReqDecorate} ReqDecorate instance
*/
ReqDecorate.create = function create(properties) {
return new ReqDecorate(properties);
};
/**
* Encodes the specified ReqDecorate message. Does not implicitly {@link tutorial.ReqDecorate.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqDecorate
* @static
* @param {tutorial.IReqDecorate} message ReqDecorate message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDecorate.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.AreaId != null && Object.hasOwnProperty.call(message, "AreaId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.AreaId);
if (message.DecorateId != null && Object.hasOwnProperty.call(message, "DecorateId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.DecorateId);
return writer;
};
/**
* Encodes the specified ReqDecorate message, length delimited. Does not implicitly {@link tutorial.ReqDecorate.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqDecorate
* @static
* @param {tutorial.IReqDecorate} message ReqDecorate message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDecorate.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqDecorate message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqDecorate
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqDecorate} ReqDecorate
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDecorate.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.ReqDecorate();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.AreaId = reader.int32();
break;
}
case 2: {
message.DecorateId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqDecorate message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqDecorate
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqDecorate} ReqDecorate
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDecorate.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqDecorate message.
* @function verify
* @memberof tutorial.ReqDecorate
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqDecorate.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.AreaId != null && message.hasOwnProperty("AreaId"))
if (!$util.isInteger(message.AreaId))
return "AreaId: integer expected";
if (message.DecorateId != null && message.hasOwnProperty("DecorateId"))
if (!$util.isInteger(message.DecorateId))
return "DecorateId: integer expected";
return null;
};
/**
* Creates a ReqDecorate message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqDecorate
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqDecorate} ReqDecorate
*/
ReqDecorate.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqDecorate)
return object;
var message = new $root.tutorial.ReqDecorate();
if (object.AreaId != null)
message.AreaId = object.AreaId | 0;
if (object.DecorateId != null)
message.DecorateId = object.DecorateId | 0;
return message;
};
/**
* Creates a plain object from a ReqDecorate message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqDecorate
* @static
* @param {tutorial.ReqDecorate} message ReqDecorate
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqDecorate.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.AreaId = 0;
object.DecorateId = 0;
}
if (message.AreaId != null && message.hasOwnProperty("AreaId"))
object.AreaId = message.AreaId;
if (message.DecorateId != null && message.hasOwnProperty("DecorateId"))
object.DecorateId = message.DecorateId;
return object;
};
/**
* Converts this ReqDecorate to JSON.
* @function toJSON
* @memberof tutorial.ReqDecorate
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqDecorate.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqDecorate
* @function getTypeUrl
* @memberof tutorial.ReqDecorate
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqDecorate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqDecorate";
};
return ReqDecorate;
})();
tutorial.ResDecorate = (function() {
/**
* Properties of a ResDecorate.
* @memberof tutorial
* @interface IResDecorate
* @property {tutorial.RES_CODE|null} [Code] ResDecorate Code
* @property {string|null} [Msg] ResDecorate Msg
*/
/**
* Constructs a new ResDecorate.
* @memberof tutorial
* @classdesc Represents a ResDecorate.
* @implements IResDecorate
* @constructor
* @param {tutorial.IResDecorate=} [properties] Properties to set
*/
function ResDecorate(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]];
}
/**
* ResDecorate Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResDecorate
* @instance
*/
ResDecorate.prototype.Code = 0;
/**
* ResDecorate Msg.
* @member {string} Msg
* @memberof tutorial.ResDecorate
* @instance
*/
ResDecorate.prototype.Msg = "";
/**
* Creates a new ResDecorate instance using the specified properties.
* @function create
* @memberof tutorial.ResDecorate
* @static
* @param {tutorial.IResDecorate=} [properties] Properties to set
* @returns {tutorial.ResDecorate} ResDecorate instance
*/
ResDecorate.create = function create(properties) {
return new ResDecorate(properties);
};
/**
* Encodes the specified ResDecorate message. Does not implicitly {@link tutorial.ResDecorate.verify|verify} messages.
* @function encode
* @memberof tutorial.ResDecorate
* @static
* @param {tutorial.IResDecorate} message ResDecorate message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDecorate.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResDecorate message, length delimited. Does not implicitly {@link tutorial.ResDecorate.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResDecorate
* @static
* @param {tutorial.IResDecorate} message ResDecorate message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDecorate.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResDecorate message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResDecorate
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResDecorate} ResDecorate
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDecorate.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.ResDecorate();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResDecorate message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResDecorate
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResDecorate} ResDecorate
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDecorate.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResDecorate message.
* @function verify
* @memberof tutorial.ResDecorate
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResDecorate.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResDecorate message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResDecorate
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResDecorate} ResDecorate
*/
ResDecorate.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResDecorate)
return object;
var message = new $root.tutorial.ResDecorate();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResDecorate message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResDecorate
* @static
* @param {tutorial.ResDecorate} message ResDecorate
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResDecorate.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResDecorate to JSON.
* @function toJSON
* @memberof tutorial.ResDecorate
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResDecorate.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResDecorate
* @function getTypeUrl
* @memberof tutorial.ResDecorate
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResDecorate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResDecorate";
};
return ResDecorate;
})();
tutorial.ReqDecorateAll = (function() {
/**
* Properties of a ReqDecorateAll.
* @memberof tutorial
* @interface IReqDecorateAll
*/
/**
* Constructs a new ReqDecorateAll.
* @memberof tutorial
* @classdesc Represents a ReqDecorateAll.
* @implements IReqDecorateAll
* @constructor
* @param {tutorial.IReqDecorateAll=} [properties] Properties to set
*/
function ReqDecorateAll(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]];
}
/**
* Creates a new ReqDecorateAll instance using the specified properties.
* @function create
* @memberof tutorial.ReqDecorateAll
* @static
* @param {tutorial.IReqDecorateAll=} [properties] Properties to set
* @returns {tutorial.ReqDecorateAll} ReqDecorateAll instance
*/
ReqDecorateAll.create = function create(properties) {
return new ReqDecorateAll(properties);
};
/**
* Encodes the specified ReqDecorateAll message. Does not implicitly {@link tutorial.ReqDecorateAll.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqDecorateAll
* @static
* @param {tutorial.IReqDecorateAll} message ReqDecorateAll message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDecorateAll.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqDecorateAll message, length delimited. Does not implicitly {@link tutorial.ReqDecorateAll.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqDecorateAll
* @static
* @param {tutorial.IReqDecorateAll} message ReqDecorateAll message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDecorateAll.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqDecorateAll message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqDecorateAll
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqDecorateAll} ReqDecorateAll
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDecorateAll.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.ReqDecorateAll();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqDecorateAll message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqDecorateAll
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqDecorateAll} ReqDecorateAll
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDecorateAll.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqDecorateAll message.
* @function verify
* @memberof tutorial.ReqDecorateAll
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqDecorateAll.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqDecorateAll message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqDecorateAll
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqDecorateAll} ReqDecorateAll
*/
ReqDecorateAll.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqDecorateAll)
return object;
return new $root.tutorial.ReqDecorateAll();
};
/**
* Creates a plain object from a ReqDecorateAll message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqDecorateAll
* @static
* @param {tutorial.ReqDecorateAll} message ReqDecorateAll
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqDecorateAll.toObject = function toObject() {
return {};
};
/**
* Converts this ReqDecorateAll to JSON.
* @function toJSON
* @memberof tutorial.ReqDecorateAll
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqDecorateAll.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqDecorateAll
* @function getTypeUrl
* @memberof tutorial.ReqDecorateAll
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqDecorateAll.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqDecorateAll";
};
return ReqDecorateAll;
})();
tutorial.ResDecorateAll = (function() {
/**
* Properties of a ResDecorateAll.
* @memberof tutorial
* @interface IResDecorateAll
* @property {tutorial.RES_CODE|null} [Code] ResDecorateAll Code
* @property {string|null} [Msg] ResDecorateAll Msg
*/
/**
* Constructs a new ResDecorateAll.
* @memberof tutorial
* @classdesc Represents a ResDecorateAll.
* @implements IResDecorateAll
* @constructor
* @param {tutorial.IResDecorateAll=} [properties] Properties to set
*/
function ResDecorateAll(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]];
}
/**
* ResDecorateAll Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResDecorateAll
* @instance
*/
ResDecorateAll.prototype.Code = 0;
/**
* ResDecorateAll Msg.
* @member {string} Msg
* @memberof tutorial.ResDecorateAll
* @instance
*/
ResDecorateAll.prototype.Msg = "";
/**
* Creates a new ResDecorateAll instance using the specified properties.
* @function create
* @memberof tutorial.ResDecorateAll
* @static
* @param {tutorial.IResDecorateAll=} [properties] Properties to set
* @returns {tutorial.ResDecorateAll} ResDecorateAll instance
*/
ResDecorateAll.create = function create(properties) {
return new ResDecorateAll(properties);
};
/**
* Encodes the specified ResDecorateAll message. Does not implicitly {@link tutorial.ResDecorateAll.verify|verify} messages.
* @function encode
* @memberof tutorial.ResDecorateAll
* @static
* @param {tutorial.IResDecorateAll} message ResDecorateAll message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDecorateAll.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResDecorateAll message, length delimited. Does not implicitly {@link tutorial.ResDecorateAll.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResDecorateAll
* @static
* @param {tutorial.IResDecorateAll} message ResDecorateAll message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDecorateAll.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResDecorateAll message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResDecorateAll
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResDecorateAll} ResDecorateAll
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDecorateAll.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.ResDecorateAll();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResDecorateAll message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResDecorateAll
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResDecorateAll} ResDecorateAll
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDecorateAll.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResDecorateAll message.
* @function verify
* @memberof tutorial.ResDecorateAll
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResDecorateAll.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResDecorateAll message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResDecorateAll
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResDecorateAll} ResDecorateAll
*/
ResDecorateAll.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResDecorateAll)
return object;
var message = new $root.tutorial.ResDecorateAll();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResDecorateAll message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResDecorateAll
* @static
* @param {tutorial.ResDecorateAll} message ResDecorateAll
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResDecorateAll.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResDecorateAll to JSON.
* @function toJSON
* @memberof tutorial.ResDecorateAll
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResDecorateAll.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResDecorateAll
* @function getTypeUrl
* @memberof tutorial.ResDecorateAll
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResDecorateAll.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResDecorateAll";
};
return ResDecorateAll;
})();
tutorial.ReqGmCommand = (function() {
/**
* Properties of a ReqGmCommand.
* @memberof tutorial
* @interface IReqGmCommand
* @property {string|null} [Command] ReqGmCommand Command
* @property {string|null} [args] ReqGmCommand args
*/
/**
* Constructs a new ReqGmCommand.
* @memberof tutorial
* @classdesc Represents a ReqGmCommand.
* @implements IReqGmCommand
* @constructor
* @param {tutorial.IReqGmCommand=} [properties] Properties to set
*/
function ReqGmCommand(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]];
}
/**
* ReqGmCommand Command.
* @member {string} Command
* @memberof tutorial.ReqGmCommand
* @instance
*/
ReqGmCommand.prototype.Command = "";
/**
* ReqGmCommand args.
* @member {string} args
* @memberof tutorial.ReqGmCommand
* @instance
*/
ReqGmCommand.prototype.args = "";
/**
* Creates a new ReqGmCommand instance using the specified properties.
* @function create
* @memberof tutorial.ReqGmCommand
* @static
* @param {tutorial.IReqGmCommand=} [properties] Properties to set
* @returns {tutorial.ReqGmCommand} ReqGmCommand instance
*/
ReqGmCommand.create = function create(properties) {
return new ReqGmCommand(properties);
};
/**
* Encodes the specified ReqGmCommand message. Does not implicitly {@link tutorial.ReqGmCommand.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGmCommand
* @static
* @param {tutorial.IReqGmCommand} message ReqGmCommand message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGmCommand.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Command != null && Object.hasOwnProperty.call(message, "Command"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Command);
if (message.args != null && Object.hasOwnProperty.call(message, "args"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.args);
return writer;
};
/**
* Encodes the specified ReqGmCommand message, length delimited. Does not implicitly {@link tutorial.ReqGmCommand.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGmCommand
* @static
* @param {tutorial.IReqGmCommand} message ReqGmCommand message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGmCommand.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGmCommand message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGmCommand
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGmCommand} ReqGmCommand
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGmCommand.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.ReqGmCommand();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Command = reader.string();
break;
}
case 2: {
message.args = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGmCommand message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGmCommand
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGmCommand} ReqGmCommand
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGmCommand.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGmCommand message.
* @function verify
* @memberof tutorial.ReqGmCommand
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGmCommand.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Command != null && message.hasOwnProperty("Command"))
if (!$util.isString(message.Command))
return "Command: string expected";
if (message.args != null && message.hasOwnProperty("args"))
if (!$util.isString(message.args))
return "args: string expected";
return null;
};
/**
* Creates a ReqGmCommand message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGmCommand
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGmCommand} ReqGmCommand
*/
ReqGmCommand.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGmCommand)
return object;
var message = new $root.tutorial.ReqGmCommand();
if (object.Command != null)
message.Command = String(object.Command);
if (object.args != null)
message.args = String(object.args);
return message;
};
/**
* Creates a plain object from a ReqGmCommand message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGmCommand
* @static
* @param {tutorial.ReqGmCommand} message ReqGmCommand
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGmCommand.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Command = "";
object.args = "";
}
if (message.Command != null && message.hasOwnProperty("Command"))
object.Command = message.Command;
if (message.args != null && message.hasOwnProperty("args"))
object.args = message.args;
return object;
};
/**
* Converts this ReqGmCommand to JSON.
* @function toJSON
* @memberof tutorial.ReqGmCommand
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGmCommand.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGmCommand
* @function getTypeUrl
* @memberof tutorial.ReqGmCommand
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGmCommand.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGmCommand";
};
return ReqGmCommand;
})();
tutorial.Card = (function() {
/**
* Properties of a Card.
* @memberof tutorial
* @interface ICard
* @property {number|null} [Id] Card Id
* @property {number|null} [Count] Card Count
*/
/**
* Constructs a new Card.
* @memberof tutorial
* @classdesc Represents a Card.
* @implements ICard
* @constructor
* @param {tutorial.ICard=} [properties] Properties to set
*/
function Card(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]];
}
/**
* Card Id.
* @member {number} Id
* @memberof tutorial.Card
* @instance
*/
Card.prototype.Id = 0;
/**
* Card Count.
* @member {number} Count
* @memberof tutorial.Card
* @instance
*/
Card.prototype.Count = 0;
/**
* Creates a new Card instance using the specified properties.
* @function create
* @memberof tutorial.Card
* @static
* @param {tutorial.ICard=} [properties] Properties to set
* @returns {tutorial.Card} Card instance
*/
Card.create = function create(properties) {
return new Card(properties);
};
/**
* Encodes the specified Card message. Does not implicitly {@link tutorial.Card.verify|verify} messages.
* @function encode
* @memberof tutorial.Card
* @static
* @param {tutorial.ICard} message Card message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Card.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Count != null && Object.hasOwnProperty.call(message, "Count"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Count);
return writer;
};
/**
* Encodes the specified Card message, length delimited. Does not implicitly {@link tutorial.Card.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.Card
* @static
* @param {tutorial.ICard} message Card message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Card.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a Card message from the specified reader or buffer.
* @function decode
* @memberof tutorial.Card
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.Card} Card
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Card.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.Card();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Count = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a Card message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.Card
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.Card} Card
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Card.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a Card message.
* @function verify
* @memberof tutorial.Card
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Card.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))
return "Id: integer expected";
if (message.Count != null && message.hasOwnProperty("Count"))
if (!$util.isInteger(message.Count))
return "Count: integer expected";
return null;
};
/**
* Creates a Card message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.Card
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.Card} Card
*/
Card.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.Card)
return object;
var message = new $root.tutorial.Card();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Count != null)
message.Count = object.Count | 0;
return message;
};
/**
* Creates a plain object from a Card message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.Card
* @static
* @param {tutorial.Card} message Card
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Card.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.Count = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Count != null && message.hasOwnProperty("Count"))
object.Count = message.Count;
return object;
};
/**
* Converts this Card to JSON.
* @function toJSON
* @memberof tutorial.Card
* @instance
* @returns {Object.<string,*>} JSON object
*/
Card.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for Card
* @function getTypeUrl
* @memberof tutorial.Card
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Card.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.Card";
};
return Card;
})();
tutorial.ReqCardInfo = (function() {
/**
* Properties of a ReqCardInfo.
* @memberof tutorial
* @interface IReqCardInfo
*/
/**
* Constructs a new ReqCardInfo.
* @memberof tutorial
* @classdesc Represents a ReqCardInfo.
* @implements IReqCardInfo
* @constructor
* @param {tutorial.IReqCardInfo=} [properties] Properties to set
*/
function ReqCardInfo(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]];
}
/**
* Creates a new ReqCardInfo instance using the specified properties.
* @function create
* @memberof tutorial.ReqCardInfo
* @static
* @param {tutorial.IReqCardInfo=} [properties] Properties to set
* @returns {tutorial.ReqCardInfo} ReqCardInfo instance
*/
ReqCardInfo.create = function create(properties) {
return new ReqCardInfo(properties);
};
/**
* Encodes the specified ReqCardInfo message. Does not implicitly {@link tutorial.ReqCardInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqCardInfo
* @static
* @param {tutorial.IReqCardInfo} message ReqCardInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqCardInfo message, length delimited. Does not implicitly {@link tutorial.ReqCardInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqCardInfo
* @static
* @param {tutorial.IReqCardInfo} message ReqCardInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqCardInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqCardInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqCardInfo} ReqCardInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardInfo.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.ReqCardInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqCardInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqCardInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqCardInfo} ReqCardInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqCardInfo message.
* @function verify
* @memberof tutorial.ReqCardInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqCardInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqCardInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqCardInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqCardInfo} ReqCardInfo
*/
ReqCardInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqCardInfo)
return object;
return new $root.tutorial.ReqCardInfo();
};
/**
* Creates a plain object from a ReqCardInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqCardInfo
* @static
* @param {tutorial.ReqCardInfo} message ReqCardInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqCardInfo.toObject = function toObject() {
return {};
};
/**
* Converts this ReqCardInfo to JSON.
* @function toJSON
* @memberof tutorial.ReqCardInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqCardInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqCardInfo
* @function getTypeUrl
* @memberof tutorial.ReqCardInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqCardInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqCardInfo";
};
return ReqCardInfo;
})();
tutorial.ResCardInfo = (function() {
/**
* Properties of a ResCardInfo.
* @memberof tutorial
* @interface IResCardInfo
* @property {Array.<tutorial.ICard>|null} [CardList] ResCardInfo CardList
* @property {number|null} [ExStar] ResCardInfo ExStar
* @property {number|null} [Status] ResCardInfo Status
* @property {Array.<number>|null} [CollectId] ResCardInfo CollectId
* @property {number|null} [ExTimes] ResCardInfo ExTimes
* @property {number|null} [ReqTimes] ResCardInfo ReqTimes
* @property {Object.<string,number>|null} [AllCard] ResCardInfo AllCard
* @property {number|null} [EndTime] ResCardInfo EndTime
* @property {Array.<number>|null} [ReqUid] ResCardInfo ReqUid
* @property {Array.<number>|null} [ExUid] ResCardInfo ExUid
* @property {number|null} [GoldTimes] ResCardInfo GoldTimes
* @property {number|null} [Round] ResCardInfo Round
*/
/**
* Constructs a new ResCardInfo.
* @memberof tutorial
* @classdesc Represents a ResCardInfo.
* @implements IResCardInfo
* @constructor
* @param {tutorial.IResCardInfo=} [properties] Properties to set
*/
function ResCardInfo(properties) {
this.CardList = [];
this.CollectId = [];
this.AllCard = {};
this.ReqUid = [];
this.ExUid = [];
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]];
}
/**
* ResCardInfo CardList.
* @member {Array.<tutorial.ICard>} CardList
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.CardList = $util.emptyArray;
/**
* ResCardInfo ExStar.
* @member {number} ExStar
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.ExStar = 0;
/**
* ResCardInfo Status.
* @member {number} Status
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.Status = 0;
/**
* ResCardInfo CollectId.
* @member {Array.<number>} CollectId
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.CollectId = $util.emptyArray;
/**
* ResCardInfo ExTimes.
* @member {number} ExTimes
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.ExTimes = 0;
/**
* ResCardInfo ReqTimes.
* @member {number} ReqTimes
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.ReqTimes = 0;
/**
* ResCardInfo AllCard.
* @member {Object.<string,number>} AllCard
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.AllCard = $util.emptyObject;
/**
* ResCardInfo EndTime.
* @member {number} EndTime
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.EndTime = 0;
/**
* ResCardInfo ReqUid.
* @member {Array.<number>} ReqUid
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.ReqUid = $util.emptyArray;
/**
* ResCardInfo ExUid.
* @member {Array.<number>} ExUid
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.ExUid = $util.emptyArray;
/**
* ResCardInfo GoldTimes.
* @member {number} GoldTimes
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.GoldTimes = 0;
/**
* ResCardInfo Round.
* @member {number} Round
* @memberof tutorial.ResCardInfo
* @instance
*/
ResCardInfo.prototype.Round = 0;
/**
* Creates a new ResCardInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResCardInfo
* @static
* @param {tutorial.IResCardInfo=} [properties] Properties to set
* @returns {tutorial.ResCardInfo} ResCardInfo instance
*/
ResCardInfo.create = function create(properties) {
return new ResCardInfo(properties);
};
/**
* Encodes the specified ResCardInfo message. Does not implicitly {@link tutorial.ResCardInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResCardInfo
* @static
* @param {tutorial.IResCardInfo} message ResCardInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.CardList != null && message.CardList.length)
for (var i = 0; i < message.CardList.length; ++i)
$root.tutorial.Card.encode(message.CardList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.ExStar != null && Object.hasOwnProperty.call(message, "ExStar"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ExStar);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Status);
if (message.CollectId != null && message.CollectId.length) {
writer.uint32(/* id 4, wireType 2 =*/34).fork();
for (var i = 0; i < message.CollectId.length; ++i)
writer.int32(message.CollectId[i]);
writer.ldelim();
}
if (message.ExTimes != null && Object.hasOwnProperty.call(message, "ExTimes"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ExTimes);
if (message.ReqTimes != null && Object.hasOwnProperty.call(message, "ReqTimes"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.ReqTimes);
if (message.AllCard != null && Object.hasOwnProperty.call(message, "AllCard"))
for (var keys = Object.keys(message.AllCard), i = 0; i < keys.length; ++i)
writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.AllCard[keys[i]]).ldelim();
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.EndTime);
if (message.ReqUid != null && message.ReqUid.length) {
writer.uint32(/* id 9, wireType 2 =*/74).fork();
for (var i = 0; i < message.ReqUid.length; ++i)
writer.int32(message.ReqUid[i]);
writer.ldelim();
}
if (message.ExUid != null && message.ExUid.length) {
writer.uint32(/* id 10, wireType 2 =*/82).fork();
for (var i = 0; i < message.ExUid.length; ++i)
writer.int32(message.ExUid[i]);
writer.ldelim();
}
if (message.GoldTimes != null && Object.hasOwnProperty.call(message, "GoldTimes"))
writer.uint32(/* id 11, wireType 0 =*/88).int32(message.GoldTimes);
if (message.Round != null && Object.hasOwnProperty.call(message, "Round"))
writer.uint32(/* id 12, wireType 0 =*/96).int32(message.Round);
return writer;
};
/**
* Encodes the specified ResCardInfo message, length delimited. Does not implicitly {@link tutorial.ResCardInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResCardInfo
* @static
* @param {tutorial.IResCardInfo} message ResCardInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResCardInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResCardInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResCardInfo} ResCardInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardInfo.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.ResCardInfo(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.CardList && message.CardList.length))
message.CardList = [];
message.CardList.push($root.tutorial.Card.decode(reader, reader.uint32()));
break;
}
case 2: {
message.ExStar = reader.int32();
break;
}
case 3: {
message.Status = reader.int32();
break;
}
case 4: {
if (!(message.CollectId && message.CollectId.length))
message.CollectId = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.CollectId.push(reader.int32());
} else
message.CollectId.push(reader.int32());
break;
}
case 5: {
message.ExTimes = reader.int32();
break;
}
case 6: {
message.ReqTimes = reader.int32();
break;
}
case 7: {
if (message.AllCard === $util.emptyObject)
message.AllCard = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.AllCard[key] = value;
break;
}
case 8: {
message.EndTime = reader.int32();
break;
}
case 9: {
if (!(message.ReqUid && message.ReqUid.length))
message.ReqUid = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ReqUid.push(reader.int32());
} else
message.ReqUid.push(reader.int32());
break;
}
case 10: {
if (!(message.ExUid && message.ExUid.length))
message.ExUid = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ExUid.push(reader.int32());
} else
message.ExUid.push(reader.int32());
break;
}
case 11: {
message.GoldTimes = reader.int32();
break;
}
case 12: {
message.Round = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResCardInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResCardInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResCardInfo} ResCardInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResCardInfo message.
* @function verify
* @memberof tutorial.ResCardInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResCardInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.CardList != null && message.hasOwnProperty("CardList")) {
if (!Array.isArray(message.CardList))
return "CardList: array expected";
for (var i = 0; i < message.CardList.length; ++i) {
var error = $root.tutorial.Card.verify(message.CardList[i]);
if (error)
return "CardList." + error;
}
}
if (message.ExStar != null && message.hasOwnProperty("ExStar"))
if (!$util.isInteger(message.ExStar))
return "ExStar: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.CollectId != null && message.hasOwnProperty("CollectId")) {
if (!Array.isArray(message.CollectId))
return "CollectId: array expected";
for (var i = 0; i < message.CollectId.length; ++i)
if (!$util.isInteger(message.CollectId[i]))
return "CollectId: integer[] expected";
}
if (message.ExTimes != null && message.hasOwnProperty("ExTimes"))
if (!$util.isInteger(message.ExTimes))
return "ExTimes: integer expected";
if (message.ReqTimes != null && message.hasOwnProperty("ReqTimes"))
if (!$util.isInteger(message.ReqTimes))
return "ReqTimes: integer expected";
if (message.AllCard != null && message.hasOwnProperty("AllCard")) {
if (!$util.isObject(message.AllCard))
return "AllCard: object expected";
var key = Object.keys(message.AllCard);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "AllCard: integer key{k:int32} expected";
if (!$util.isInteger(message.AllCard[key[i]]))
return "AllCard: integer{k:int32} expected";
}
}
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
if (message.ReqUid != null && message.hasOwnProperty("ReqUid")) {
if (!Array.isArray(message.ReqUid))
return "ReqUid: array expected";
for (var i = 0; i < message.ReqUid.length; ++i)
if (!$util.isInteger(message.ReqUid[i]))
return "ReqUid: integer[] expected";
}
if (message.ExUid != null && message.hasOwnProperty("ExUid")) {
if (!Array.isArray(message.ExUid))
return "ExUid: array expected";
for (var i = 0; i < message.ExUid.length; ++i)
if (!$util.isInteger(message.ExUid[i]))
return "ExUid: integer[] expected";
}
if (message.GoldTimes != null && message.hasOwnProperty("GoldTimes"))
if (!$util.isInteger(message.GoldTimes))
return "GoldTimes: integer expected";
if (message.Round != null && message.hasOwnProperty("Round"))
if (!$util.isInteger(message.Round))
return "Round: integer expected";
return null;
};
/**
* Creates a ResCardInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResCardInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResCardInfo} ResCardInfo
*/
ResCardInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResCardInfo)
return object;
var message = new $root.tutorial.ResCardInfo();
if (object.CardList) {
if (!Array.isArray(object.CardList))
throw TypeError(".tutorial.ResCardInfo.CardList: array expected");
message.CardList = [];
for (var i = 0; i < object.CardList.length; ++i) {
if (typeof object.CardList[i] !== "object")
throw TypeError(".tutorial.ResCardInfo.CardList: object expected");
message.CardList[i] = $root.tutorial.Card.fromObject(object.CardList[i]);
}
}
if (object.ExStar != null)
message.ExStar = object.ExStar | 0;
if (object.Status != null)
message.Status = object.Status | 0;
if (object.CollectId) {
if (!Array.isArray(object.CollectId))
throw TypeError(".tutorial.ResCardInfo.CollectId: array expected");
message.CollectId = [];
for (var i = 0; i < object.CollectId.length; ++i)
message.CollectId[i] = object.CollectId[i] | 0;
}
if (object.ExTimes != null)
message.ExTimes = object.ExTimes | 0;
if (object.ReqTimes != null)
message.ReqTimes = object.ReqTimes | 0;
if (object.AllCard) {
if (typeof object.AllCard !== "object")
throw TypeError(".tutorial.ResCardInfo.AllCard: object expected");
message.AllCard = {};
for (var keys = Object.keys(object.AllCard), i = 0; i < keys.length; ++i)
message.AllCard[keys[i]] = object.AllCard[keys[i]] | 0;
}
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
if (object.ReqUid) {
if (!Array.isArray(object.ReqUid))
throw TypeError(".tutorial.ResCardInfo.ReqUid: array expected");
message.ReqUid = [];
for (var i = 0; i < object.ReqUid.length; ++i)
message.ReqUid[i] = object.ReqUid[i] | 0;
}
if (object.ExUid) {
if (!Array.isArray(object.ExUid))
throw TypeError(".tutorial.ResCardInfo.ExUid: array expected");
message.ExUid = [];
for (var i = 0; i < object.ExUid.length; ++i)
message.ExUid[i] = object.ExUid[i] | 0;
}
if (object.GoldTimes != null)
message.GoldTimes = object.GoldTimes | 0;
if (object.Round != null)
message.Round = object.Round | 0;
return message;
};
/**
* Creates a plain object from a ResCardInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResCardInfo
* @static
* @param {tutorial.ResCardInfo} message ResCardInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResCardInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.CardList = [];
object.CollectId = [];
object.ReqUid = [];
object.ExUid = [];
}
if (options.objects || options.defaults)
object.AllCard = {};
if (options.defaults) {
object.ExStar = 0;
object.Status = 0;
object.ExTimes = 0;
object.ReqTimes = 0;
object.EndTime = 0;
object.GoldTimes = 0;
object.Round = 0;
}
if (message.CardList && message.CardList.length) {
object.CardList = [];
for (var j = 0; j < message.CardList.length; ++j)
object.CardList[j] = $root.tutorial.Card.toObject(message.CardList[j], options);
}
if (message.ExStar != null && message.hasOwnProperty("ExStar"))
object.ExStar = message.ExStar;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.CollectId && message.CollectId.length) {
object.CollectId = [];
for (var j = 0; j < message.CollectId.length; ++j)
object.CollectId[j] = message.CollectId[j];
}
if (message.ExTimes != null && message.hasOwnProperty("ExTimes"))
object.ExTimes = message.ExTimes;
if (message.ReqTimes != null && message.hasOwnProperty("ReqTimes"))
object.ReqTimes = message.ReqTimes;
var keys2;
if (message.AllCard && (keys2 = Object.keys(message.AllCard)).length) {
object.AllCard = {};
for (var j = 0; j < keys2.length; ++j)
object.AllCard[keys2[j]] = message.AllCard[keys2[j]];
}
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
if (message.ReqUid && message.ReqUid.length) {
object.ReqUid = [];
for (var j = 0; j < message.ReqUid.length; ++j)
object.ReqUid[j] = message.ReqUid[j];
}
if (message.ExUid && message.ExUid.length) {
object.ExUid = [];
for (var j = 0; j < message.ExUid.length; ++j)
object.ExUid[j] = message.ExUid[j];
}
if (message.GoldTimes != null && message.hasOwnProperty("GoldTimes"))
object.GoldTimes = message.GoldTimes;
if (message.Round != null && message.hasOwnProperty("Round"))
object.Round = message.Round;
return object;
};
/**
* Converts this ResCardInfo to JSON.
* @function toJSON
* @memberof tutorial.ResCardInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResCardInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResCardInfo
* @function getTypeUrl
* @memberof tutorial.ResCardInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResCardInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResCardInfo";
};
return ResCardInfo;
})();
tutorial.ResNotifyCardTimes = (function() {
/**
* Properties of a ResNotifyCardTimes.
* @memberof tutorial
* @interface IResNotifyCardTimes
* @property {number|null} [ExTimes] ResNotifyCardTimes ExTimes
* @property {number|null} [ReqTimes] ResNotifyCardTimes ReqTimes
* @property {Array.<number>|null} [ReqUid] ResNotifyCardTimes ReqUid
* @property {Array.<number>|null} [ExUid] ResNotifyCardTimes ExUid
* @property {number|null} [GoldTimes] ResNotifyCardTimes GoldTimes
*/
/**
* Constructs a new ResNotifyCardTimes.
* @memberof tutorial
* @classdesc Represents a ResNotifyCardTimes.
* @implements IResNotifyCardTimes
* @constructor
* @param {tutorial.IResNotifyCardTimes=} [properties] Properties to set
*/
function ResNotifyCardTimes(properties) {
this.ReqUid = [];
this.ExUid = [];
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]];
}
/**
* ResNotifyCardTimes ExTimes.
* @member {number} ExTimes
* @memberof tutorial.ResNotifyCardTimes
* @instance
*/
ResNotifyCardTimes.prototype.ExTimes = 0;
/**
* ResNotifyCardTimes ReqTimes.
* @member {number} ReqTimes
* @memberof tutorial.ResNotifyCardTimes
* @instance
*/
ResNotifyCardTimes.prototype.ReqTimes = 0;
/**
* ResNotifyCardTimes ReqUid.
* @member {Array.<number>} ReqUid
* @memberof tutorial.ResNotifyCardTimes
* @instance
*/
ResNotifyCardTimes.prototype.ReqUid = $util.emptyArray;
/**
* ResNotifyCardTimes ExUid.
* @member {Array.<number>} ExUid
* @memberof tutorial.ResNotifyCardTimes
* @instance
*/
ResNotifyCardTimes.prototype.ExUid = $util.emptyArray;
/**
* ResNotifyCardTimes GoldTimes.
* @member {number} GoldTimes
* @memberof tutorial.ResNotifyCardTimes
* @instance
*/
ResNotifyCardTimes.prototype.GoldTimes = 0;
/**
* Creates a new ResNotifyCardTimes instance using the specified properties.
* @function create
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {tutorial.IResNotifyCardTimes=} [properties] Properties to set
* @returns {tutorial.ResNotifyCardTimes} ResNotifyCardTimes instance
*/
ResNotifyCardTimes.create = function create(properties) {
return new ResNotifyCardTimes(properties);
};
/**
* Encodes the specified ResNotifyCardTimes message. Does not implicitly {@link tutorial.ResNotifyCardTimes.verify|verify} messages.
* @function encode
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {tutorial.IResNotifyCardTimes} message ResNotifyCardTimes message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResNotifyCardTimes.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ExTimes != null && Object.hasOwnProperty.call(message, "ExTimes"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ExTimes);
if (message.ReqTimes != null && Object.hasOwnProperty.call(message, "ReqTimes"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ReqTimes);
if (message.ReqUid != null && message.ReqUid.length) {
writer.uint32(/* id 3, wireType 2 =*/26).fork();
for (var i = 0; i < message.ReqUid.length; ++i)
writer.int32(message.ReqUid[i]);
writer.ldelim();
}
if (message.ExUid != null && message.ExUid.length) {
writer.uint32(/* id 4, wireType 2 =*/34).fork();
for (var i = 0; i < message.ExUid.length; ++i)
writer.int32(message.ExUid[i]);
writer.ldelim();
}
if (message.GoldTimes != null && Object.hasOwnProperty.call(message, "GoldTimes"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.GoldTimes);
return writer;
};
/**
* Encodes the specified ResNotifyCardTimes message, length delimited. Does not implicitly {@link tutorial.ResNotifyCardTimes.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {tutorial.IResNotifyCardTimes} message ResNotifyCardTimes message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResNotifyCardTimes.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResNotifyCardTimes message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResNotifyCardTimes} ResNotifyCardTimes
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResNotifyCardTimes.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.ResNotifyCardTimes();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ExTimes = reader.int32();
break;
}
case 2: {
message.ReqTimes = reader.int32();
break;
}
case 3: {
if (!(message.ReqUid && message.ReqUid.length))
message.ReqUid = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ReqUid.push(reader.int32());
} else
message.ReqUid.push(reader.int32());
break;
}
case 4: {
if (!(message.ExUid && message.ExUid.length))
message.ExUid = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.ExUid.push(reader.int32());
} else
message.ExUid.push(reader.int32());
break;
}
case 5: {
message.GoldTimes = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResNotifyCardTimes message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResNotifyCardTimes} ResNotifyCardTimes
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResNotifyCardTimes.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResNotifyCardTimes message.
* @function verify
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResNotifyCardTimes.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ExTimes != null && message.hasOwnProperty("ExTimes"))
if (!$util.isInteger(message.ExTimes))
return "ExTimes: integer expected";
if (message.ReqTimes != null && message.hasOwnProperty("ReqTimes"))
if (!$util.isInteger(message.ReqTimes))
return "ReqTimes: integer expected";
if (message.ReqUid != null && message.hasOwnProperty("ReqUid")) {
if (!Array.isArray(message.ReqUid))
return "ReqUid: array expected";
for (var i = 0; i < message.ReqUid.length; ++i)
if (!$util.isInteger(message.ReqUid[i]))
return "ReqUid: integer[] expected";
}
if (message.ExUid != null && message.hasOwnProperty("ExUid")) {
if (!Array.isArray(message.ExUid))
return "ExUid: array expected";
for (var i = 0; i < message.ExUid.length; ++i)
if (!$util.isInteger(message.ExUid[i]))
return "ExUid: integer[] expected";
}
if (message.GoldTimes != null && message.hasOwnProperty("GoldTimes"))
if (!$util.isInteger(message.GoldTimes))
return "GoldTimes: integer expected";
return null;
};
/**
* Creates a ResNotifyCardTimes message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResNotifyCardTimes} ResNotifyCardTimes
*/
ResNotifyCardTimes.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResNotifyCardTimes)
return object;
var message = new $root.tutorial.ResNotifyCardTimes();
if (object.ExTimes != null)
message.ExTimes = object.ExTimes | 0;
if (object.ReqTimes != null)
message.ReqTimes = object.ReqTimes | 0;
if (object.ReqUid) {
if (!Array.isArray(object.ReqUid))
throw TypeError(".tutorial.ResNotifyCardTimes.ReqUid: array expected");
message.ReqUid = [];
for (var i = 0; i < object.ReqUid.length; ++i)
message.ReqUid[i] = object.ReqUid[i] | 0;
}
if (object.ExUid) {
if (!Array.isArray(object.ExUid))
throw TypeError(".tutorial.ResNotifyCardTimes.ExUid: array expected");
message.ExUid = [];
for (var i = 0; i < object.ExUid.length; ++i)
message.ExUid[i] = object.ExUid[i] | 0;
}
if (object.GoldTimes != null)
message.GoldTimes = object.GoldTimes | 0;
return message;
};
/**
* Creates a plain object from a ResNotifyCardTimes message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {tutorial.ResNotifyCardTimes} message ResNotifyCardTimes
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResNotifyCardTimes.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.ReqUid = [];
object.ExUid = [];
}
if (options.defaults) {
object.ExTimes = 0;
object.ReqTimes = 0;
object.GoldTimes = 0;
}
if (message.ExTimes != null && message.hasOwnProperty("ExTimes"))
object.ExTimes = message.ExTimes;
if (message.ReqTimes != null && message.hasOwnProperty("ReqTimes"))
object.ReqTimes = message.ReqTimes;
if (message.ReqUid && message.ReqUid.length) {
object.ReqUid = [];
for (var j = 0; j < message.ReqUid.length; ++j)
object.ReqUid[j] = message.ReqUid[j];
}
if (message.ExUid && message.ExUid.length) {
object.ExUid = [];
for (var j = 0; j < message.ExUid.length; ++j)
object.ExUid[j] = message.ExUid[j];
}
if (message.GoldTimes != null && message.hasOwnProperty("GoldTimes"))
object.GoldTimes = message.GoldTimes;
return object;
};
/**
* Converts this ResNotifyCardTimes to JSON.
* @function toJSON
* @memberof tutorial.ResNotifyCardTimes
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResNotifyCardTimes.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResNotifyCardTimes
* @function getTypeUrl
* @memberof tutorial.ResNotifyCardTimes
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResNotifyCardTimes.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResNotifyCardTimes";
};
return ResNotifyCardTimes;
})();
tutorial.ReqMasterCard = (function() {
/**
* Properties of a ReqMasterCard.
* @memberof tutorial
* @interface IReqMasterCard
* @property {number|null} [Id] ReqMasterCard Id
* @property {number|null} [CardId] ReqMasterCard CardId
*/
/**
* Constructs a new ReqMasterCard.
* @memberof tutorial
* @classdesc Represents a ReqMasterCard.
* @implements IReqMasterCard
* @constructor
* @param {tutorial.IReqMasterCard=} [properties] Properties to set
*/
function ReqMasterCard(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]];
}
/**
* ReqMasterCard Id.
* @member {number} Id
* @memberof tutorial.ReqMasterCard
* @instance
*/
ReqMasterCard.prototype.Id = 0;
/**
* ReqMasterCard CardId.
* @member {number} CardId
* @memberof tutorial.ReqMasterCard
* @instance
*/
ReqMasterCard.prototype.CardId = 0;
/**
* Creates a new ReqMasterCard instance using the specified properties.
* @function create
* @memberof tutorial.ReqMasterCard
* @static
* @param {tutorial.IReqMasterCard=} [properties] Properties to set
* @returns {tutorial.ReqMasterCard} ReqMasterCard instance
*/
ReqMasterCard.create = function create(properties) {
return new ReqMasterCard(properties);
};
/**
* Encodes the specified ReqMasterCard message. Does not implicitly {@link tutorial.ReqMasterCard.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqMasterCard
* @static
* @param {tutorial.IReqMasterCard} message ReqMasterCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMasterCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.CardId);
return writer;
};
/**
* Encodes the specified ReqMasterCard message, length delimited. Does not implicitly {@link tutorial.ReqMasterCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqMasterCard
* @static
* @param {tutorial.IReqMasterCard} message ReqMasterCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMasterCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqMasterCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqMasterCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqMasterCard} ReqMasterCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMasterCard.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.ReqMasterCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.CardId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqMasterCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqMasterCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqMasterCard} ReqMasterCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMasterCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqMasterCard message.
* @function verify
* @memberof tutorial.ReqMasterCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqMasterCard.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))
return "Id: integer expected";
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
return null;
};
/**
* Creates a ReqMasterCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqMasterCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqMasterCard} ReqMasterCard
*/
ReqMasterCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqMasterCard)
return object;
var message = new $root.tutorial.ReqMasterCard();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.CardId != null)
message.CardId = object.CardId | 0;
return message;
};
/**
* Creates a plain object from a ReqMasterCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqMasterCard
* @static
* @param {tutorial.ReqMasterCard} message ReqMasterCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqMasterCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.CardId = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
return object;
};
/**
* Converts this ReqMasterCard to JSON.
* @function toJSON
* @memberof tutorial.ReqMasterCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqMasterCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqMasterCard
* @function getTypeUrl
* @memberof tutorial.ReqMasterCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqMasterCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqMasterCard";
};
return ReqMasterCard;
})();
tutorial.ResMasterCard = (function() {
/**
* Properties of a ResMasterCard.
* @memberof tutorial
* @interface IResMasterCard
* @property {tutorial.RES_CODE|null} [Code] ResMasterCard Code
* @property {string|null} [Msg] ResMasterCard Msg
* @property {number|null} [MasterId] ResMasterCard MasterId
* @property {number|null} [CardId] ResMasterCard CardId
*/
/**
* Constructs a new ResMasterCard.
* @memberof tutorial
* @classdesc Represents a ResMasterCard.
* @implements IResMasterCard
* @constructor
* @param {tutorial.IResMasterCard=} [properties] Properties to set
*/
function ResMasterCard(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]];
}
/**
* ResMasterCard Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResMasterCard
* @instance
*/
ResMasterCard.prototype.Code = 0;
/**
* ResMasterCard Msg.
* @member {string} Msg
* @memberof tutorial.ResMasterCard
* @instance
*/
ResMasterCard.prototype.Msg = "";
/**
* ResMasterCard MasterId.
* @member {number} MasterId
* @memberof tutorial.ResMasterCard
* @instance
*/
ResMasterCard.prototype.MasterId = 0;
/**
* ResMasterCard CardId.
* @member {number} CardId
* @memberof tutorial.ResMasterCard
* @instance
*/
ResMasterCard.prototype.CardId = 0;
/**
* Creates a new ResMasterCard instance using the specified properties.
* @function create
* @memberof tutorial.ResMasterCard
* @static
* @param {tutorial.IResMasterCard=} [properties] Properties to set
* @returns {tutorial.ResMasterCard} ResMasterCard instance
*/
ResMasterCard.create = function create(properties) {
return new ResMasterCard(properties);
};
/**
* Encodes the specified ResMasterCard message. Does not implicitly {@link tutorial.ResMasterCard.verify|verify} messages.
* @function encode
* @memberof tutorial.ResMasterCard
* @static
* @param {tutorial.IResMasterCard} message ResMasterCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMasterCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.MasterId != null && Object.hasOwnProperty.call(message, "MasterId"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.MasterId);
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.CardId);
return writer;
};
/**
* Encodes the specified ResMasterCard message, length delimited. Does not implicitly {@link tutorial.ResMasterCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResMasterCard
* @static
* @param {tutorial.IResMasterCard} message ResMasterCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMasterCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResMasterCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResMasterCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResMasterCard} ResMasterCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMasterCard.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.ResMasterCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.MasterId = reader.int32();
break;
}
case 4: {
message.CardId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResMasterCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResMasterCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResMasterCard} ResMasterCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMasterCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResMasterCard message.
* @function verify
* @memberof tutorial.ResMasterCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResMasterCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.MasterId != null && message.hasOwnProperty("MasterId"))
if (!$util.isInteger(message.MasterId))
return "MasterId: integer expected";
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
return null;
};
/**
* Creates a ResMasterCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResMasterCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResMasterCard} ResMasterCard
*/
ResMasterCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResMasterCard)
return object;
var message = new $root.tutorial.ResMasterCard();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.MasterId != null)
message.MasterId = object.MasterId | 0;
if (object.CardId != null)
message.CardId = object.CardId | 0;
return message;
};
/**
* Creates a plain object from a ResMasterCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResMasterCard
* @static
* @param {tutorial.ResMasterCard} message ResMasterCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResMasterCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.MasterId = 0;
object.CardId = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.MasterId != null && message.hasOwnProperty("MasterId"))
object.MasterId = message.MasterId;
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
return object;
};
/**
* Converts this ResMasterCard to JSON.
* @function toJSON
* @memberof tutorial.ResMasterCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResMasterCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResMasterCard
* @function getTypeUrl
* @memberof tutorial.ResMasterCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResMasterCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResMasterCard";
};
return ResMasterCard;
})();
tutorial.ReqCardCollectReward = (function() {
/**
* Properties of a ReqCardCollectReward.
* @memberof tutorial
* @interface IReqCardCollectReward
* @property {number|null} [Color] ReqCardCollectReward Color
*/
/**
* Constructs a new ReqCardCollectReward.
* @memberof tutorial
* @classdesc Represents a ReqCardCollectReward.
* @implements IReqCardCollectReward
* @constructor
* @param {tutorial.IReqCardCollectReward=} [properties] Properties to set
*/
function ReqCardCollectReward(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]];
}
/**
* ReqCardCollectReward Color.
* @member {number} Color
* @memberof tutorial.ReqCardCollectReward
* @instance
*/
ReqCardCollectReward.prototype.Color = 0;
/**
* Creates a new ReqCardCollectReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {tutorial.IReqCardCollectReward=} [properties] Properties to set
* @returns {tutorial.ReqCardCollectReward} ReqCardCollectReward instance
*/
ReqCardCollectReward.create = function create(properties) {
return new ReqCardCollectReward(properties);
};
/**
* Encodes the specified ReqCardCollectReward message. Does not implicitly {@link tutorial.ReqCardCollectReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {tutorial.IReqCardCollectReward} message ReqCardCollectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardCollectReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Color != null && Object.hasOwnProperty.call(message, "Color"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Color);
return writer;
};
/**
* Encodes the specified ReqCardCollectReward message, length delimited. Does not implicitly {@link tutorial.ReqCardCollectReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {tutorial.IReqCardCollectReward} message ReqCardCollectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardCollectReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqCardCollectReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqCardCollectReward} ReqCardCollectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardCollectReward.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.ReqCardCollectReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Color = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqCardCollectReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqCardCollectReward} ReqCardCollectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardCollectReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqCardCollectReward message.
* @function verify
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqCardCollectReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Color != null && message.hasOwnProperty("Color"))
if (!$util.isInteger(message.Color))
return "Color: integer expected";
return null;
};
/**
* Creates a ReqCardCollectReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqCardCollectReward} ReqCardCollectReward
*/
ReqCardCollectReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqCardCollectReward)
return object;
var message = new $root.tutorial.ReqCardCollectReward();
if (object.Color != null)
message.Color = object.Color | 0;
return message;
};
/**
* Creates a plain object from a ReqCardCollectReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {tutorial.ReqCardCollectReward} message ReqCardCollectReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqCardCollectReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Color = 0;
if (message.Color != null && message.hasOwnProperty("Color"))
object.Color = message.Color;
return object;
};
/**
* Converts this ReqCardCollectReward to JSON.
* @function toJSON
* @memberof tutorial.ReqCardCollectReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqCardCollectReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqCardCollectReward
* @function getTypeUrl
* @memberof tutorial.ReqCardCollectReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqCardCollectReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqCardCollectReward";
};
return ReqCardCollectReward;
})();
tutorial.ResCardCollectReward = (function() {
/**
* Properties of a ResCardCollectReward.
* @memberof tutorial
* @interface IResCardCollectReward
* @property {tutorial.RES_CODE|null} [Code] ResCardCollectReward Code
* @property {string|null} [Msg] ResCardCollectReward Msg
*/
/**
* Constructs a new ResCardCollectReward.
* @memberof tutorial
* @classdesc Represents a ResCardCollectReward.
* @implements IResCardCollectReward
* @constructor
* @param {tutorial.IResCardCollectReward=} [properties] Properties to set
*/
function ResCardCollectReward(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]];
}
/**
* ResCardCollectReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResCardCollectReward
* @instance
*/
ResCardCollectReward.prototype.Code = 0;
/**
* ResCardCollectReward Msg.
* @member {string} Msg
* @memberof tutorial.ResCardCollectReward
* @instance
*/
ResCardCollectReward.prototype.Msg = "";
/**
* Creates a new ResCardCollectReward instance using the specified properties.
* @function create
* @memberof tutorial.ResCardCollectReward
* @static
* @param {tutorial.IResCardCollectReward=} [properties] Properties to set
* @returns {tutorial.ResCardCollectReward} ResCardCollectReward instance
*/
ResCardCollectReward.create = function create(properties) {
return new ResCardCollectReward(properties);
};
/**
* Encodes the specified ResCardCollectReward message. Does not implicitly {@link tutorial.ResCardCollectReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResCardCollectReward
* @static
* @param {tutorial.IResCardCollectReward} message ResCardCollectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardCollectReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResCardCollectReward message, length delimited. Does not implicitly {@link tutorial.ResCardCollectReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResCardCollectReward
* @static
* @param {tutorial.IResCardCollectReward} message ResCardCollectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardCollectReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResCardCollectReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResCardCollectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResCardCollectReward} ResCardCollectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardCollectReward.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.ResCardCollectReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResCardCollectReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResCardCollectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResCardCollectReward} ResCardCollectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardCollectReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResCardCollectReward message.
* @function verify
* @memberof tutorial.ResCardCollectReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResCardCollectReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResCardCollectReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResCardCollectReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResCardCollectReward} ResCardCollectReward
*/
ResCardCollectReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResCardCollectReward)
return object;
var message = new $root.tutorial.ResCardCollectReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResCardCollectReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResCardCollectReward
* @static
* @param {tutorial.ResCardCollectReward} message ResCardCollectReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResCardCollectReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResCardCollectReward to JSON.
* @function toJSON
* @memberof tutorial.ResCardCollectReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResCardCollectReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResCardCollectReward
* @function getTypeUrl
* @memberof tutorial.ResCardCollectReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResCardCollectReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResCardCollectReward";
};
return ResCardCollectReward;
})();
tutorial.ReqExStarReward = (function() {
/**
* Properties of a ReqExStarReward.
* @memberof tutorial
* @interface IReqExStarReward
* @property {number|null} [Id] ReqExStarReward Id
*/
/**
* Constructs a new ReqExStarReward.
* @memberof tutorial
* @classdesc Represents a ReqExStarReward.
* @implements IReqExStarReward
* @constructor
* @param {tutorial.IReqExStarReward=} [properties] Properties to set
*/
function ReqExStarReward(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]];
}
/**
* ReqExStarReward Id.
* @member {number} Id
* @memberof tutorial.ReqExStarReward
* @instance
*/
ReqExStarReward.prototype.Id = 0;
/**
* Creates a new ReqExStarReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqExStarReward
* @static
* @param {tutorial.IReqExStarReward=} [properties] Properties to set
* @returns {tutorial.ReqExStarReward} ReqExStarReward instance
*/
ReqExStarReward.create = function create(properties) {
return new ReqExStarReward(properties);
};
/**
* Encodes the specified ReqExStarReward message. Does not implicitly {@link tutorial.ReqExStarReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqExStarReward
* @static
* @param {tutorial.IReqExStarReward} message ReqExStarReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqExStarReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqExStarReward message, length delimited. Does not implicitly {@link tutorial.ReqExStarReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqExStarReward
* @static
* @param {tutorial.IReqExStarReward} message ReqExStarReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqExStarReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqExStarReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqExStarReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqExStarReward} ReqExStarReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqExStarReward.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.ReqExStarReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqExStarReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqExStarReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqExStarReward} ReqExStarReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqExStarReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqExStarReward message.
* @function verify
* @memberof tutorial.ReqExStarReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqExStarReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqExStarReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqExStarReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqExStarReward} ReqExStarReward
*/
ReqExStarReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqExStarReward)
return object;
var message = new $root.tutorial.ReqExStarReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqExStarReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqExStarReward
* @static
* @param {tutorial.ReqExStarReward} message ReqExStarReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqExStarReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqExStarReward to JSON.
* @function toJSON
* @memberof tutorial.ReqExStarReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqExStarReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqExStarReward
* @function getTypeUrl
* @memberof tutorial.ReqExStarReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqExStarReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqExStarReward";
};
return ReqExStarReward;
})();
tutorial.ResExStarReward = (function() {
/**
* Properties of a ResExStarReward.
* @memberof tutorial
* @interface IResExStarReward
* @property {tutorial.RES_CODE|null} [Code] ResExStarReward Code
* @property {string|null} [Msg] ResExStarReward Msg
*/
/**
* Constructs a new ResExStarReward.
* @memberof tutorial
* @classdesc Represents a ResExStarReward.
* @implements IResExStarReward
* @constructor
* @param {tutorial.IResExStarReward=} [properties] Properties to set
*/
function ResExStarReward(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]];
}
/**
* ResExStarReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResExStarReward
* @instance
*/
ResExStarReward.prototype.Code = 0;
/**
* ResExStarReward Msg.
* @member {string} Msg
* @memberof tutorial.ResExStarReward
* @instance
*/
ResExStarReward.prototype.Msg = "";
/**
* Creates a new ResExStarReward instance using the specified properties.
* @function create
* @memberof tutorial.ResExStarReward
* @static
* @param {tutorial.IResExStarReward=} [properties] Properties to set
* @returns {tutorial.ResExStarReward} ResExStarReward instance
*/
ResExStarReward.create = function create(properties) {
return new ResExStarReward(properties);
};
/**
* Encodes the specified ResExStarReward message. Does not implicitly {@link tutorial.ResExStarReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResExStarReward
* @static
* @param {tutorial.IResExStarReward} message ResExStarReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResExStarReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResExStarReward message, length delimited. Does not implicitly {@link tutorial.ResExStarReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResExStarReward
* @static
* @param {tutorial.IResExStarReward} message ResExStarReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResExStarReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResExStarReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResExStarReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResExStarReward} ResExStarReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResExStarReward.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.ResExStarReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResExStarReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResExStarReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResExStarReward} ResExStarReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResExStarReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResExStarReward message.
* @function verify
* @memberof tutorial.ResExStarReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResExStarReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResExStarReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResExStarReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResExStarReward} ResExStarReward
*/
ResExStarReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResExStarReward)
return object;
var message = new $root.tutorial.ResExStarReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResExStarReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResExStarReward
* @static
* @param {tutorial.ResExStarReward} message ResExStarReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResExStarReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResExStarReward to JSON.
* @function toJSON
* @memberof tutorial.ResExStarReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResExStarReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResExStarReward
* @function getTypeUrl
* @memberof tutorial.ResExStarReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResExStarReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResExStarReward";
};
return ResExStarReward;
})();
tutorial.ReqAllCollectReward = (function() {
/**
* Properties of a ReqAllCollectReward.
* @memberof tutorial
* @interface IReqAllCollectReward
*/
/**
* Constructs a new ReqAllCollectReward.
* @memberof tutorial
* @classdesc Represents a ReqAllCollectReward.
* @implements IReqAllCollectReward
* @constructor
* @param {tutorial.IReqAllCollectReward=} [properties] Properties to set
*/
function ReqAllCollectReward(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]];
}
/**
* Creates a new ReqAllCollectReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {tutorial.IReqAllCollectReward=} [properties] Properties to set
* @returns {tutorial.ReqAllCollectReward} ReqAllCollectReward instance
*/
ReqAllCollectReward.create = function create(properties) {
return new ReqAllCollectReward(properties);
};
/**
* Encodes the specified ReqAllCollectReward message. Does not implicitly {@link tutorial.ReqAllCollectReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {tutorial.IReqAllCollectReward} message ReqAllCollectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAllCollectReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqAllCollectReward message, length delimited. Does not implicitly {@link tutorial.ReqAllCollectReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {tutorial.IReqAllCollectReward} message ReqAllCollectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAllCollectReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqAllCollectReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqAllCollectReward} ReqAllCollectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAllCollectReward.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.ReqAllCollectReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqAllCollectReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqAllCollectReward} ReqAllCollectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAllCollectReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqAllCollectReward message.
* @function verify
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqAllCollectReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqAllCollectReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqAllCollectReward} ReqAllCollectReward
*/
ReqAllCollectReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqAllCollectReward)
return object;
return new $root.tutorial.ReqAllCollectReward();
};
/**
* Creates a plain object from a ReqAllCollectReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {tutorial.ReqAllCollectReward} message ReqAllCollectReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqAllCollectReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqAllCollectReward to JSON.
* @function toJSON
* @memberof tutorial.ReqAllCollectReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqAllCollectReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqAllCollectReward
* @function getTypeUrl
* @memberof tutorial.ReqAllCollectReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqAllCollectReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqAllCollectReward";
};
return ReqAllCollectReward;
})();
tutorial.ResAllCollectReward = (function() {
/**
* Properties of a ResAllCollectReward.
* @memberof tutorial
* @interface IResAllCollectReward
* @property {tutorial.RES_CODE|null} [Code] ResAllCollectReward Code
* @property {string|null} [Msg] ResAllCollectReward Msg
*/
/**
* Constructs a new ResAllCollectReward.
* @memberof tutorial
* @classdesc Represents a ResAllCollectReward.
* @implements IResAllCollectReward
* @constructor
* @param {tutorial.IResAllCollectReward=} [properties] Properties to set
*/
function ResAllCollectReward(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]];
}
/**
* ResAllCollectReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResAllCollectReward
* @instance
*/
ResAllCollectReward.prototype.Code = 0;
/**
* ResAllCollectReward Msg.
* @member {string} Msg
* @memberof tutorial.ResAllCollectReward
* @instance
*/
ResAllCollectReward.prototype.Msg = "";
/**
* Creates a new ResAllCollectReward instance using the specified properties.
* @function create
* @memberof tutorial.ResAllCollectReward
* @static
* @param {tutorial.IResAllCollectReward=} [properties] Properties to set
* @returns {tutorial.ResAllCollectReward} ResAllCollectReward instance
*/
ResAllCollectReward.create = function create(properties) {
return new ResAllCollectReward(properties);
};
/**
* Encodes the specified ResAllCollectReward message. Does not implicitly {@link tutorial.ResAllCollectReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResAllCollectReward
* @static
* @param {tutorial.IResAllCollectReward} message ResAllCollectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAllCollectReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResAllCollectReward message, length delimited. Does not implicitly {@link tutorial.ResAllCollectReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResAllCollectReward
* @static
* @param {tutorial.IResAllCollectReward} message ResAllCollectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAllCollectReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResAllCollectReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResAllCollectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResAllCollectReward} ResAllCollectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAllCollectReward.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.ResAllCollectReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResAllCollectReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResAllCollectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResAllCollectReward} ResAllCollectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAllCollectReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResAllCollectReward message.
* @function verify
* @memberof tutorial.ResAllCollectReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResAllCollectReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResAllCollectReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResAllCollectReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResAllCollectReward} ResAllCollectReward
*/
ResAllCollectReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResAllCollectReward)
return object;
var message = new $root.tutorial.ResAllCollectReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResAllCollectReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResAllCollectReward
* @static
* @param {tutorial.ResAllCollectReward} message ResAllCollectReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResAllCollectReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResAllCollectReward to JSON.
* @function toJSON
* @memberof tutorial.ResAllCollectReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResAllCollectReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResAllCollectReward
* @function getTypeUrl
* @memberof tutorial.ResAllCollectReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResAllCollectReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResAllCollectReward";
};
return ResAllCollectReward;
})();
tutorial.ReqCardGive = (function() {
/**
* Properties of a ReqCardGive.
* @memberof tutorial
* @interface IReqCardGive
* @property {Array.<number>|null} [Uid] ReqCardGive Uid
* @property {number|null} [CardId] ReqCardGive CardId
*/
/**
* Constructs a new ReqCardGive.
* @memberof tutorial
* @classdesc Represents a ReqCardGive.
* @implements IReqCardGive
* @constructor
* @param {tutorial.IReqCardGive=} [properties] Properties to set
*/
function ReqCardGive(properties) {
this.Uid = [];
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]];
}
/**
* ReqCardGive Uid.
* @member {Array.<number>} Uid
* @memberof tutorial.ReqCardGive
* @instance
*/
ReqCardGive.prototype.Uid = $util.emptyArray;
/**
* ReqCardGive CardId.
* @member {number} CardId
* @memberof tutorial.ReqCardGive
* @instance
*/
ReqCardGive.prototype.CardId = 0;
/**
* Creates a new ReqCardGive instance using the specified properties.
* @function create
* @memberof tutorial.ReqCardGive
* @static
* @param {tutorial.IReqCardGive=} [properties] Properties to set
* @returns {tutorial.ReqCardGive} ReqCardGive instance
*/
ReqCardGive.create = function create(properties) {
return new ReqCardGive(properties);
};
/**
* Encodes the specified ReqCardGive message. Does not implicitly {@link tutorial.ReqCardGive.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqCardGive
* @static
* @param {tutorial.IReqCardGive} message ReqCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardGive.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && message.Uid.length) {
writer.uint32(/* id 1, wireType 2 =*/10).fork();
for (var i = 0; i < message.Uid.length; ++i)
writer.int32(message.Uid[i]);
writer.ldelim();
}
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.CardId);
return writer;
};
/**
* Encodes the specified ReqCardGive message, length delimited. Does not implicitly {@link tutorial.ReqCardGive.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqCardGive
* @static
* @param {tutorial.IReqCardGive} message ReqCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardGive.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqCardGive message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqCardGive} ReqCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardGive.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.ReqCardGive();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.Uid && message.Uid.length))
message.Uid = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Uid.push(reader.int32());
} else
message.Uid.push(reader.int32());
break;
}
case 2: {
message.CardId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqCardGive message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqCardGive} ReqCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardGive.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqCardGive message.
* @function verify
* @memberof tutorial.ReqCardGive
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqCardGive.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid")) {
if (!Array.isArray(message.Uid))
return "Uid: array expected";
for (var i = 0; i < message.Uid.length; ++i)
if (!$util.isInteger(message.Uid[i]))
return "Uid: integer[] expected";
}
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
return null;
};
/**
* Creates a ReqCardGive message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqCardGive
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqCardGive} ReqCardGive
*/
ReqCardGive.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqCardGive)
return object;
var message = new $root.tutorial.ReqCardGive();
if (object.Uid) {
if (!Array.isArray(object.Uid))
throw TypeError(".tutorial.ReqCardGive.Uid: array expected");
message.Uid = [];
for (var i = 0; i < object.Uid.length; ++i)
message.Uid[i] = object.Uid[i] | 0;
}
if (object.CardId != null)
message.CardId = object.CardId | 0;
return message;
};
/**
* Creates a plain object from a ReqCardGive message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqCardGive
* @static
* @param {tutorial.ReqCardGive} message ReqCardGive
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqCardGive.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Uid = [];
if (options.defaults)
object.CardId = 0;
if (message.Uid && message.Uid.length) {
object.Uid = [];
for (var j = 0; j < message.Uid.length; ++j)
object.Uid[j] = message.Uid[j];
}
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
return object;
};
/**
* Converts this ReqCardGive to JSON.
* @function toJSON
* @memberof tutorial.ReqCardGive
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqCardGive.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqCardGive
* @function getTypeUrl
* @memberof tutorial.ReqCardGive
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqCardGive.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqCardGive";
};
return ReqCardGive;
})();
tutorial.ResCardGive = (function() {
/**
* Properties of a ResCardGive.
* @memberof tutorial
* @interface IResCardGive
* @property {tutorial.RES_CODE|null} [Code] ResCardGive Code
* @property {string|null} [Msg] ResCardGive Msg
*/
/**
* Constructs a new ResCardGive.
* @memberof tutorial
* @classdesc Represents a ResCardGive.
* @implements IResCardGive
* @constructor
* @param {tutorial.IResCardGive=} [properties] Properties to set
*/
function ResCardGive(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]];
}
/**
* ResCardGive Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResCardGive
* @instance
*/
ResCardGive.prototype.Code = 0;
/**
* ResCardGive Msg.
* @member {string} Msg
* @memberof tutorial.ResCardGive
* @instance
*/
ResCardGive.prototype.Msg = "";
/**
* Creates a new ResCardGive instance using the specified properties.
* @function create
* @memberof tutorial.ResCardGive
* @static
* @param {tutorial.IResCardGive=} [properties] Properties to set
* @returns {tutorial.ResCardGive} ResCardGive instance
*/
ResCardGive.create = function create(properties) {
return new ResCardGive(properties);
};
/**
* Encodes the specified ResCardGive message. Does not implicitly {@link tutorial.ResCardGive.verify|verify} messages.
* @function encode
* @memberof tutorial.ResCardGive
* @static
* @param {tutorial.IResCardGive} message ResCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardGive.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResCardGive message, length delimited. Does not implicitly {@link tutorial.ResCardGive.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResCardGive
* @static
* @param {tutorial.IResCardGive} message ResCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardGive.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResCardGive message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResCardGive} ResCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardGive.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.ResCardGive();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResCardGive message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResCardGive} ResCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardGive.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResCardGive message.
* @function verify
* @memberof tutorial.ResCardGive
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResCardGive.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResCardGive message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResCardGive
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResCardGive} ResCardGive
*/
ResCardGive.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResCardGive)
return object;
var message = new $root.tutorial.ResCardGive();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResCardGive message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResCardGive
* @static
* @param {tutorial.ResCardGive} message ResCardGive
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResCardGive.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResCardGive to JSON.
* @function toJSON
* @memberof tutorial.ResCardGive
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResCardGive.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResCardGive
* @function getTypeUrl
* @memberof tutorial.ResCardGive
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResCardGive.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResCardGive";
};
return ResCardGive;
})();
tutorial.ReqAgreeCardGive = (function() {
/**
* Properties of a ReqAgreeCardGive.
* @memberof tutorial
* @interface IReqAgreeCardGive
* @property {string|null} [Id] ReqAgreeCardGive Id
*/
/**
* Constructs a new ReqAgreeCardGive.
* @memberof tutorial
* @classdesc Represents a ReqAgreeCardGive.
* @implements IReqAgreeCardGive
* @constructor
* @param {tutorial.IReqAgreeCardGive=} [properties] Properties to set
*/
function ReqAgreeCardGive(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]];
}
/**
* ReqAgreeCardGive Id.
* @member {string} Id
* @memberof tutorial.ReqAgreeCardGive
* @instance
*/
ReqAgreeCardGive.prototype.Id = "";
/**
* Creates a new ReqAgreeCardGive instance using the specified properties.
* @function create
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {tutorial.IReqAgreeCardGive=} [properties] Properties to set
* @returns {tutorial.ReqAgreeCardGive} ReqAgreeCardGive instance
*/
ReqAgreeCardGive.create = function create(properties) {
return new ReqAgreeCardGive(properties);
};
/**
* Encodes the specified ReqAgreeCardGive message. Does not implicitly {@link tutorial.ReqAgreeCardGive.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {tutorial.IReqAgreeCardGive} message ReqAgreeCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAgreeCardGive.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Id);
return writer;
};
/**
* Encodes the specified ReqAgreeCardGive message, length delimited. Does not implicitly {@link tutorial.ReqAgreeCardGive.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {tutorial.IReqAgreeCardGive} message ReqAgreeCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAgreeCardGive.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqAgreeCardGive message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqAgreeCardGive} ReqAgreeCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAgreeCardGive.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.ReqAgreeCardGive();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqAgreeCardGive message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqAgreeCardGive} ReqAgreeCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAgreeCardGive.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqAgreeCardGive message.
* @function verify
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqAgreeCardGive.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ReqAgreeCardGive message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqAgreeCardGive} ReqAgreeCardGive
*/
ReqAgreeCardGive.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqAgreeCardGive)
return object;
var message = new $root.tutorial.ReqAgreeCardGive();
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ReqAgreeCardGive message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {tutorial.ReqAgreeCardGive} message ReqAgreeCardGive
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqAgreeCardGive.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = "";
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqAgreeCardGive to JSON.
* @function toJSON
* @memberof tutorial.ReqAgreeCardGive
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqAgreeCardGive.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqAgreeCardGive
* @function getTypeUrl
* @memberof tutorial.ReqAgreeCardGive
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqAgreeCardGive.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqAgreeCardGive";
};
return ReqAgreeCardGive;
})();
tutorial.ResAgreeCardGive = (function() {
/**
* Properties of a ResAgreeCardGive.
* @memberof tutorial
* @interface IResAgreeCardGive
* @property {tutorial.RES_CODE|null} [Code] ResAgreeCardGive Code
* @property {string|null} [Msg] ResAgreeCardGive Msg
* @property {string|null} [Id] ResAgreeCardGive Id
*/
/**
* Constructs a new ResAgreeCardGive.
* @memberof tutorial
* @classdesc Represents a ResAgreeCardGive.
* @implements IResAgreeCardGive
* @constructor
* @param {tutorial.IResAgreeCardGive=} [properties] Properties to set
*/
function ResAgreeCardGive(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]];
}
/**
* ResAgreeCardGive Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResAgreeCardGive
* @instance
*/
ResAgreeCardGive.prototype.Code = 0;
/**
* ResAgreeCardGive Msg.
* @member {string} Msg
* @memberof tutorial.ResAgreeCardGive
* @instance
*/
ResAgreeCardGive.prototype.Msg = "";
/**
* ResAgreeCardGive Id.
* @member {string} Id
* @memberof tutorial.ResAgreeCardGive
* @instance
*/
ResAgreeCardGive.prototype.Id = "";
/**
* Creates a new ResAgreeCardGive instance using the specified properties.
* @function create
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {tutorial.IResAgreeCardGive=} [properties] Properties to set
* @returns {tutorial.ResAgreeCardGive} ResAgreeCardGive instance
*/
ResAgreeCardGive.create = function create(properties) {
return new ResAgreeCardGive(properties);
};
/**
* Encodes the specified ResAgreeCardGive message. Does not implicitly {@link tutorial.ResAgreeCardGive.verify|verify} messages.
* @function encode
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {tutorial.IResAgreeCardGive} message ResAgreeCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAgreeCardGive.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.Id);
return writer;
};
/**
* Encodes the specified ResAgreeCardGive message, length delimited. Does not implicitly {@link tutorial.ResAgreeCardGive.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {tutorial.IResAgreeCardGive} message ResAgreeCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAgreeCardGive.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResAgreeCardGive message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResAgreeCardGive} ResAgreeCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAgreeCardGive.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.ResAgreeCardGive();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResAgreeCardGive message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResAgreeCardGive} ResAgreeCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAgreeCardGive.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResAgreeCardGive message.
* @function verify
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResAgreeCardGive.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ResAgreeCardGive message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResAgreeCardGive} ResAgreeCardGive
*/
ResAgreeCardGive.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResAgreeCardGive)
return object;
var message = new $root.tutorial.ResAgreeCardGive();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ResAgreeCardGive message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {tutorial.ResAgreeCardGive} message ResAgreeCardGive
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResAgreeCardGive.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResAgreeCardGive to JSON.
* @function toJSON
* @memberof tutorial.ResAgreeCardGive
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResAgreeCardGive.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResAgreeCardGive
* @function getTypeUrl
* @memberof tutorial.ResAgreeCardGive
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResAgreeCardGive.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResAgreeCardGive";
};
return ResAgreeCardGive;
})();
tutorial.ReqRefuseCardGive = (function() {
/**
* Properties of a ReqRefuseCardGive.
* @memberof tutorial
* @interface IReqRefuseCardGive
* @property {string|null} [Id] ReqRefuseCardGive Id
*/
/**
* Constructs a new ReqRefuseCardGive.
* @memberof tutorial
* @classdesc Represents a ReqRefuseCardGive.
* @implements IReqRefuseCardGive
* @constructor
* @param {tutorial.IReqRefuseCardGive=} [properties] Properties to set
*/
function ReqRefuseCardGive(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]];
}
/**
* ReqRefuseCardGive Id.
* @member {string} Id
* @memberof tutorial.ReqRefuseCardGive
* @instance
*/
ReqRefuseCardGive.prototype.Id = "";
/**
* Creates a new ReqRefuseCardGive instance using the specified properties.
* @function create
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {tutorial.IReqRefuseCardGive=} [properties] Properties to set
* @returns {tutorial.ReqRefuseCardGive} ReqRefuseCardGive instance
*/
ReqRefuseCardGive.create = function create(properties) {
return new ReqRefuseCardGive(properties);
};
/**
* Encodes the specified ReqRefuseCardGive message. Does not implicitly {@link tutorial.ReqRefuseCardGive.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {tutorial.IReqRefuseCardGive} message ReqRefuseCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefuseCardGive.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Id);
return writer;
};
/**
* Encodes the specified ReqRefuseCardGive message, length delimited. Does not implicitly {@link tutorial.ReqRefuseCardGive.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {tutorial.IReqRefuseCardGive} message ReqRefuseCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefuseCardGive.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRefuseCardGive message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRefuseCardGive} ReqRefuseCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefuseCardGive.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.ReqRefuseCardGive();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRefuseCardGive message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRefuseCardGive} ReqRefuseCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefuseCardGive.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRefuseCardGive message.
* @function verify
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRefuseCardGive.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ReqRefuseCardGive message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRefuseCardGive} ReqRefuseCardGive
*/
ReqRefuseCardGive.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRefuseCardGive)
return object;
var message = new $root.tutorial.ReqRefuseCardGive();
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ReqRefuseCardGive message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {tutorial.ReqRefuseCardGive} message ReqRefuseCardGive
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRefuseCardGive.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = "";
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqRefuseCardGive to JSON.
* @function toJSON
* @memberof tutorial.ReqRefuseCardGive
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRefuseCardGive.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRefuseCardGive
* @function getTypeUrl
* @memberof tutorial.ReqRefuseCardGive
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRefuseCardGive.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRefuseCardGive";
};
return ReqRefuseCardGive;
})();
tutorial.ResRefuseCardGive = (function() {
/**
* Properties of a ResRefuseCardGive.
* @memberof tutorial
* @interface IResRefuseCardGive
* @property {tutorial.RES_CODE|null} [Code] ResRefuseCardGive Code
* @property {string|null} [Msg] ResRefuseCardGive Msg
* @property {string|null} [Id] ResRefuseCardGive Id
*/
/**
* Constructs a new ResRefuseCardGive.
* @memberof tutorial
* @classdesc Represents a ResRefuseCardGive.
* @implements IResRefuseCardGive
* @constructor
* @param {tutorial.IResRefuseCardGive=} [properties] Properties to set
*/
function ResRefuseCardGive(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]];
}
/**
* ResRefuseCardGive Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResRefuseCardGive
* @instance
*/
ResRefuseCardGive.prototype.Code = 0;
/**
* ResRefuseCardGive Msg.
* @member {string} Msg
* @memberof tutorial.ResRefuseCardGive
* @instance
*/
ResRefuseCardGive.prototype.Msg = "";
/**
* ResRefuseCardGive Id.
* @member {string} Id
* @memberof tutorial.ResRefuseCardGive
* @instance
*/
ResRefuseCardGive.prototype.Id = "";
/**
* Creates a new ResRefuseCardGive instance using the specified properties.
* @function create
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {tutorial.IResRefuseCardGive=} [properties] Properties to set
* @returns {tutorial.ResRefuseCardGive} ResRefuseCardGive instance
*/
ResRefuseCardGive.create = function create(properties) {
return new ResRefuseCardGive(properties);
};
/**
* Encodes the specified ResRefuseCardGive message. Does not implicitly {@link tutorial.ResRefuseCardGive.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {tutorial.IResRefuseCardGive} message ResRefuseCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefuseCardGive.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.Id);
return writer;
};
/**
* Encodes the specified ResRefuseCardGive message, length delimited. Does not implicitly {@link tutorial.ResRefuseCardGive.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {tutorial.IResRefuseCardGive} message ResRefuseCardGive message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefuseCardGive.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRefuseCardGive message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRefuseCardGive} ResRefuseCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefuseCardGive.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.ResRefuseCardGive();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRefuseCardGive message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRefuseCardGive} ResRefuseCardGive
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefuseCardGive.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRefuseCardGive message.
* @function verify
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRefuseCardGive.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ResRefuseCardGive message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRefuseCardGive} ResRefuseCardGive
*/
ResRefuseCardGive.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRefuseCardGive)
return object;
var message = new $root.tutorial.ResRefuseCardGive();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ResRefuseCardGive message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {tutorial.ResRefuseCardGive} message ResRefuseCardGive
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRefuseCardGive.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResRefuseCardGive to JSON.
* @function toJSON
* @memberof tutorial.ResRefuseCardGive
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRefuseCardGive.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRefuseCardGive
* @function getTypeUrl
* @memberof tutorial.ResRefuseCardGive
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRefuseCardGive.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRefuseCardGive";
};
return ResRefuseCardGive;
})();
tutorial.ReqCardSend = (function() {
/**
* Properties of a ReqCardSend.
* @memberof tutorial
* @interface IReqCardSend
* @property {number|null} [Uid] ReqCardSend Uid
* @property {number|null} [CardId] ReqCardSend CardId
*/
/**
* Constructs a new ReqCardSend.
* @memberof tutorial
* @classdesc Represents a ReqCardSend.
* @implements IReqCardSend
* @constructor
* @param {tutorial.IReqCardSend=} [properties] Properties to set
*/
function ReqCardSend(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]];
}
/**
* ReqCardSend Uid.
* @member {number} Uid
* @memberof tutorial.ReqCardSend
* @instance
*/
ReqCardSend.prototype.Uid = 0;
/**
* ReqCardSend CardId.
* @member {number} CardId
* @memberof tutorial.ReqCardSend
* @instance
*/
ReqCardSend.prototype.CardId = 0;
/**
* Creates a new ReqCardSend instance using the specified properties.
* @function create
* @memberof tutorial.ReqCardSend
* @static
* @param {tutorial.IReqCardSend=} [properties] Properties to set
* @returns {tutorial.ReqCardSend} ReqCardSend instance
*/
ReqCardSend.create = function create(properties) {
return new ReqCardSend(properties);
};
/**
* Encodes the specified ReqCardSend message. Does not implicitly {@link tutorial.ReqCardSend.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqCardSend
* @static
* @param {tutorial.IReqCardSend} message ReqCardSend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardSend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.CardId);
return writer;
};
/**
* Encodes the specified ReqCardSend message, length delimited. Does not implicitly {@link tutorial.ReqCardSend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqCardSend
* @static
* @param {tutorial.IReqCardSend} message ReqCardSend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardSend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqCardSend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqCardSend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqCardSend} ReqCardSend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardSend.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.ReqCardSend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.CardId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqCardSend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqCardSend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqCardSend} ReqCardSend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardSend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqCardSend message.
* @function verify
* @memberof tutorial.ReqCardSend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqCardSend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
return null;
};
/**
* Creates a ReqCardSend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqCardSend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqCardSend} ReqCardSend
*/
ReqCardSend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqCardSend)
return object;
var message = new $root.tutorial.ReqCardSend();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.CardId != null)
message.CardId = object.CardId | 0;
return message;
};
/**
* Creates a plain object from a ReqCardSend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqCardSend
* @static
* @param {tutorial.ReqCardSend} message ReqCardSend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqCardSend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Uid = 0;
object.CardId = 0;
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
return object;
};
/**
* Converts this ReqCardSend to JSON.
* @function toJSON
* @memberof tutorial.ReqCardSend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqCardSend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqCardSend
* @function getTypeUrl
* @memberof tutorial.ReqCardSend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqCardSend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqCardSend";
};
return ReqCardSend;
})();
tutorial.ResCardSend = (function() {
/**
* Properties of a ResCardSend.
* @memberof tutorial
* @interface IResCardSend
* @property {tutorial.RES_CODE|null} [Code] ResCardSend Code
* @property {string|null} [Msg] ResCardSend Msg
*/
/**
* Constructs a new ResCardSend.
* @memberof tutorial
* @classdesc Represents a ResCardSend.
* @implements IResCardSend
* @constructor
* @param {tutorial.IResCardSend=} [properties] Properties to set
*/
function ResCardSend(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]];
}
/**
* ResCardSend Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResCardSend
* @instance
*/
ResCardSend.prototype.Code = 0;
/**
* ResCardSend Msg.
* @member {string} Msg
* @memberof tutorial.ResCardSend
* @instance
*/
ResCardSend.prototype.Msg = "";
/**
* Creates a new ResCardSend instance using the specified properties.
* @function create
* @memberof tutorial.ResCardSend
* @static
* @param {tutorial.IResCardSend=} [properties] Properties to set
* @returns {tutorial.ResCardSend} ResCardSend instance
*/
ResCardSend.create = function create(properties) {
return new ResCardSend(properties);
};
/**
* Encodes the specified ResCardSend message. Does not implicitly {@link tutorial.ResCardSend.verify|verify} messages.
* @function encode
* @memberof tutorial.ResCardSend
* @static
* @param {tutorial.IResCardSend} message ResCardSend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardSend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResCardSend message, length delimited. Does not implicitly {@link tutorial.ResCardSend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResCardSend
* @static
* @param {tutorial.IResCardSend} message ResCardSend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardSend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResCardSend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResCardSend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResCardSend} ResCardSend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardSend.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.ResCardSend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResCardSend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResCardSend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResCardSend} ResCardSend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardSend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResCardSend message.
* @function verify
* @memberof tutorial.ResCardSend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResCardSend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResCardSend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResCardSend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResCardSend} ResCardSend
*/
ResCardSend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResCardSend)
return object;
var message = new $root.tutorial.ResCardSend();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResCardSend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResCardSend
* @static
* @param {tutorial.ResCardSend} message ResCardSend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResCardSend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResCardSend to JSON.
* @function toJSON
* @memberof tutorial.ResCardSend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResCardSend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResCardSend
* @function getTypeUrl
* @memberof tutorial.ResCardSend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResCardSend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResCardSend";
};
return ResCardSend;
})();
tutorial.ReqCardExchange = (function() {
/**
* Properties of a ReqCardExchange.
* @memberof tutorial
* @interface IReqCardExchange
* @property {number|null} [Uid] ReqCardExchange Uid
* @property {number|null} [CardId] ReqCardExchange CardId
*/
/**
* Constructs a new ReqCardExchange.
* @memberof tutorial
* @classdesc Represents a ReqCardExchange.
* @implements IReqCardExchange
* @constructor
* @param {tutorial.IReqCardExchange=} [properties] Properties to set
*/
function ReqCardExchange(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]];
}
/**
* ReqCardExchange Uid.
* @member {number} Uid
* @memberof tutorial.ReqCardExchange
* @instance
*/
ReqCardExchange.prototype.Uid = 0;
/**
* ReqCardExchange CardId.
* @member {number} CardId
* @memberof tutorial.ReqCardExchange
* @instance
*/
ReqCardExchange.prototype.CardId = 0;
/**
* Creates a new ReqCardExchange instance using the specified properties.
* @function create
* @memberof tutorial.ReqCardExchange
* @static
* @param {tutorial.IReqCardExchange=} [properties] Properties to set
* @returns {tutorial.ReqCardExchange} ReqCardExchange instance
*/
ReqCardExchange.create = function create(properties) {
return new ReqCardExchange(properties);
};
/**
* Encodes the specified ReqCardExchange message. Does not implicitly {@link tutorial.ReqCardExchange.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqCardExchange
* @static
* @param {tutorial.IReqCardExchange} message ReqCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardExchange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.CardId);
return writer;
};
/**
* Encodes the specified ReqCardExchange message, length delimited. Does not implicitly {@link tutorial.ReqCardExchange.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqCardExchange
* @static
* @param {tutorial.IReqCardExchange} message ReqCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCardExchange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqCardExchange message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqCardExchange} ReqCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardExchange.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.ReqCardExchange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.CardId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqCardExchange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqCardExchange} ReqCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCardExchange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqCardExchange message.
* @function verify
* @memberof tutorial.ReqCardExchange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqCardExchange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
return null;
};
/**
* Creates a ReqCardExchange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqCardExchange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqCardExchange} ReqCardExchange
*/
ReqCardExchange.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqCardExchange)
return object;
var message = new $root.tutorial.ReqCardExchange();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.CardId != null)
message.CardId = object.CardId | 0;
return message;
};
/**
* Creates a plain object from a ReqCardExchange message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqCardExchange
* @static
* @param {tutorial.ReqCardExchange} message ReqCardExchange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqCardExchange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Uid = 0;
object.CardId = 0;
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
return object;
};
/**
* Converts this ReqCardExchange to JSON.
* @function toJSON
* @memberof tutorial.ReqCardExchange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqCardExchange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqCardExchange
* @function getTypeUrl
* @memberof tutorial.ReqCardExchange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqCardExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqCardExchange";
};
return ReqCardExchange;
})();
tutorial.ResCardExchange = (function() {
/**
* Properties of a ResCardExchange.
* @memberof tutorial
* @interface IResCardExchange
* @property {tutorial.RES_CODE|null} [Code] ResCardExchange Code
* @property {string|null} [Msg] ResCardExchange Msg
*/
/**
* Constructs a new ResCardExchange.
* @memberof tutorial
* @classdesc Represents a ResCardExchange.
* @implements IResCardExchange
* @constructor
* @param {tutorial.IResCardExchange=} [properties] Properties to set
*/
function ResCardExchange(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]];
}
/**
* ResCardExchange Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResCardExchange
* @instance
*/
ResCardExchange.prototype.Code = 0;
/**
* ResCardExchange Msg.
* @member {string} Msg
* @memberof tutorial.ResCardExchange
* @instance
*/
ResCardExchange.prototype.Msg = "";
/**
* Creates a new ResCardExchange instance using the specified properties.
* @function create
* @memberof tutorial.ResCardExchange
* @static
* @param {tutorial.IResCardExchange=} [properties] Properties to set
* @returns {tutorial.ResCardExchange} ResCardExchange instance
*/
ResCardExchange.create = function create(properties) {
return new ResCardExchange(properties);
};
/**
* Encodes the specified ResCardExchange message. Does not implicitly {@link tutorial.ResCardExchange.verify|verify} messages.
* @function encode
* @memberof tutorial.ResCardExchange
* @static
* @param {tutorial.IResCardExchange} message ResCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardExchange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResCardExchange message, length delimited. Does not implicitly {@link tutorial.ResCardExchange.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResCardExchange
* @static
* @param {tutorial.IResCardExchange} message ResCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCardExchange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResCardExchange message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResCardExchange} ResCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardExchange.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.ResCardExchange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResCardExchange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResCardExchange} ResCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCardExchange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResCardExchange message.
* @function verify
* @memberof tutorial.ResCardExchange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResCardExchange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResCardExchange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResCardExchange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResCardExchange} ResCardExchange
*/
ResCardExchange.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResCardExchange)
return object;
var message = new $root.tutorial.ResCardExchange();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResCardExchange message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResCardExchange
* @static
* @param {tutorial.ResCardExchange} message ResCardExchange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResCardExchange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResCardExchange to JSON.
* @function toJSON
* @memberof tutorial.ResCardExchange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResCardExchange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResCardExchange
* @function getTypeUrl
* @memberof tutorial.ResCardExchange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResCardExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResCardExchange";
};
return ResCardExchange;
})();
tutorial.ReqSelectCardExchange = (function() {
/**
* Properties of a ReqSelectCardExchange.
* @memberof tutorial
* @interface IReqSelectCardExchange
* @property {string|null} [Id] ReqSelectCardExchange Id
* @property {number|null} [CardId] ReqSelectCardExchange CardId
*/
/**
* Constructs a new ReqSelectCardExchange.
* @memberof tutorial
* @classdesc Represents a ReqSelectCardExchange.
* @implements IReqSelectCardExchange
* @constructor
* @param {tutorial.IReqSelectCardExchange=} [properties] Properties to set
*/
function ReqSelectCardExchange(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]];
}
/**
* ReqSelectCardExchange Id.
* @member {string} Id
* @memberof tutorial.ReqSelectCardExchange
* @instance
*/
ReqSelectCardExchange.prototype.Id = "";
/**
* ReqSelectCardExchange CardId.
* @member {number} CardId
* @memberof tutorial.ReqSelectCardExchange
* @instance
*/
ReqSelectCardExchange.prototype.CardId = 0;
/**
* Creates a new ReqSelectCardExchange instance using the specified properties.
* @function create
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {tutorial.IReqSelectCardExchange=} [properties] Properties to set
* @returns {tutorial.ReqSelectCardExchange} ReqSelectCardExchange instance
*/
ReqSelectCardExchange.create = function create(properties) {
return new ReqSelectCardExchange(properties);
};
/**
* Encodes the specified ReqSelectCardExchange message. Does not implicitly {@link tutorial.ReqSelectCardExchange.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {tutorial.IReqSelectCardExchange} message ReqSelectCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSelectCardExchange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Id);
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.CardId);
return writer;
};
/**
* Encodes the specified ReqSelectCardExchange message, length delimited. Does not implicitly {@link tutorial.ReqSelectCardExchange.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {tutorial.IReqSelectCardExchange} message ReqSelectCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSelectCardExchange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSelectCardExchange message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSelectCardExchange} ReqSelectCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSelectCardExchange.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.ReqSelectCardExchange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.string();
break;
}
case 2: {
message.CardId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSelectCardExchange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSelectCardExchange} ReqSelectCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSelectCardExchange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSelectCardExchange message.
* @function verify
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSelectCardExchange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
return null;
};
/**
* Creates a ReqSelectCardExchange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSelectCardExchange} ReqSelectCardExchange
*/
ReqSelectCardExchange.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSelectCardExchange)
return object;
var message = new $root.tutorial.ReqSelectCardExchange();
if (object.Id != null)
message.Id = String(object.Id);
if (object.CardId != null)
message.CardId = object.CardId | 0;
return message;
};
/**
* Creates a plain object from a ReqSelectCardExchange message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {tutorial.ReqSelectCardExchange} message ReqSelectCardExchange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSelectCardExchange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = "";
object.CardId = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
return object;
};
/**
* Converts this ReqSelectCardExchange to JSON.
* @function toJSON
* @memberof tutorial.ReqSelectCardExchange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSelectCardExchange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSelectCardExchange
* @function getTypeUrl
* @memberof tutorial.ReqSelectCardExchange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSelectCardExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSelectCardExchange";
};
return ReqSelectCardExchange;
})();
tutorial.ResSelectCardExchange = (function() {
/**
* Properties of a ResSelectCardExchange.
* @memberof tutorial
* @interface IResSelectCardExchange
* @property {tutorial.RES_CODE|null} [Code] ResSelectCardExchange Code
* @property {string|null} [Msg] ResSelectCardExchange Msg
* @property {string|null} [Id] ResSelectCardExchange Id
*/
/**
* Constructs a new ResSelectCardExchange.
* @memberof tutorial
* @classdesc Represents a ResSelectCardExchange.
* @implements IResSelectCardExchange
* @constructor
* @param {tutorial.IResSelectCardExchange=} [properties] Properties to set
*/
function ResSelectCardExchange(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]];
}
/**
* ResSelectCardExchange Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResSelectCardExchange
* @instance
*/
ResSelectCardExchange.prototype.Code = 0;
/**
* ResSelectCardExchange Msg.
* @member {string} Msg
* @memberof tutorial.ResSelectCardExchange
* @instance
*/
ResSelectCardExchange.prototype.Msg = "";
/**
* ResSelectCardExchange Id.
* @member {string} Id
* @memberof tutorial.ResSelectCardExchange
* @instance
*/
ResSelectCardExchange.prototype.Id = "";
/**
* Creates a new ResSelectCardExchange instance using the specified properties.
* @function create
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {tutorial.IResSelectCardExchange=} [properties] Properties to set
* @returns {tutorial.ResSelectCardExchange} ResSelectCardExchange instance
*/
ResSelectCardExchange.create = function create(properties) {
return new ResSelectCardExchange(properties);
};
/**
* Encodes the specified ResSelectCardExchange message. Does not implicitly {@link tutorial.ResSelectCardExchange.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {tutorial.IResSelectCardExchange} message ResSelectCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSelectCardExchange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.Id);
return writer;
};
/**
* Encodes the specified ResSelectCardExchange message, length delimited. Does not implicitly {@link tutorial.ResSelectCardExchange.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {tutorial.IResSelectCardExchange} message ResSelectCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSelectCardExchange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSelectCardExchange message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSelectCardExchange} ResSelectCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSelectCardExchange.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.ResSelectCardExchange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSelectCardExchange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSelectCardExchange} ResSelectCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSelectCardExchange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSelectCardExchange message.
* @function verify
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSelectCardExchange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ResSelectCardExchange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSelectCardExchange} ResSelectCardExchange
*/
ResSelectCardExchange.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSelectCardExchange)
return object;
var message = new $root.tutorial.ResSelectCardExchange();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ResSelectCardExchange message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {tutorial.ResSelectCardExchange} message ResSelectCardExchange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSelectCardExchange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResSelectCardExchange to JSON.
* @function toJSON
* @memberof tutorial.ResSelectCardExchange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSelectCardExchange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSelectCardExchange
* @function getTypeUrl
* @memberof tutorial.ResSelectCardExchange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSelectCardExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSelectCardExchange";
};
return ResSelectCardExchange;
})();
tutorial.ReqAgreeCardExchange = (function() {
/**
* Properties of a ReqAgreeCardExchange.
* @memberof tutorial
* @interface IReqAgreeCardExchange
* @property {string|null} [Id] ReqAgreeCardExchange Id
*/
/**
* Constructs a new ReqAgreeCardExchange.
* @memberof tutorial
* @classdesc Represents a ReqAgreeCardExchange.
* @implements IReqAgreeCardExchange
* @constructor
* @param {tutorial.IReqAgreeCardExchange=} [properties] Properties to set
*/
function ReqAgreeCardExchange(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]];
}
/**
* ReqAgreeCardExchange Id.
* @member {string} Id
* @memberof tutorial.ReqAgreeCardExchange
* @instance
*/
ReqAgreeCardExchange.prototype.Id = "";
/**
* Creates a new ReqAgreeCardExchange instance using the specified properties.
* @function create
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {tutorial.IReqAgreeCardExchange=} [properties] Properties to set
* @returns {tutorial.ReqAgreeCardExchange} ReqAgreeCardExchange instance
*/
ReqAgreeCardExchange.create = function create(properties) {
return new ReqAgreeCardExchange(properties);
};
/**
* Encodes the specified ReqAgreeCardExchange message. Does not implicitly {@link tutorial.ReqAgreeCardExchange.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {tutorial.IReqAgreeCardExchange} message ReqAgreeCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAgreeCardExchange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Id);
return writer;
};
/**
* Encodes the specified ReqAgreeCardExchange message, length delimited. Does not implicitly {@link tutorial.ReqAgreeCardExchange.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {tutorial.IReqAgreeCardExchange} message ReqAgreeCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAgreeCardExchange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqAgreeCardExchange message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqAgreeCardExchange} ReqAgreeCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAgreeCardExchange.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.ReqAgreeCardExchange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqAgreeCardExchange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqAgreeCardExchange} ReqAgreeCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAgreeCardExchange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqAgreeCardExchange message.
* @function verify
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqAgreeCardExchange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ReqAgreeCardExchange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqAgreeCardExchange} ReqAgreeCardExchange
*/
ReqAgreeCardExchange.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqAgreeCardExchange)
return object;
var message = new $root.tutorial.ReqAgreeCardExchange();
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ReqAgreeCardExchange message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {tutorial.ReqAgreeCardExchange} message ReqAgreeCardExchange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqAgreeCardExchange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = "";
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqAgreeCardExchange to JSON.
* @function toJSON
* @memberof tutorial.ReqAgreeCardExchange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqAgreeCardExchange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqAgreeCardExchange
* @function getTypeUrl
* @memberof tutorial.ReqAgreeCardExchange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqAgreeCardExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqAgreeCardExchange";
};
return ReqAgreeCardExchange;
})();
tutorial.ResAgreeCardExchange = (function() {
/**
* Properties of a ResAgreeCardExchange.
* @memberof tutorial
* @interface IResAgreeCardExchange
* @property {tutorial.RES_CODE|null} [Code] ResAgreeCardExchange Code
* @property {string|null} [Msg] ResAgreeCardExchange Msg
* @property {string|null} [Id] ResAgreeCardExchange Id
*/
/**
* Constructs a new ResAgreeCardExchange.
* @memberof tutorial
* @classdesc Represents a ResAgreeCardExchange.
* @implements IResAgreeCardExchange
* @constructor
* @param {tutorial.IResAgreeCardExchange=} [properties] Properties to set
*/
function ResAgreeCardExchange(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]];
}
/**
* ResAgreeCardExchange Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResAgreeCardExchange
* @instance
*/
ResAgreeCardExchange.prototype.Code = 0;
/**
* ResAgreeCardExchange Msg.
* @member {string} Msg
* @memberof tutorial.ResAgreeCardExchange
* @instance
*/
ResAgreeCardExchange.prototype.Msg = "";
/**
* ResAgreeCardExchange Id.
* @member {string} Id
* @memberof tutorial.ResAgreeCardExchange
* @instance
*/
ResAgreeCardExchange.prototype.Id = "";
/**
* Creates a new ResAgreeCardExchange instance using the specified properties.
* @function create
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {tutorial.IResAgreeCardExchange=} [properties] Properties to set
* @returns {tutorial.ResAgreeCardExchange} ResAgreeCardExchange instance
*/
ResAgreeCardExchange.create = function create(properties) {
return new ResAgreeCardExchange(properties);
};
/**
* Encodes the specified ResAgreeCardExchange message. Does not implicitly {@link tutorial.ResAgreeCardExchange.verify|verify} messages.
* @function encode
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {tutorial.IResAgreeCardExchange} message ResAgreeCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAgreeCardExchange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.Id);
return writer;
};
/**
* Encodes the specified ResAgreeCardExchange message, length delimited. Does not implicitly {@link tutorial.ResAgreeCardExchange.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {tutorial.IResAgreeCardExchange} message ResAgreeCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAgreeCardExchange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResAgreeCardExchange message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResAgreeCardExchange} ResAgreeCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAgreeCardExchange.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.ResAgreeCardExchange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResAgreeCardExchange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResAgreeCardExchange} ResAgreeCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAgreeCardExchange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResAgreeCardExchange message.
* @function verify
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResAgreeCardExchange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ResAgreeCardExchange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResAgreeCardExchange} ResAgreeCardExchange
*/
ResAgreeCardExchange.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResAgreeCardExchange)
return object;
var message = new $root.tutorial.ResAgreeCardExchange();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ResAgreeCardExchange message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {tutorial.ResAgreeCardExchange} message ResAgreeCardExchange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResAgreeCardExchange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResAgreeCardExchange to JSON.
* @function toJSON
* @memberof tutorial.ResAgreeCardExchange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResAgreeCardExchange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResAgreeCardExchange
* @function getTypeUrl
* @memberof tutorial.ResAgreeCardExchange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResAgreeCardExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResAgreeCardExchange";
};
return ResAgreeCardExchange;
})();
tutorial.ReqRefuseCardSelect = (function() {
/**
* Properties of a ReqRefuseCardSelect.
* @memberof tutorial
* @interface IReqRefuseCardSelect
* @property {string|null} [Id] ReqRefuseCardSelect Id
*/
/**
* Constructs a new ReqRefuseCardSelect.
* @memberof tutorial
* @classdesc Represents a ReqRefuseCardSelect.
* @implements IReqRefuseCardSelect
* @constructor
* @param {tutorial.IReqRefuseCardSelect=} [properties] Properties to set
*/
function ReqRefuseCardSelect(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]];
}
/**
* ReqRefuseCardSelect Id.
* @member {string} Id
* @memberof tutorial.ReqRefuseCardSelect
* @instance
*/
ReqRefuseCardSelect.prototype.Id = "";
/**
* Creates a new ReqRefuseCardSelect instance using the specified properties.
* @function create
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {tutorial.IReqRefuseCardSelect=} [properties] Properties to set
* @returns {tutorial.ReqRefuseCardSelect} ReqRefuseCardSelect instance
*/
ReqRefuseCardSelect.create = function create(properties) {
return new ReqRefuseCardSelect(properties);
};
/**
* Encodes the specified ReqRefuseCardSelect message. Does not implicitly {@link tutorial.ReqRefuseCardSelect.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {tutorial.IReqRefuseCardSelect} message ReqRefuseCardSelect message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefuseCardSelect.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Id);
return writer;
};
/**
* Encodes the specified ReqRefuseCardSelect message, length delimited. Does not implicitly {@link tutorial.ReqRefuseCardSelect.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {tutorial.IReqRefuseCardSelect} message ReqRefuseCardSelect message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefuseCardSelect.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRefuseCardSelect message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRefuseCardSelect} ReqRefuseCardSelect
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefuseCardSelect.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.ReqRefuseCardSelect();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRefuseCardSelect message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRefuseCardSelect} ReqRefuseCardSelect
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefuseCardSelect.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRefuseCardSelect message.
* @function verify
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRefuseCardSelect.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ReqRefuseCardSelect message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRefuseCardSelect} ReqRefuseCardSelect
*/
ReqRefuseCardSelect.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRefuseCardSelect)
return object;
var message = new $root.tutorial.ReqRefuseCardSelect();
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ReqRefuseCardSelect message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {tutorial.ReqRefuseCardSelect} message ReqRefuseCardSelect
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRefuseCardSelect.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = "";
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqRefuseCardSelect to JSON.
* @function toJSON
* @memberof tutorial.ReqRefuseCardSelect
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRefuseCardSelect.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRefuseCardSelect
* @function getTypeUrl
* @memberof tutorial.ReqRefuseCardSelect
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRefuseCardSelect.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRefuseCardSelect";
};
return ReqRefuseCardSelect;
})();
tutorial.ResRefuseCardSelect = (function() {
/**
* Properties of a ResRefuseCardSelect.
* @memberof tutorial
* @interface IResRefuseCardSelect
* @property {tutorial.RES_CODE|null} [Code] ResRefuseCardSelect Code
* @property {string|null} [Msg] ResRefuseCardSelect Msg
* @property {string|null} [Id] ResRefuseCardSelect Id
*/
/**
* Constructs a new ResRefuseCardSelect.
* @memberof tutorial
* @classdesc Represents a ResRefuseCardSelect.
* @implements IResRefuseCardSelect
* @constructor
* @param {tutorial.IResRefuseCardSelect=} [properties] Properties to set
*/
function ResRefuseCardSelect(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]];
}
/**
* ResRefuseCardSelect Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResRefuseCardSelect
* @instance
*/
ResRefuseCardSelect.prototype.Code = 0;
/**
* ResRefuseCardSelect Msg.
* @member {string} Msg
* @memberof tutorial.ResRefuseCardSelect
* @instance
*/
ResRefuseCardSelect.prototype.Msg = "";
/**
* ResRefuseCardSelect Id.
* @member {string} Id
* @memberof tutorial.ResRefuseCardSelect
* @instance
*/
ResRefuseCardSelect.prototype.Id = "";
/**
* Creates a new ResRefuseCardSelect instance using the specified properties.
* @function create
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {tutorial.IResRefuseCardSelect=} [properties] Properties to set
* @returns {tutorial.ResRefuseCardSelect} ResRefuseCardSelect instance
*/
ResRefuseCardSelect.create = function create(properties) {
return new ResRefuseCardSelect(properties);
};
/**
* Encodes the specified ResRefuseCardSelect message. Does not implicitly {@link tutorial.ResRefuseCardSelect.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {tutorial.IResRefuseCardSelect} message ResRefuseCardSelect message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefuseCardSelect.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.Id);
return writer;
};
/**
* Encodes the specified ResRefuseCardSelect message, length delimited. Does not implicitly {@link tutorial.ResRefuseCardSelect.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {tutorial.IResRefuseCardSelect} message ResRefuseCardSelect message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefuseCardSelect.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRefuseCardSelect message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRefuseCardSelect} ResRefuseCardSelect
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefuseCardSelect.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.ResRefuseCardSelect();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRefuseCardSelect message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRefuseCardSelect} ResRefuseCardSelect
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefuseCardSelect.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRefuseCardSelect message.
* @function verify
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRefuseCardSelect.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ResRefuseCardSelect message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRefuseCardSelect} ResRefuseCardSelect
*/
ResRefuseCardSelect.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRefuseCardSelect)
return object;
var message = new $root.tutorial.ResRefuseCardSelect();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ResRefuseCardSelect message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {tutorial.ResRefuseCardSelect} message ResRefuseCardSelect
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRefuseCardSelect.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResRefuseCardSelect to JSON.
* @function toJSON
* @memberof tutorial.ResRefuseCardSelect
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRefuseCardSelect.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRefuseCardSelect
* @function getTypeUrl
* @memberof tutorial.ResRefuseCardSelect
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRefuseCardSelect.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRefuseCardSelect";
};
return ResRefuseCardSelect;
})();
tutorial.ReqRefuseCardExchange = (function() {
/**
* Properties of a ReqRefuseCardExchange.
* @memberof tutorial
* @interface IReqRefuseCardExchange
* @property {string|null} [Id] ReqRefuseCardExchange Id
*/
/**
* Constructs a new ReqRefuseCardExchange.
* @memberof tutorial
* @classdesc Represents a ReqRefuseCardExchange.
* @implements IReqRefuseCardExchange
* @constructor
* @param {tutorial.IReqRefuseCardExchange=} [properties] Properties to set
*/
function ReqRefuseCardExchange(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]];
}
/**
* ReqRefuseCardExchange Id.
* @member {string} Id
* @memberof tutorial.ReqRefuseCardExchange
* @instance
*/
ReqRefuseCardExchange.prototype.Id = "";
/**
* Creates a new ReqRefuseCardExchange instance using the specified properties.
* @function create
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {tutorial.IReqRefuseCardExchange=} [properties] Properties to set
* @returns {tutorial.ReqRefuseCardExchange} ReqRefuseCardExchange instance
*/
ReqRefuseCardExchange.create = function create(properties) {
return new ReqRefuseCardExchange(properties);
};
/**
* Encodes the specified ReqRefuseCardExchange message. Does not implicitly {@link tutorial.ReqRefuseCardExchange.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {tutorial.IReqRefuseCardExchange} message ReqRefuseCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefuseCardExchange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Id);
return writer;
};
/**
* Encodes the specified ReqRefuseCardExchange message, length delimited. Does not implicitly {@link tutorial.ReqRefuseCardExchange.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {tutorial.IReqRefuseCardExchange} message ReqRefuseCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefuseCardExchange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRefuseCardExchange message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRefuseCardExchange} ReqRefuseCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefuseCardExchange.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.ReqRefuseCardExchange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRefuseCardExchange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRefuseCardExchange} ReqRefuseCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefuseCardExchange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRefuseCardExchange message.
* @function verify
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRefuseCardExchange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ReqRefuseCardExchange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRefuseCardExchange} ReqRefuseCardExchange
*/
ReqRefuseCardExchange.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRefuseCardExchange)
return object;
var message = new $root.tutorial.ReqRefuseCardExchange();
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ReqRefuseCardExchange message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {tutorial.ReqRefuseCardExchange} message ReqRefuseCardExchange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRefuseCardExchange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = "";
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqRefuseCardExchange to JSON.
* @function toJSON
* @memberof tutorial.ReqRefuseCardExchange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRefuseCardExchange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRefuseCardExchange
* @function getTypeUrl
* @memberof tutorial.ReqRefuseCardExchange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRefuseCardExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRefuseCardExchange";
};
return ReqRefuseCardExchange;
})();
tutorial.ResRefuseCardExchange = (function() {
/**
* Properties of a ResRefuseCardExchange.
* @memberof tutorial
* @interface IResRefuseCardExchange
* @property {tutorial.RES_CODE|null} [Code] ResRefuseCardExchange Code
* @property {string|null} [Msg] ResRefuseCardExchange Msg
* @property {string|null} [Id] ResRefuseCardExchange Id
*/
/**
* Constructs a new ResRefuseCardExchange.
* @memberof tutorial
* @classdesc Represents a ResRefuseCardExchange.
* @implements IResRefuseCardExchange
* @constructor
* @param {tutorial.IResRefuseCardExchange=} [properties] Properties to set
*/
function ResRefuseCardExchange(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]];
}
/**
* ResRefuseCardExchange Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResRefuseCardExchange
* @instance
*/
ResRefuseCardExchange.prototype.Code = 0;
/**
* ResRefuseCardExchange Msg.
* @member {string} Msg
* @memberof tutorial.ResRefuseCardExchange
* @instance
*/
ResRefuseCardExchange.prototype.Msg = "";
/**
* ResRefuseCardExchange Id.
* @member {string} Id
* @memberof tutorial.ResRefuseCardExchange
* @instance
*/
ResRefuseCardExchange.prototype.Id = "";
/**
* Creates a new ResRefuseCardExchange instance using the specified properties.
* @function create
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {tutorial.IResRefuseCardExchange=} [properties] Properties to set
* @returns {tutorial.ResRefuseCardExchange} ResRefuseCardExchange instance
*/
ResRefuseCardExchange.create = function create(properties) {
return new ResRefuseCardExchange(properties);
};
/**
* Encodes the specified ResRefuseCardExchange message. Does not implicitly {@link tutorial.ResRefuseCardExchange.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {tutorial.IResRefuseCardExchange} message ResRefuseCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefuseCardExchange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.Id);
return writer;
};
/**
* Encodes the specified ResRefuseCardExchange message, length delimited. Does not implicitly {@link tutorial.ResRefuseCardExchange.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {tutorial.IResRefuseCardExchange} message ResRefuseCardExchange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefuseCardExchange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRefuseCardExchange message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRefuseCardExchange} ResRefuseCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefuseCardExchange.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.ResRefuseCardExchange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRefuseCardExchange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRefuseCardExchange} ResRefuseCardExchange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefuseCardExchange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRefuseCardExchange message.
* @function verify
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRefuseCardExchange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ResRefuseCardExchange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRefuseCardExchange} ResRefuseCardExchange
*/
ResRefuseCardExchange.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRefuseCardExchange)
return object;
var message = new $root.tutorial.ResRefuseCardExchange();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ResRefuseCardExchange message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {tutorial.ResRefuseCardExchange} message ResRefuseCardExchange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRefuseCardExchange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResRefuseCardExchange to JSON.
* @function toJSON
* @memberof tutorial.ResRefuseCardExchange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRefuseCardExchange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRefuseCardExchange
* @function getTypeUrl
* @memberof tutorial.ResRefuseCardExchange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRefuseCardExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRefuseCardExchange";
};
return ResRefuseCardExchange;
})();
tutorial.ReqGetFriendCard = (function() {
/**
* Properties of a ReqGetFriendCard.
* @memberof tutorial
* @interface IReqGetFriendCard
* @property {string|null} [Id] ReqGetFriendCard Id
*/
/**
* Constructs a new ReqGetFriendCard.
* @memberof tutorial
* @classdesc Represents a ReqGetFriendCard.
* @implements IReqGetFriendCard
* @constructor
* @param {tutorial.IReqGetFriendCard=} [properties] Properties to set
*/
function ReqGetFriendCard(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]];
}
/**
* ReqGetFriendCard Id.
* @member {string} Id
* @memberof tutorial.ReqGetFriendCard
* @instance
*/
ReqGetFriendCard.prototype.Id = "";
/**
* Creates a new ReqGetFriendCard instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {tutorial.IReqGetFriendCard=} [properties] Properties to set
* @returns {tutorial.ReqGetFriendCard} ReqGetFriendCard instance
*/
ReqGetFriendCard.create = function create(properties) {
return new ReqGetFriendCard(properties);
};
/**
* Encodes the specified ReqGetFriendCard message. Does not implicitly {@link tutorial.ReqGetFriendCard.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {tutorial.IReqGetFriendCard} message ReqGetFriendCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetFriendCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Id);
return writer;
};
/**
* Encodes the specified ReqGetFriendCard message, length delimited. Does not implicitly {@link tutorial.ReqGetFriendCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {tutorial.IReqGetFriendCard} message ReqGetFriendCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetFriendCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetFriendCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetFriendCard} ReqGetFriendCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetFriendCard.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.ReqGetFriendCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetFriendCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetFriendCard} ReqGetFriendCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetFriendCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetFriendCard message.
* @function verify
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetFriendCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ReqGetFriendCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetFriendCard} ReqGetFriendCard
*/
ReqGetFriendCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetFriendCard)
return object;
var message = new $root.tutorial.ReqGetFriendCard();
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ReqGetFriendCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {tutorial.ReqGetFriendCard} message ReqGetFriendCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetFriendCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = "";
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqGetFriendCard to JSON.
* @function toJSON
* @memberof tutorial.ReqGetFriendCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetFriendCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetFriendCard
* @function getTypeUrl
* @memberof tutorial.ReqGetFriendCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetFriendCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetFriendCard";
};
return ReqGetFriendCard;
})();
tutorial.ResGetFriendCard = (function() {
/**
* Properties of a ResGetFriendCard.
* @memberof tutorial
* @interface IResGetFriendCard
* @property {tutorial.RES_CODE|null} [Code] ResGetFriendCard Code
* @property {string|null} [Msg] ResGetFriendCard Msg
* @property {string|null} [Id] ResGetFriendCard Id
* @property {number|null} [CardId] ResGetFriendCard CardId
*/
/**
* Constructs a new ResGetFriendCard.
* @memberof tutorial
* @classdesc Represents a ResGetFriendCard.
* @implements IResGetFriendCard
* @constructor
* @param {tutorial.IResGetFriendCard=} [properties] Properties to set
*/
function ResGetFriendCard(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]];
}
/**
* ResGetFriendCard Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGetFriendCard
* @instance
*/
ResGetFriendCard.prototype.Code = 0;
/**
* ResGetFriendCard Msg.
* @member {string} Msg
* @memberof tutorial.ResGetFriendCard
* @instance
*/
ResGetFriendCard.prototype.Msg = "";
/**
* ResGetFriendCard Id.
* @member {string} Id
* @memberof tutorial.ResGetFriendCard
* @instance
*/
ResGetFriendCard.prototype.Id = "";
/**
* ResGetFriendCard CardId.
* @member {number} CardId
* @memberof tutorial.ResGetFriendCard
* @instance
*/
ResGetFriendCard.prototype.CardId = 0;
/**
* Creates a new ResGetFriendCard instance using the specified properties.
* @function create
* @memberof tutorial.ResGetFriendCard
* @static
* @param {tutorial.IResGetFriendCard=} [properties] Properties to set
* @returns {tutorial.ResGetFriendCard} ResGetFriendCard instance
*/
ResGetFriendCard.create = function create(properties) {
return new ResGetFriendCard(properties);
};
/**
* Encodes the specified ResGetFriendCard message. Does not implicitly {@link tutorial.ResGetFriendCard.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetFriendCard
* @static
* @param {tutorial.IResGetFriendCard} message ResGetFriendCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetFriendCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.Id);
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.CardId);
return writer;
};
/**
* Encodes the specified ResGetFriendCard message, length delimited. Does not implicitly {@link tutorial.ResGetFriendCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetFriendCard
* @static
* @param {tutorial.IResGetFriendCard} message ResGetFriendCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetFriendCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetFriendCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetFriendCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetFriendCard} ResGetFriendCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetFriendCard.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.ResGetFriendCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.string();
break;
}
case 4: {
message.CardId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetFriendCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetFriendCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetFriendCard} ResGetFriendCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetFriendCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetFriendCard message.
* @function verify
* @memberof tutorial.ResGetFriendCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetFriendCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
return null;
};
/**
* Creates a ResGetFriendCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetFriendCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetFriendCard} ResGetFriendCard
*/
ResGetFriendCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetFriendCard)
return object;
var message = new $root.tutorial.ResGetFriendCard();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = String(object.Id);
if (object.CardId != null)
message.CardId = object.CardId | 0;
return message;
};
/**
* Creates a plain object from a ResGetFriendCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetFriendCard
* @static
* @param {tutorial.ResGetFriendCard} message ResGetFriendCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetFriendCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = "";
object.CardId = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
return object;
};
/**
* Converts this ResGetFriendCard to JSON.
* @function toJSON
* @memberof tutorial.ResGetFriendCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetFriendCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetFriendCard
* @function getTypeUrl
* @memberof tutorial.ResGetFriendCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetFriendCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetFriendCard";
};
return ResGetFriendCard;
})();
tutorial.ReqGetGoldCard = (function() {
/**
* Properties of a ReqGetGoldCard.
* @memberof tutorial
* @interface IReqGetGoldCard
*/
/**
* Constructs a new ReqGetGoldCard.
* @memberof tutorial
* @classdesc Represents a ReqGetGoldCard.
* @implements IReqGetGoldCard
* @constructor
* @param {tutorial.IReqGetGoldCard=} [properties] Properties to set
*/
function ReqGetGoldCard(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]];
}
/**
* Creates a new ReqGetGoldCard instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {tutorial.IReqGetGoldCard=} [properties] Properties to set
* @returns {tutorial.ReqGetGoldCard} ReqGetGoldCard instance
*/
ReqGetGoldCard.create = function create(properties) {
return new ReqGetGoldCard(properties);
};
/**
* Encodes the specified ReqGetGoldCard message. Does not implicitly {@link tutorial.ReqGetGoldCard.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {tutorial.IReqGetGoldCard} message ReqGetGoldCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetGoldCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqGetGoldCard message, length delimited. Does not implicitly {@link tutorial.ReqGetGoldCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {tutorial.IReqGetGoldCard} message ReqGetGoldCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetGoldCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetGoldCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetGoldCard} ReqGetGoldCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetGoldCard.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.ReqGetGoldCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetGoldCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetGoldCard} ReqGetGoldCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetGoldCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetGoldCard message.
* @function verify
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetGoldCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqGetGoldCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetGoldCard} ReqGetGoldCard
*/
ReqGetGoldCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetGoldCard)
return object;
return new $root.tutorial.ReqGetGoldCard();
};
/**
* Creates a plain object from a ReqGetGoldCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {tutorial.ReqGetGoldCard} message ReqGetGoldCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetGoldCard.toObject = function toObject() {
return {};
};
/**
* Converts this ReqGetGoldCard to JSON.
* @function toJSON
* @memberof tutorial.ReqGetGoldCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetGoldCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetGoldCard
* @function getTypeUrl
* @memberof tutorial.ReqGetGoldCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetGoldCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetGoldCard";
};
return ReqGetGoldCard;
})();
tutorial.ResGetGoldCard = (function() {
/**
* Properties of a ResGetGoldCard.
* @memberof tutorial
* @interface IResGetGoldCard
* @property {number|null} [Four] ResGetGoldCard Four
* @property {number|null} [Five] ResGetGoldCard Five
*/
/**
* Constructs a new ResGetGoldCard.
* @memberof tutorial
* @classdesc Represents a ResGetGoldCard.
* @implements IResGetGoldCard
* @constructor
* @param {tutorial.IResGetGoldCard=} [properties] Properties to set
*/
function ResGetGoldCard(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]];
}
/**
* ResGetGoldCard Four.
* @member {number} Four
* @memberof tutorial.ResGetGoldCard
* @instance
*/
ResGetGoldCard.prototype.Four = 0;
/**
* ResGetGoldCard Five.
* @member {number} Five
* @memberof tutorial.ResGetGoldCard
* @instance
*/
ResGetGoldCard.prototype.Five = 0;
/**
* Creates a new ResGetGoldCard instance using the specified properties.
* @function create
* @memberof tutorial.ResGetGoldCard
* @static
* @param {tutorial.IResGetGoldCard=} [properties] Properties to set
* @returns {tutorial.ResGetGoldCard} ResGetGoldCard instance
*/
ResGetGoldCard.create = function create(properties) {
return new ResGetGoldCard(properties);
};
/**
* Encodes the specified ResGetGoldCard message. Does not implicitly {@link tutorial.ResGetGoldCard.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetGoldCard
* @static
* @param {tutorial.IResGetGoldCard} message ResGetGoldCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetGoldCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Four != null && Object.hasOwnProperty.call(message, "Four"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Four);
if (message.Five != null && Object.hasOwnProperty.call(message, "Five"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Five);
return writer;
};
/**
* Encodes the specified ResGetGoldCard message, length delimited. Does not implicitly {@link tutorial.ResGetGoldCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetGoldCard
* @static
* @param {tutorial.IResGetGoldCard} message ResGetGoldCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetGoldCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetGoldCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetGoldCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetGoldCard} ResGetGoldCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetGoldCard.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.ResGetGoldCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Four = reader.int32();
break;
}
case 2: {
message.Five = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetGoldCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetGoldCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetGoldCard} ResGetGoldCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetGoldCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetGoldCard message.
* @function verify
* @memberof tutorial.ResGetGoldCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetGoldCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Four != null && message.hasOwnProperty("Four"))
if (!$util.isInteger(message.Four))
return "Four: integer expected";
if (message.Five != null && message.hasOwnProperty("Five"))
if (!$util.isInteger(message.Five))
return "Five: integer expected";
return null;
};
/**
* Creates a ResGetGoldCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetGoldCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetGoldCard} ResGetGoldCard
*/
ResGetGoldCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetGoldCard)
return object;
var message = new $root.tutorial.ResGetGoldCard();
if (object.Four != null)
message.Four = object.Four | 0;
if (object.Five != null)
message.Five = object.Five | 0;
return message;
};
/**
* Creates a plain object from a ResGetGoldCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetGoldCard
* @static
* @param {tutorial.ResGetGoldCard} message ResGetGoldCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetGoldCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Four = 0;
object.Five = 0;
}
if (message.Four != null && message.hasOwnProperty("Four"))
object.Four = message.Four;
if (message.Five != null && message.hasOwnProperty("Five"))
object.Five = message.Five;
return object;
};
/**
* Converts this ResGetGoldCard to JSON.
* @function toJSON
* @memberof tutorial.ResGetGoldCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetGoldCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetGoldCard
* @function getTypeUrl
* @memberof tutorial.ResGetGoldCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetGoldCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetGoldCard";
};
return ResGetGoldCard;
})();
tutorial.ReqGuideReward = (function() {
/**
* Properties of a ReqGuideReward.
* @memberof tutorial
* @interface IReqGuideReward
* @property {number|null} [Id] ReqGuideReward Id
*/
/**
* Constructs a new ReqGuideReward.
* @memberof tutorial
* @classdesc Represents a ReqGuideReward.
* @implements IReqGuideReward
* @constructor
* @param {tutorial.IReqGuideReward=} [properties] Properties to set
*/
function ReqGuideReward(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]];
}
/**
* ReqGuideReward Id.
* @member {number} Id
* @memberof tutorial.ReqGuideReward
* @instance
*/
ReqGuideReward.prototype.Id = 0;
/**
* Creates a new ReqGuideReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGuideReward
* @static
* @param {tutorial.IReqGuideReward=} [properties] Properties to set
* @returns {tutorial.ReqGuideReward} ReqGuideReward instance
*/
ReqGuideReward.create = function create(properties) {
return new ReqGuideReward(properties);
};
/**
* Encodes the specified ReqGuideReward message. Does not implicitly {@link tutorial.ReqGuideReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGuideReward
* @static
* @param {tutorial.IReqGuideReward} message ReqGuideReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGuideReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqGuideReward message, length delimited. Does not implicitly {@link tutorial.ReqGuideReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGuideReward
* @static
* @param {tutorial.IReqGuideReward} message ReqGuideReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGuideReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGuideReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGuideReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGuideReward} ReqGuideReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGuideReward.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.ReqGuideReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGuideReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGuideReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGuideReward} ReqGuideReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGuideReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGuideReward message.
* @function verify
* @memberof tutorial.ReqGuideReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGuideReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqGuideReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGuideReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGuideReward} ReqGuideReward
*/
ReqGuideReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGuideReward)
return object;
var message = new $root.tutorial.ReqGuideReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqGuideReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGuideReward
* @static
* @param {tutorial.ReqGuideReward} message ReqGuideReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGuideReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqGuideReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGuideReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGuideReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGuideReward
* @function getTypeUrl
* @memberof tutorial.ReqGuideReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGuideReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGuideReward";
};
return ReqGuideReward;
})();
tutorial.ResGuideReward = (function() {
/**
* Properties of a ResGuideReward.
* @memberof tutorial
* @interface IResGuideReward
* @property {tutorial.RES_CODE|null} [Code] ResGuideReward Code
* @property {string|null} [Msg] ResGuideReward Msg
*/
/**
* Constructs a new ResGuideReward.
* @memberof tutorial
* @classdesc Represents a ResGuideReward.
* @implements IResGuideReward
* @constructor
* @param {tutorial.IResGuideReward=} [properties] Properties to set
*/
function ResGuideReward(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]];
}
/**
* ResGuideReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGuideReward
* @instance
*/
ResGuideReward.prototype.Code = 0;
/**
* ResGuideReward Msg.
* @member {string} Msg
* @memberof tutorial.ResGuideReward
* @instance
*/
ResGuideReward.prototype.Msg = "";
/**
* Creates a new ResGuideReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGuideReward
* @static
* @param {tutorial.IResGuideReward=} [properties] Properties to set
* @returns {tutorial.ResGuideReward} ResGuideReward instance
*/
ResGuideReward.create = function create(properties) {
return new ResGuideReward(properties);
};
/**
* Encodes the specified ResGuideReward message. Does not implicitly {@link tutorial.ResGuideReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGuideReward
* @static
* @param {tutorial.IResGuideReward} message ResGuideReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuideReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResGuideReward message, length delimited. Does not implicitly {@link tutorial.ResGuideReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGuideReward
* @static
* @param {tutorial.IResGuideReward} message ResGuideReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuideReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGuideReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGuideReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGuideReward} ResGuideReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuideReward.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.ResGuideReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGuideReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGuideReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGuideReward} ResGuideReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuideReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGuideReward message.
* @function verify
* @memberof tutorial.ResGuideReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGuideReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResGuideReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGuideReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGuideReward} ResGuideReward
*/
ResGuideReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGuideReward)
return object;
var message = new $root.tutorial.ResGuideReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResGuideReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGuideReward
* @static
* @param {tutorial.ResGuideReward} message ResGuideReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGuideReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResGuideReward to JSON.
* @function toJSON
* @memberof tutorial.ResGuideReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGuideReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGuideReward
* @function getTypeUrl
* @memberof tutorial.ResGuideReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGuideReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGuideReward";
};
return ResGuideReward;
})();
tutorial.ResGuildInfo = (function() {
/**
* Properties of a ResGuildInfo.
* @memberof tutorial
* @interface IResGuildInfo
* @property {Object.<string,number>|null} [Reward] ResGuildInfo Reward
*/
/**
* Constructs a new ResGuildInfo.
* @memberof tutorial
* @classdesc Represents a ResGuildInfo.
* @implements IResGuildInfo
* @constructor
* @param {tutorial.IResGuildInfo=} [properties] Properties to set
*/
function ResGuildInfo(properties) {
this.Reward = {};
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]];
}
/**
* ResGuildInfo Reward.
* @member {Object.<string,number>} Reward
* @memberof tutorial.ResGuildInfo
* @instance
*/
ResGuildInfo.prototype.Reward = $util.emptyObject;
/**
* Creates a new ResGuildInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResGuildInfo
* @static
* @param {tutorial.IResGuildInfo=} [properties] Properties to set
* @returns {tutorial.ResGuildInfo} ResGuildInfo instance
*/
ResGuildInfo.create = function create(properties) {
return new ResGuildInfo(properties);
};
/**
* Encodes the specified ResGuildInfo message. Does not implicitly {@link tutorial.ResGuildInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGuildInfo
* @static
* @param {tutorial.IResGuildInfo} message ResGuildInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuildInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Reward != null && Object.hasOwnProperty.call(message, "Reward"))
for (var keys = Object.keys(message.Reward), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Reward[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ResGuildInfo message, length delimited. Does not implicitly {@link tutorial.ResGuildInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGuildInfo
* @static
* @param {tutorial.IResGuildInfo} message ResGuildInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuildInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGuildInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGuildInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGuildInfo} ResGuildInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuildInfo.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.ResGuildInfo(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Reward === $util.emptyObject)
message.Reward = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Reward[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGuildInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGuildInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGuildInfo} ResGuildInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuildInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGuildInfo message.
* @function verify
* @memberof tutorial.ResGuildInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGuildInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Reward != null && message.hasOwnProperty("Reward")) {
if (!$util.isObject(message.Reward))
return "Reward: object expected";
var key = Object.keys(message.Reward);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Reward: integer key{k:int32} expected";
if (!$util.isInteger(message.Reward[key[i]]))
return "Reward: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates a ResGuildInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGuildInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGuildInfo} ResGuildInfo
*/
ResGuildInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGuildInfo)
return object;
var message = new $root.tutorial.ResGuildInfo();
if (object.Reward) {
if (typeof object.Reward !== "object")
throw TypeError(".tutorial.ResGuildInfo.Reward: object expected");
message.Reward = {};
for (var keys = Object.keys(object.Reward), i = 0; i < keys.length; ++i)
message.Reward[keys[i]] = object.Reward[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ResGuildInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGuildInfo
* @static
* @param {tutorial.ResGuildInfo} message ResGuildInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGuildInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Reward = {};
var keys2;
if (message.Reward && (keys2 = Object.keys(message.Reward)).length) {
object.Reward = {};
for (var j = 0; j < keys2.length; ++j)
object.Reward[keys2[j]] = message.Reward[keys2[j]];
}
return object;
};
/**
* Converts this ResGuildInfo to JSON.
* @function toJSON
* @memberof tutorial.ResGuildInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGuildInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGuildInfo
* @function getTypeUrl
* @memberof tutorial.ResGuildInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGuildInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGuildInfo";
};
return ResGuildInfo;
})();
tutorial.ResItemPop = (function() {
/**
* Properties of a ResItemPop.
* @memberof tutorial
* @interface IResItemPop
* @property {number|null} [Id] ResItemPop Id
* @property {Array.<tutorial.IItemInfo>|null} [Items] ResItemPop Items
* @property {Array.<tutorial.ICardPack>|null} [CardPacks] ResItemPop CardPacks
* @property {string|null} [Lable] ResItemPop Lable
*/
/**
* Constructs a new ResItemPop.
* @memberof tutorial
* @classdesc Represents a ResItemPop.
* @implements IResItemPop
* @constructor
* @param {tutorial.IResItemPop=} [properties] Properties to set
*/
function ResItemPop(properties) {
this.Items = [];
this.CardPacks = [];
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]];
}
/**
* ResItemPop Id.
* @member {number} Id
* @memberof tutorial.ResItemPop
* @instance
*/
ResItemPop.prototype.Id = 0;
/**
* ResItemPop Items.
* @member {Array.<tutorial.IItemInfo>} Items
* @memberof tutorial.ResItemPop
* @instance
*/
ResItemPop.prototype.Items = $util.emptyArray;
/**
* ResItemPop CardPacks.
* @member {Array.<tutorial.ICardPack>} CardPacks
* @memberof tutorial.ResItemPop
* @instance
*/
ResItemPop.prototype.CardPacks = $util.emptyArray;
/**
* ResItemPop Lable.
* @member {string} Lable
* @memberof tutorial.ResItemPop
* @instance
*/
ResItemPop.prototype.Lable = "";
/**
* Creates a new ResItemPop instance using the specified properties.
* @function create
* @memberof tutorial.ResItemPop
* @static
* @param {tutorial.IResItemPop=} [properties] Properties to set
* @returns {tutorial.ResItemPop} ResItemPop instance
*/
ResItemPop.create = function create(properties) {
return new ResItemPop(properties);
};
/**
* Encodes the specified ResItemPop message. Does not implicitly {@link tutorial.ResItemPop.verify|verify} messages.
* @function encode
* @memberof tutorial.ResItemPop
* @static
* @param {tutorial.IResItemPop} message ResItemPop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResItemPop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Items != null && message.Items.length)
for (var i = 0; i < message.Items.length; ++i)
$root.tutorial.ItemInfo.encode(message.Items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.CardPacks != null && message.CardPacks.length)
for (var i = 0; i < message.CardPacks.length; ++i)
$root.tutorial.CardPack.encode(message.CardPacks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.Lable != null && Object.hasOwnProperty.call(message, "Lable"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.Lable);
return writer;
};
/**
* Encodes the specified ResItemPop message, length delimited. Does not implicitly {@link tutorial.ResItemPop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResItemPop
* @static
* @param {tutorial.IResItemPop} message ResItemPop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResItemPop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResItemPop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResItemPop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResItemPop} ResItemPop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResItemPop.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.ResItemPop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
if (!(message.Items && message.Items.length))
message.Items = [];
message.Items.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
case 3: {
if (!(message.CardPacks && message.CardPacks.length))
message.CardPacks = [];
message.CardPacks.push($root.tutorial.CardPack.decode(reader, reader.uint32()));
break;
}
case 4: {
message.Lable = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResItemPop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResItemPop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResItemPop} ResItemPop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResItemPop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResItemPop message.
* @function verify
* @memberof tutorial.ResItemPop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResItemPop.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))
return "Id: integer expected";
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!Array.isArray(message.Items))
return "Items: array expected";
for (var i = 0; i < message.Items.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Items[i]);
if (error)
return "Items." + error;
}
}
if (message.CardPacks != null && message.hasOwnProperty("CardPacks")) {
if (!Array.isArray(message.CardPacks))
return "CardPacks: array expected";
for (var i = 0; i < message.CardPacks.length; ++i) {
var error = $root.tutorial.CardPack.verify(message.CardPacks[i]);
if (error)
return "CardPacks." + error;
}
}
if (message.Lable != null && message.hasOwnProperty("Lable"))
if (!$util.isString(message.Lable))
return "Lable: string expected";
return null;
};
/**
* Creates a ResItemPop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResItemPop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResItemPop} ResItemPop
*/
ResItemPop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResItemPop)
return object;
var message = new $root.tutorial.ResItemPop();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Items) {
if (!Array.isArray(object.Items))
throw TypeError(".tutorial.ResItemPop.Items: array expected");
message.Items = [];
for (var i = 0; i < object.Items.length; ++i) {
if (typeof object.Items[i] !== "object")
throw TypeError(".tutorial.ResItemPop.Items: object expected");
message.Items[i] = $root.tutorial.ItemInfo.fromObject(object.Items[i]);
}
}
if (object.CardPacks) {
if (!Array.isArray(object.CardPacks))
throw TypeError(".tutorial.ResItemPop.CardPacks: array expected");
message.CardPacks = [];
for (var i = 0; i < object.CardPacks.length; ++i) {
if (typeof object.CardPacks[i] !== "object")
throw TypeError(".tutorial.ResItemPop.CardPacks: object expected");
message.CardPacks[i] = $root.tutorial.CardPack.fromObject(object.CardPacks[i]);
}
}
if (object.Lable != null)
message.Lable = String(object.Lable);
return message;
};
/**
* Creates a plain object from a ResItemPop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResItemPop
* @static
* @param {tutorial.ResItemPop} message ResItemPop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResItemPop.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.Items = [];
object.CardPacks = [];
}
if (options.defaults) {
object.Id = 0;
object.Lable = "";
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Items && message.Items.length) {
object.Items = [];
for (var j = 0; j < message.Items.length; ++j)
object.Items[j] = $root.tutorial.ItemInfo.toObject(message.Items[j], options);
}
if (message.CardPacks && message.CardPacks.length) {
object.CardPacks = [];
for (var j = 0; j < message.CardPacks.length; ++j)
object.CardPacks[j] = $root.tutorial.CardPack.toObject(message.CardPacks[j], options);
}
if (message.Lable != null && message.hasOwnProperty("Lable"))
object.Lable = message.Lable;
return object;
};
/**
* Converts this ResItemPop to JSON.
* @function toJSON
* @memberof tutorial.ResItemPop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResItemPop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResItemPop
* @function getTypeUrl
* @memberof tutorial.ResItemPop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResItemPop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResItemPop";
};
return ResItemPop;
})();
tutorial.ItemInfo = (function() {
/**
* Properties of an ItemInfo.
* @memberof tutorial
* @interface IItemInfo
* @property {number|null} [Id] ItemInfo Id
* @property {number|null} [Num] ItemInfo Num
*/
/**
* Constructs a new ItemInfo.
* @memberof tutorial
* @classdesc Represents an ItemInfo.
* @implements IItemInfo
* @constructor
* @param {tutorial.IItemInfo=} [properties] Properties to set
*/
function ItemInfo(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]];
}
/**
* ItemInfo Id.
* @member {number} Id
* @memberof tutorial.ItemInfo
* @instance
*/
ItemInfo.prototype.Id = 0;
/**
* ItemInfo Num.
* @member {number} Num
* @memberof tutorial.ItemInfo
* @instance
*/
ItemInfo.prototype.Num = 0;
/**
* Creates a new ItemInfo instance using the specified properties.
* @function create
* @memberof tutorial.ItemInfo
* @static
* @param {tutorial.IItemInfo=} [properties] Properties to set
* @returns {tutorial.ItemInfo} ItemInfo instance
*/
ItemInfo.create = function create(properties) {
return new ItemInfo(properties);
};
/**
* Encodes the specified ItemInfo message. Does not implicitly {@link tutorial.ItemInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ItemInfo
* @static
* @param {tutorial.IItemInfo} message ItemInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ItemInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Num != null && Object.hasOwnProperty.call(message, "Num"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Num);
return writer;
};
/**
* Encodes the specified ItemInfo message, length delimited. Does not implicitly {@link tutorial.ItemInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ItemInfo
* @static
* @param {tutorial.IItemInfo} message ItemInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ItemInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ItemInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ItemInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ItemInfo} ItemInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ItemInfo.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.ItemInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Num = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ItemInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ItemInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ItemInfo} ItemInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ItemInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ItemInfo message.
* @function verify
* @memberof tutorial.ItemInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ItemInfo.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))
return "Id: integer expected";
if (message.Num != null && message.hasOwnProperty("Num"))
if (!$util.isInteger(message.Num))
return "Num: integer expected";
return null;
};
/**
* Creates an ItemInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ItemInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ItemInfo} ItemInfo
*/
ItemInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ItemInfo)
return object;
var message = new $root.tutorial.ItemInfo();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Num != null)
message.Num = object.Num | 0;
return message;
};
/**
* Creates a plain object from an ItemInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ItemInfo
* @static
* @param {tutorial.ItemInfo} message ItemInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ItemInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.Num = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Num != null && message.hasOwnProperty("Num"))
object.Num = message.Num;
return object;
};
/**
* Converts this ItemInfo to JSON.
* @function toJSON
* @memberof tutorial.ItemInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ItemInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ItemInfo
* @function getTypeUrl
* @memberof tutorial.ItemInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ItemInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ItemInfo";
};
return ItemInfo;
})();
tutorial.CardPack = (function() {
/**
* Properties of a CardPack.
* @memberof tutorial
* @interface ICardPack
* @property {number|null} [Id] CardPack Id
* @property {Array.<number>|null} [Card] CardPack Card
*/
/**
* Constructs a new CardPack.
* @memberof tutorial
* @classdesc Represents a CardPack.
* @implements ICardPack
* @constructor
* @param {tutorial.ICardPack=} [properties] Properties to set
*/
function CardPack(properties) {
this.Card = [];
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]];
}
/**
* CardPack Id.
* @member {number} Id
* @memberof tutorial.CardPack
* @instance
*/
CardPack.prototype.Id = 0;
/**
* CardPack Card.
* @member {Array.<number>} Card
* @memberof tutorial.CardPack
* @instance
*/
CardPack.prototype.Card = $util.emptyArray;
/**
* Creates a new CardPack instance using the specified properties.
* @function create
* @memberof tutorial.CardPack
* @static
* @param {tutorial.ICardPack=} [properties] Properties to set
* @returns {tutorial.CardPack} CardPack instance
*/
CardPack.create = function create(properties) {
return new CardPack(properties);
};
/**
* Encodes the specified CardPack message. Does not implicitly {@link tutorial.CardPack.verify|verify} messages.
* @function encode
* @memberof tutorial.CardPack
* @static
* @param {tutorial.ICardPack} message CardPack message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CardPack.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Card != null && message.Card.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.Card.length; ++i)
writer.int32(message.Card[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified CardPack message, length delimited. Does not implicitly {@link tutorial.CardPack.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.CardPack
* @static
* @param {tutorial.ICardPack} message CardPack message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CardPack.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CardPack message from the specified reader or buffer.
* @function decode
* @memberof tutorial.CardPack
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.CardPack} CardPack
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CardPack.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.CardPack();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
if (!(message.Card && message.Card.length))
message.Card = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Card.push(reader.int32());
} else
message.Card.push(reader.int32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CardPack message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.CardPack
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.CardPack} CardPack
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CardPack.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CardPack message.
* @function verify
* @memberof tutorial.CardPack
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CardPack.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))
return "Id: integer expected";
if (message.Card != null && message.hasOwnProperty("Card")) {
if (!Array.isArray(message.Card))
return "Card: array expected";
for (var i = 0; i < message.Card.length; ++i)
if (!$util.isInteger(message.Card[i]))
return "Card: integer[] expected";
}
return null;
};
/**
* Creates a CardPack message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.CardPack
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.CardPack} CardPack
*/
CardPack.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.CardPack)
return object;
var message = new $root.tutorial.CardPack();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Card) {
if (!Array.isArray(object.Card))
throw TypeError(".tutorial.CardPack.Card: array expected");
message.Card = [];
for (var i = 0; i < object.Card.length; ++i)
message.Card[i] = object.Card[i] | 0;
}
return message;
};
/**
* Creates a plain object from a CardPack message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.CardPack
* @static
* @param {tutorial.CardPack} message CardPack
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CardPack.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Card = [];
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Card && message.Card.length) {
object.Card = [];
for (var j = 0; j < message.Card.length; ++j)
object.Card[j] = message.Card[j];
}
return object;
};
/**
* Converts this CardPack to JSON.
* @function toJSON
* @memberof tutorial.CardPack
* @instance
* @returns {Object.<string,*>} JSON object
*/
CardPack.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CardPack
* @function getTypeUrl
* @memberof tutorial.CardPack
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CardPack.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.CardPack";
};
return CardPack;
})();
tutorial.ResDailyTask = (function() {
/**
* Properties of a ResDailyTask.
* @memberof tutorial
* @interface IResDailyTask
* @property {Object.<string,tutorial.IDailyWeek>|null} [WeekReward] ResDailyTask WeekReward
* @property {Object.<string,tutorial.IDailyTask>|null} [DailyTask] ResDailyTask DailyTask
* @property {number|null} [Active] ResDailyTask Active
* @property {number|null} [DayEnd] ResDailyTask DayEnd
* @property {number|null} [WeekEnd] ResDailyTask WeekEnd
*/
/**
* Constructs a new ResDailyTask.
* @memberof tutorial
* @classdesc Represents a ResDailyTask.
* @implements IResDailyTask
* @constructor
* @param {tutorial.IResDailyTask=} [properties] Properties to set
*/
function ResDailyTask(properties) {
this.WeekReward = {};
this.DailyTask = {};
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]];
}
/**
* ResDailyTask WeekReward.
* @member {Object.<string,tutorial.IDailyWeek>} WeekReward
* @memberof tutorial.ResDailyTask
* @instance
*/
ResDailyTask.prototype.WeekReward = $util.emptyObject;
/**
* ResDailyTask DailyTask.
* @member {Object.<string,tutorial.IDailyTask>} DailyTask
* @memberof tutorial.ResDailyTask
* @instance
*/
ResDailyTask.prototype.DailyTask = $util.emptyObject;
/**
* ResDailyTask Active.
* @member {number} Active
* @memberof tutorial.ResDailyTask
* @instance
*/
ResDailyTask.prototype.Active = 0;
/**
* ResDailyTask DayEnd.
* @member {number} DayEnd
* @memberof tutorial.ResDailyTask
* @instance
*/
ResDailyTask.prototype.DayEnd = 0;
/**
* ResDailyTask WeekEnd.
* @member {number} WeekEnd
* @memberof tutorial.ResDailyTask
* @instance
*/
ResDailyTask.prototype.WeekEnd = 0;
/**
* Creates a new ResDailyTask instance using the specified properties.
* @function create
* @memberof tutorial.ResDailyTask
* @static
* @param {tutorial.IResDailyTask=} [properties] Properties to set
* @returns {tutorial.ResDailyTask} ResDailyTask instance
*/
ResDailyTask.create = function create(properties) {
return new ResDailyTask(properties);
};
/**
* Encodes the specified ResDailyTask message. Does not implicitly {@link tutorial.ResDailyTask.verify|verify} messages.
* @function encode
* @memberof tutorial.ResDailyTask
* @static
* @param {tutorial.IResDailyTask} message ResDailyTask message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDailyTask.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.WeekReward != null && Object.hasOwnProperty.call(message, "WeekReward"))
for (var keys = Object.keys(message.WeekReward), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.DailyWeek.encode(message.WeekReward[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.DailyTask != null && Object.hasOwnProperty.call(message, "DailyTask"))
for (var keys = Object.keys(message.DailyTask), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.DailyTask.encode(message.DailyTask[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.Active != null && Object.hasOwnProperty.call(message, "Active"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Active);
if (message.DayEnd != null && Object.hasOwnProperty.call(message, "DayEnd"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.DayEnd);
if (message.WeekEnd != null && Object.hasOwnProperty.call(message, "WeekEnd"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.WeekEnd);
return writer;
};
/**
* Encodes the specified ResDailyTask message, length delimited. Does not implicitly {@link tutorial.ResDailyTask.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResDailyTask
* @static
* @param {tutorial.IResDailyTask} message ResDailyTask message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDailyTask.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResDailyTask message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResDailyTask
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResDailyTask} ResDailyTask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDailyTask.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.ResDailyTask(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.WeekReward === $util.emptyObject)
message.WeekReward = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.DailyWeek.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.WeekReward[key] = value;
break;
}
case 2: {
if (message.DailyTask === $util.emptyObject)
message.DailyTask = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.DailyTask.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.DailyTask[key] = value;
break;
}
case 3: {
message.Active = reader.int32();
break;
}
case 4: {
message.DayEnd = reader.int32();
break;
}
case 5: {
message.WeekEnd = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResDailyTask message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResDailyTask
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResDailyTask} ResDailyTask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDailyTask.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResDailyTask message.
* @function verify
* @memberof tutorial.ResDailyTask
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResDailyTask.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.WeekReward != null && message.hasOwnProperty("WeekReward")) {
if (!$util.isObject(message.WeekReward))
return "WeekReward: object expected";
var key = Object.keys(message.WeekReward);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "WeekReward: integer key{k:int32} expected";
{
var error = $root.tutorial.DailyWeek.verify(message.WeekReward[key[i]]);
if (error)
return "WeekReward." + error;
}
}
}
if (message.DailyTask != null && message.hasOwnProperty("DailyTask")) {
if (!$util.isObject(message.DailyTask))
return "DailyTask: object expected";
var key = Object.keys(message.DailyTask);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "DailyTask: integer key{k:int32} expected";
{
var error = $root.tutorial.DailyTask.verify(message.DailyTask[key[i]]);
if (error)
return "DailyTask." + error;
}
}
}
if (message.Active != null && message.hasOwnProperty("Active"))
if (!$util.isInteger(message.Active))
return "Active: integer expected";
if (message.DayEnd != null && message.hasOwnProperty("DayEnd"))
if (!$util.isInteger(message.DayEnd))
return "DayEnd: integer expected";
if (message.WeekEnd != null && message.hasOwnProperty("WeekEnd"))
if (!$util.isInteger(message.WeekEnd))
return "WeekEnd: integer expected";
return null;
};
/**
* Creates a ResDailyTask message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResDailyTask
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResDailyTask} ResDailyTask
*/
ResDailyTask.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResDailyTask)
return object;
var message = new $root.tutorial.ResDailyTask();
if (object.WeekReward) {
if (typeof object.WeekReward !== "object")
throw TypeError(".tutorial.ResDailyTask.WeekReward: object expected");
message.WeekReward = {};
for (var keys = Object.keys(object.WeekReward), i = 0; i < keys.length; ++i) {
if (typeof object.WeekReward[keys[i]] !== "object")
throw TypeError(".tutorial.ResDailyTask.WeekReward: object expected");
message.WeekReward[keys[i]] = $root.tutorial.DailyWeek.fromObject(object.WeekReward[keys[i]]);
}
}
if (object.DailyTask) {
if (typeof object.DailyTask !== "object")
throw TypeError(".tutorial.ResDailyTask.DailyTask: object expected");
message.DailyTask = {};
for (var keys = Object.keys(object.DailyTask), i = 0; i < keys.length; ++i) {
if (typeof object.DailyTask[keys[i]] !== "object")
throw TypeError(".tutorial.ResDailyTask.DailyTask: object expected");
message.DailyTask[keys[i]] = $root.tutorial.DailyTask.fromObject(object.DailyTask[keys[i]]);
}
}
if (object.Active != null)
message.Active = object.Active | 0;
if (object.DayEnd != null)
message.DayEnd = object.DayEnd | 0;
if (object.WeekEnd != null)
message.WeekEnd = object.WeekEnd | 0;
return message;
};
/**
* Creates a plain object from a ResDailyTask message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResDailyTask
* @static
* @param {tutorial.ResDailyTask} message ResDailyTask
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResDailyTask.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults) {
object.WeekReward = {};
object.DailyTask = {};
}
if (options.defaults) {
object.Active = 0;
object.DayEnd = 0;
object.WeekEnd = 0;
}
var keys2;
if (message.WeekReward && (keys2 = Object.keys(message.WeekReward)).length) {
object.WeekReward = {};
for (var j = 0; j < keys2.length; ++j)
object.WeekReward[keys2[j]] = $root.tutorial.DailyWeek.toObject(message.WeekReward[keys2[j]], options);
}
if (message.DailyTask && (keys2 = Object.keys(message.DailyTask)).length) {
object.DailyTask = {};
for (var j = 0; j < keys2.length; ++j)
object.DailyTask[keys2[j]] = $root.tutorial.DailyTask.toObject(message.DailyTask[keys2[j]], options);
}
if (message.Active != null && message.hasOwnProperty("Active"))
object.Active = message.Active;
if (message.DayEnd != null && message.hasOwnProperty("DayEnd"))
object.DayEnd = message.DayEnd;
if (message.WeekEnd != null && message.hasOwnProperty("WeekEnd"))
object.WeekEnd = message.WeekEnd;
return object;
};
/**
* Converts this ResDailyTask to JSON.
* @function toJSON
* @memberof tutorial.ResDailyTask
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResDailyTask.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResDailyTask
* @function getTypeUrl
* @memberof tutorial.ResDailyTask
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResDailyTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResDailyTask";
};
return ResDailyTask;
})();
tutorial.DailyWeek = (function() {
/**
* Properties of a DailyWeek.
* @memberof tutorial
* @interface IDailyWeek
* @property {Array.<tutorial.IItemInfo>|null} [Items] DailyWeek Items
* @property {boolean|null} [Status] DailyWeek Status
* @property {number|null} [NeedActive] DailyWeek NeedActive
*/
/**
* Constructs a new DailyWeek.
* @memberof tutorial
* @classdesc Represents a DailyWeek.
* @implements IDailyWeek
* @constructor
* @param {tutorial.IDailyWeek=} [properties] Properties to set
*/
function DailyWeek(properties) {
this.Items = [];
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]];
}
/**
* DailyWeek Items.
* @member {Array.<tutorial.IItemInfo>} Items
* @memberof tutorial.DailyWeek
* @instance
*/
DailyWeek.prototype.Items = $util.emptyArray;
/**
* DailyWeek Status.
* @member {boolean} Status
* @memberof tutorial.DailyWeek
* @instance
*/
DailyWeek.prototype.Status = false;
/**
* DailyWeek NeedActive.
* @member {number} NeedActive
* @memberof tutorial.DailyWeek
* @instance
*/
DailyWeek.prototype.NeedActive = 0;
/**
* Creates a new DailyWeek instance using the specified properties.
* @function create
* @memberof tutorial.DailyWeek
* @static
* @param {tutorial.IDailyWeek=} [properties] Properties to set
* @returns {tutorial.DailyWeek} DailyWeek instance
*/
DailyWeek.create = function create(properties) {
return new DailyWeek(properties);
};
/**
* Encodes the specified DailyWeek message. Does not implicitly {@link tutorial.DailyWeek.verify|verify} messages.
* @function encode
* @memberof tutorial.DailyWeek
* @static
* @param {tutorial.IDailyWeek} message DailyWeek message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DailyWeek.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Items != null && message.Items.length)
for (var i = 0; i < message.Items.length; ++i)
$root.tutorial.ItemInfo.encode(message.Items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.Status);
if (message.NeedActive != null && Object.hasOwnProperty.call(message, "NeedActive"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.NeedActive);
return writer;
};
/**
* Encodes the specified DailyWeek message, length delimited. Does not implicitly {@link tutorial.DailyWeek.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.DailyWeek
* @static
* @param {tutorial.IDailyWeek} message DailyWeek message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DailyWeek.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a DailyWeek message from the specified reader or buffer.
* @function decode
* @memberof tutorial.DailyWeek
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.DailyWeek} DailyWeek
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DailyWeek.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.DailyWeek();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.Items && message.Items.length))
message.Items = [];
message.Items.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
case 2: {
message.Status = reader.bool();
break;
}
case 3: {
message.NeedActive = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a DailyWeek message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.DailyWeek
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.DailyWeek} DailyWeek
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DailyWeek.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a DailyWeek message.
* @function verify
* @memberof tutorial.DailyWeek
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
DailyWeek.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!Array.isArray(message.Items))
return "Items: array expected";
for (var i = 0; i < message.Items.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Items[i]);
if (error)
return "Items." + error;
}
}
if (message.Status != null && message.hasOwnProperty("Status"))
if (typeof message.Status !== "boolean")
return "Status: boolean expected";
if (message.NeedActive != null && message.hasOwnProperty("NeedActive"))
if (!$util.isInteger(message.NeedActive))
return "NeedActive: integer expected";
return null;
};
/**
* Creates a DailyWeek message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.DailyWeek
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.DailyWeek} DailyWeek
*/
DailyWeek.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.DailyWeek)
return object;
var message = new $root.tutorial.DailyWeek();
if (object.Items) {
if (!Array.isArray(object.Items))
throw TypeError(".tutorial.DailyWeek.Items: array expected");
message.Items = [];
for (var i = 0; i < object.Items.length; ++i) {
if (typeof object.Items[i] !== "object")
throw TypeError(".tutorial.DailyWeek.Items: object expected");
message.Items[i] = $root.tutorial.ItemInfo.fromObject(object.Items[i]);
}
}
if (object.Status != null)
message.Status = Boolean(object.Status);
if (object.NeedActive != null)
message.NeedActive = object.NeedActive | 0;
return message;
};
/**
* Creates a plain object from a DailyWeek message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.DailyWeek
* @static
* @param {tutorial.DailyWeek} message DailyWeek
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
DailyWeek.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Items = [];
if (options.defaults) {
object.Status = false;
object.NeedActive = 0;
}
if (message.Items && message.Items.length) {
object.Items = [];
for (var j = 0; j < message.Items.length; ++j)
object.Items[j] = $root.tutorial.ItemInfo.toObject(message.Items[j], options);
}
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.NeedActive != null && message.hasOwnProperty("NeedActive"))
object.NeedActive = message.NeedActive;
return object;
};
/**
* Converts this DailyWeek to JSON.
* @function toJSON
* @memberof tutorial.DailyWeek
* @instance
* @returns {Object.<string,*>} JSON object
*/
DailyWeek.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for DailyWeek
* @function getTypeUrl
* @memberof tutorial.DailyWeek
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
DailyWeek.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.DailyWeek";
};
return DailyWeek;
})();
tutorial.DailyTask = (function() {
/**
* Properties of a DailyTask.
* @memberof tutorial
* @interface IDailyTask
* @property {number|null} [Status] DailyTask Status
* @property {boolean|null} [UnLock] DailyTask UnLock
* @property {tutorial.IQuestProgress|null} [Progress] DailyTask Progress
* @property {Array.<tutorial.IItemInfo>|null} [Items] DailyTask Items
*/
/**
* Constructs a new DailyTask.
* @memberof tutorial
* @classdesc Represents a DailyTask.
* @implements IDailyTask
* @constructor
* @param {tutorial.IDailyTask=} [properties] Properties to set
*/
function DailyTask(properties) {
this.Items = [];
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]];
}
/**
* DailyTask Status.
* @member {number} Status
* @memberof tutorial.DailyTask
* @instance
*/
DailyTask.prototype.Status = 0;
/**
* DailyTask UnLock.
* @member {boolean} UnLock
* @memberof tutorial.DailyTask
* @instance
*/
DailyTask.prototype.UnLock = false;
/**
* DailyTask Progress.
* @member {tutorial.IQuestProgress|null|undefined} Progress
* @memberof tutorial.DailyTask
* @instance
*/
DailyTask.prototype.Progress = null;
/**
* DailyTask Items.
* @member {Array.<tutorial.IItemInfo>} Items
* @memberof tutorial.DailyTask
* @instance
*/
DailyTask.prototype.Items = $util.emptyArray;
/**
* Creates a new DailyTask instance using the specified properties.
* @function create
* @memberof tutorial.DailyTask
* @static
* @param {tutorial.IDailyTask=} [properties] Properties to set
* @returns {tutorial.DailyTask} DailyTask instance
*/
DailyTask.create = function create(properties) {
return new DailyTask(properties);
};
/**
* Encodes the specified DailyTask message. Does not implicitly {@link tutorial.DailyTask.verify|verify} messages.
* @function encode
* @memberof tutorial.DailyTask
* @static
* @param {tutorial.IDailyTask} message DailyTask message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DailyTask.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Status);
if (message.UnLock != null && Object.hasOwnProperty.call(message, "UnLock"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.UnLock);
if (message.Progress != null && Object.hasOwnProperty.call(message, "Progress"))
$root.tutorial.QuestProgress.encode(message.Progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.Items != null && message.Items.length)
for (var i = 0; i < message.Items.length; ++i)
$root.tutorial.ItemInfo.encode(message.Items[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
return writer;
};
/**
* Encodes the specified DailyTask message, length delimited. Does not implicitly {@link tutorial.DailyTask.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.DailyTask
* @static
* @param {tutorial.IDailyTask} message DailyTask message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DailyTask.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a DailyTask message from the specified reader or buffer.
* @function decode
* @memberof tutorial.DailyTask
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.DailyTask} DailyTask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DailyTask.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.DailyTask();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Status = reader.int32();
break;
}
case 2: {
message.UnLock = reader.bool();
break;
}
case 3: {
message.Progress = $root.tutorial.QuestProgress.decode(reader, reader.uint32());
break;
}
case 4: {
if (!(message.Items && message.Items.length))
message.Items = [];
message.Items.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a DailyTask message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.DailyTask
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.DailyTask} DailyTask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DailyTask.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a DailyTask message.
* @function verify
* @memberof tutorial.DailyTask
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
DailyTask.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.UnLock != null && message.hasOwnProperty("UnLock"))
if (typeof message.UnLock !== "boolean")
return "UnLock: boolean expected";
if (message.Progress != null && message.hasOwnProperty("Progress")) {
var error = $root.tutorial.QuestProgress.verify(message.Progress);
if (error)
return "Progress." + error;
}
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!Array.isArray(message.Items))
return "Items: array expected";
for (var i = 0; i < message.Items.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Items[i]);
if (error)
return "Items." + error;
}
}
return null;
};
/**
* Creates a DailyTask message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.DailyTask
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.DailyTask} DailyTask
*/
DailyTask.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.DailyTask)
return object;
var message = new $root.tutorial.DailyTask();
if (object.Status != null)
message.Status = object.Status | 0;
if (object.UnLock != null)
message.UnLock = Boolean(object.UnLock);
if (object.Progress != null) {
if (typeof object.Progress !== "object")
throw TypeError(".tutorial.DailyTask.Progress: object expected");
message.Progress = $root.tutorial.QuestProgress.fromObject(object.Progress);
}
if (object.Items) {
if (!Array.isArray(object.Items))
throw TypeError(".tutorial.DailyTask.Items: array expected");
message.Items = [];
for (var i = 0; i < object.Items.length; ++i) {
if (typeof object.Items[i] !== "object")
throw TypeError(".tutorial.DailyTask.Items: object expected");
message.Items[i] = $root.tutorial.ItemInfo.fromObject(object.Items[i]);
}
}
return message;
};
/**
* Creates a plain object from a DailyTask message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.DailyTask
* @static
* @param {tutorial.DailyTask} message DailyTask
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
DailyTask.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Items = [];
if (options.defaults) {
object.Status = 0;
object.UnLock = false;
object.Progress = null;
}
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.UnLock != null && message.hasOwnProperty("UnLock"))
object.UnLock = message.UnLock;
if (message.Progress != null && message.hasOwnProperty("Progress"))
object.Progress = $root.tutorial.QuestProgress.toObject(message.Progress, options);
if (message.Items && message.Items.length) {
object.Items = [];
for (var j = 0; j < message.Items.length; ++j)
object.Items[j] = $root.tutorial.ItemInfo.toObject(message.Items[j], options);
}
return object;
};
/**
* Converts this DailyTask to JSON.
* @function toJSON
* @memberof tutorial.DailyTask
* @instance
* @returns {Object.<string,*>} JSON object
*/
DailyTask.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for DailyTask
* @function getTypeUrl
* @memberof tutorial.DailyTask
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
DailyTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.DailyTask";
};
return DailyTask;
})();
tutorial.QuestProgress = (function() {
/**
* Properties of a QuestProgress.
* @memberof tutorial
* @interface IQuestProgress
* @property {string|null} [Label] QuestProgress Label
* @property {number|null} [Num] QuestProgress Num
* @property {number|null} [Target] QuestProgress Target
* @property {boolean|null} [Status] QuestProgress Status
* @property {number|null} [Param] QuestProgress Param
*/
/**
* Constructs a new QuestProgress.
* @memberof tutorial
* @classdesc Represents a QuestProgress.
* @implements IQuestProgress
* @constructor
* @param {tutorial.IQuestProgress=} [properties] Properties to set
*/
function QuestProgress(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]];
}
/**
* QuestProgress Label.
* @member {string} Label
* @memberof tutorial.QuestProgress
* @instance
*/
QuestProgress.prototype.Label = "";
/**
* QuestProgress Num.
* @member {number} Num
* @memberof tutorial.QuestProgress
* @instance
*/
QuestProgress.prototype.Num = 0;
/**
* QuestProgress Target.
* @member {number} Target
* @memberof tutorial.QuestProgress
* @instance
*/
QuestProgress.prototype.Target = 0;
/**
* QuestProgress Status.
* @member {boolean} Status
* @memberof tutorial.QuestProgress
* @instance
*/
QuestProgress.prototype.Status = false;
/**
* QuestProgress Param.
* @member {number} Param
* @memberof tutorial.QuestProgress
* @instance
*/
QuestProgress.prototype.Param = 0;
/**
* Creates a new QuestProgress instance using the specified properties.
* @function create
* @memberof tutorial.QuestProgress
* @static
* @param {tutorial.IQuestProgress=} [properties] Properties to set
* @returns {tutorial.QuestProgress} QuestProgress instance
*/
QuestProgress.create = function create(properties) {
return new QuestProgress(properties);
};
/**
* Encodes the specified QuestProgress message. Does not implicitly {@link tutorial.QuestProgress.verify|verify} messages.
* @function encode
* @memberof tutorial.QuestProgress
* @static
* @param {tutorial.IQuestProgress} message QuestProgress message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
QuestProgress.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Label != null && Object.hasOwnProperty.call(message, "Label"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Label);
if (message.Num != null && Object.hasOwnProperty.call(message, "Num"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Num);
if (message.Target != null && Object.hasOwnProperty.call(message, "Target"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Target);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.Status);
if (message.Param != null && Object.hasOwnProperty.call(message, "Param"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Param);
return writer;
};
/**
* Encodes the specified QuestProgress message, length delimited. Does not implicitly {@link tutorial.QuestProgress.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.QuestProgress
* @static
* @param {tutorial.IQuestProgress} message QuestProgress message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
QuestProgress.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a QuestProgress message from the specified reader or buffer.
* @function decode
* @memberof tutorial.QuestProgress
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.QuestProgress} QuestProgress
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
QuestProgress.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.QuestProgress();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Label = reader.string();
break;
}
case 2: {
message.Num = reader.int32();
break;
}
case 3: {
message.Target = reader.int32();
break;
}
case 4: {
message.Status = reader.bool();
break;
}
case 5: {
message.Param = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a QuestProgress message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.QuestProgress
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.QuestProgress} QuestProgress
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
QuestProgress.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a QuestProgress message.
* @function verify
* @memberof tutorial.QuestProgress
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
QuestProgress.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Label != null && message.hasOwnProperty("Label"))
if (!$util.isString(message.Label))
return "Label: string expected";
if (message.Num != null && message.hasOwnProperty("Num"))
if (!$util.isInteger(message.Num))
return "Num: integer expected";
if (message.Target != null && message.hasOwnProperty("Target"))
if (!$util.isInteger(message.Target))
return "Target: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (typeof message.Status !== "boolean")
return "Status: boolean expected";
if (message.Param != null && message.hasOwnProperty("Param"))
if (!$util.isInteger(message.Param))
return "Param: integer expected";
return null;
};
/**
* Creates a QuestProgress message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.QuestProgress
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.QuestProgress} QuestProgress
*/
QuestProgress.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.QuestProgress)
return object;
var message = new $root.tutorial.QuestProgress();
if (object.Label != null)
message.Label = String(object.Label);
if (object.Num != null)
message.Num = object.Num | 0;
if (object.Target != null)
message.Target = object.Target | 0;
if (object.Status != null)
message.Status = Boolean(object.Status);
if (object.Param != null)
message.Param = object.Param | 0;
return message;
};
/**
* Creates a plain object from a QuestProgress message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.QuestProgress
* @static
* @param {tutorial.QuestProgress} message QuestProgress
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
QuestProgress.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Label = "";
object.Num = 0;
object.Target = 0;
object.Status = false;
object.Param = 0;
}
if (message.Label != null && message.hasOwnProperty("Label"))
object.Label = message.Label;
if (message.Num != null && message.hasOwnProperty("Num"))
object.Num = message.Num;
if (message.Target != null && message.hasOwnProperty("Target"))
object.Target = message.Target;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.Param != null && message.hasOwnProperty("Param"))
object.Param = message.Param;
return object;
};
/**
* Converts this QuestProgress to JSON.
* @function toJSON
* @memberof tutorial.QuestProgress
* @instance
* @returns {Object.<string,*>} JSON object
*/
QuestProgress.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for QuestProgress
* @function getTypeUrl
* @memberof tutorial.QuestProgress
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
QuestProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.QuestProgress";
};
return QuestProgress;
})();
tutorial.ReqGetDailyTaskReward = (function() {
/**
* Properties of a ReqGetDailyTaskReward.
* @memberof tutorial
* @interface IReqGetDailyTaskReward
* @property {number|null} [Id] ReqGetDailyTaskReward Id
*/
/**
* Constructs a new ReqGetDailyTaskReward.
* @memberof tutorial
* @classdesc Represents a ReqGetDailyTaskReward.
* @implements IReqGetDailyTaskReward
* @constructor
* @param {tutorial.IReqGetDailyTaskReward=} [properties] Properties to set
*/
function ReqGetDailyTaskReward(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]];
}
/**
* ReqGetDailyTaskReward Id.
* @member {number} Id
* @memberof tutorial.ReqGetDailyTaskReward
* @instance
*/
ReqGetDailyTaskReward.prototype.Id = 0;
/**
* Creates a new ReqGetDailyTaskReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {tutorial.IReqGetDailyTaskReward=} [properties] Properties to set
* @returns {tutorial.ReqGetDailyTaskReward} ReqGetDailyTaskReward instance
*/
ReqGetDailyTaskReward.create = function create(properties) {
return new ReqGetDailyTaskReward(properties);
};
/**
* Encodes the specified ReqGetDailyTaskReward message. Does not implicitly {@link tutorial.ReqGetDailyTaskReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {tutorial.IReqGetDailyTaskReward} message ReqGetDailyTaskReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetDailyTaskReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqGetDailyTaskReward message, length delimited. Does not implicitly {@link tutorial.ReqGetDailyTaskReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {tutorial.IReqGetDailyTaskReward} message ReqGetDailyTaskReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetDailyTaskReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetDailyTaskReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetDailyTaskReward} ReqGetDailyTaskReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetDailyTaskReward.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.ReqGetDailyTaskReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetDailyTaskReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetDailyTaskReward} ReqGetDailyTaskReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetDailyTaskReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetDailyTaskReward message.
* @function verify
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetDailyTaskReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqGetDailyTaskReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetDailyTaskReward} ReqGetDailyTaskReward
*/
ReqGetDailyTaskReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetDailyTaskReward)
return object;
var message = new $root.tutorial.ReqGetDailyTaskReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqGetDailyTaskReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {tutorial.ReqGetDailyTaskReward} message ReqGetDailyTaskReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetDailyTaskReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqGetDailyTaskReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGetDailyTaskReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetDailyTaskReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetDailyTaskReward
* @function getTypeUrl
* @memberof tutorial.ReqGetDailyTaskReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetDailyTaskReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetDailyTaskReward";
};
return ReqGetDailyTaskReward;
})();
tutorial.ResGetDailyTaskReward = (function() {
/**
* Properties of a ResGetDailyTaskReward.
* @memberof tutorial
* @interface IResGetDailyTaskReward
* @property {tutorial.RES_CODE|null} [Code] ResGetDailyTaskReward Code
* @property {string|null} [Msg] ResGetDailyTaskReward Msg
*/
/**
* Constructs a new ResGetDailyTaskReward.
* @memberof tutorial
* @classdesc Represents a ResGetDailyTaskReward.
* @implements IResGetDailyTaskReward
* @constructor
* @param {tutorial.IResGetDailyTaskReward=} [properties] Properties to set
*/
function ResGetDailyTaskReward(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]];
}
/**
* ResGetDailyTaskReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGetDailyTaskReward
* @instance
*/
ResGetDailyTaskReward.prototype.Code = 0;
/**
* ResGetDailyTaskReward Msg.
* @member {string} Msg
* @memberof tutorial.ResGetDailyTaskReward
* @instance
*/
ResGetDailyTaskReward.prototype.Msg = "";
/**
* Creates a new ResGetDailyTaskReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {tutorial.IResGetDailyTaskReward=} [properties] Properties to set
* @returns {tutorial.ResGetDailyTaskReward} ResGetDailyTaskReward instance
*/
ResGetDailyTaskReward.create = function create(properties) {
return new ResGetDailyTaskReward(properties);
};
/**
* Encodes the specified ResGetDailyTaskReward message. Does not implicitly {@link tutorial.ResGetDailyTaskReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {tutorial.IResGetDailyTaskReward} message ResGetDailyTaskReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetDailyTaskReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResGetDailyTaskReward message, length delimited. Does not implicitly {@link tutorial.ResGetDailyTaskReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {tutorial.IResGetDailyTaskReward} message ResGetDailyTaskReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetDailyTaskReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetDailyTaskReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetDailyTaskReward} ResGetDailyTaskReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetDailyTaskReward.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.ResGetDailyTaskReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetDailyTaskReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetDailyTaskReward} ResGetDailyTaskReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetDailyTaskReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetDailyTaskReward message.
* @function verify
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetDailyTaskReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResGetDailyTaskReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetDailyTaskReward} ResGetDailyTaskReward
*/
ResGetDailyTaskReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetDailyTaskReward)
return object;
var message = new $root.tutorial.ResGetDailyTaskReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResGetDailyTaskReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {tutorial.ResGetDailyTaskReward} message ResGetDailyTaskReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetDailyTaskReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResGetDailyTaskReward to JSON.
* @function toJSON
* @memberof tutorial.ResGetDailyTaskReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetDailyTaskReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetDailyTaskReward
* @function getTypeUrl
* @memberof tutorial.ResGetDailyTaskReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetDailyTaskReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetDailyTaskReward";
};
return ResGetDailyTaskReward;
})();
tutorial.ReqGetDailyWeekReward = (function() {
/**
* Properties of a ReqGetDailyWeekReward.
* @memberof tutorial
* @interface IReqGetDailyWeekReward
* @property {number|null} [Id] ReqGetDailyWeekReward Id
*/
/**
* Constructs a new ReqGetDailyWeekReward.
* @memberof tutorial
* @classdesc Represents a ReqGetDailyWeekReward.
* @implements IReqGetDailyWeekReward
* @constructor
* @param {tutorial.IReqGetDailyWeekReward=} [properties] Properties to set
*/
function ReqGetDailyWeekReward(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]];
}
/**
* ReqGetDailyWeekReward Id.
* @member {number} Id
* @memberof tutorial.ReqGetDailyWeekReward
* @instance
*/
ReqGetDailyWeekReward.prototype.Id = 0;
/**
* Creates a new ReqGetDailyWeekReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {tutorial.IReqGetDailyWeekReward=} [properties] Properties to set
* @returns {tutorial.ReqGetDailyWeekReward} ReqGetDailyWeekReward instance
*/
ReqGetDailyWeekReward.create = function create(properties) {
return new ReqGetDailyWeekReward(properties);
};
/**
* Encodes the specified ReqGetDailyWeekReward message. Does not implicitly {@link tutorial.ReqGetDailyWeekReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {tutorial.IReqGetDailyWeekReward} message ReqGetDailyWeekReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetDailyWeekReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqGetDailyWeekReward message, length delimited. Does not implicitly {@link tutorial.ReqGetDailyWeekReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {tutorial.IReqGetDailyWeekReward} message ReqGetDailyWeekReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetDailyWeekReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetDailyWeekReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetDailyWeekReward} ReqGetDailyWeekReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetDailyWeekReward.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.ReqGetDailyWeekReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetDailyWeekReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetDailyWeekReward} ReqGetDailyWeekReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetDailyWeekReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetDailyWeekReward message.
* @function verify
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetDailyWeekReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqGetDailyWeekReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetDailyWeekReward} ReqGetDailyWeekReward
*/
ReqGetDailyWeekReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetDailyWeekReward)
return object;
var message = new $root.tutorial.ReqGetDailyWeekReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqGetDailyWeekReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {tutorial.ReqGetDailyWeekReward} message ReqGetDailyWeekReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetDailyWeekReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqGetDailyWeekReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGetDailyWeekReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetDailyWeekReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetDailyWeekReward
* @function getTypeUrl
* @memberof tutorial.ReqGetDailyWeekReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetDailyWeekReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetDailyWeekReward";
};
return ReqGetDailyWeekReward;
})();
tutorial.ResGetDailyWeekReward = (function() {
/**
* Properties of a ResGetDailyWeekReward.
* @memberof tutorial
* @interface IResGetDailyWeekReward
* @property {tutorial.RES_CODE|null} [Code] ResGetDailyWeekReward Code
* @property {string|null} [Msg] ResGetDailyWeekReward Msg
*/
/**
* Constructs a new ResGetDailyWeekReward.
* @memberof tutorial
* @classdesc Represents a ResGetDailyWeekReward.
* @implements IResGetDailyWeekReward
* @constructor
* @param {tutorial.IResGetDailyWeekReward=} [properties] Properties to set
*/
function ResGetDailyWeekReward(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]];
}
/**
* ResGetDailyWeekReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGetDailyWeekReward
* @instance
*/
ResGetDailyWeekReward.prototype.Code = 0;
/**
* ResGetDailyWeekReward Msg.
* @member {string} Msg
* @memberof tutorial.ResGetDailyWeekReward
* @instance
*/
ResGetDailyWeekReward.prototype.Msg = "";
/**
* Creates a new ResGetDailyWeekReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {tutorial.IResGetDailyWeekReward=} [properties] Properties to set
* @returns {tutorial.ResGetDailyWeekReward} ResGetDailyWeekReward instance
*/
ResGetDailyWeekReward.create = function create(properties) {
return new ResGetDailyWeekReward(properties);
};
/**
* Encodes the specified ResGetDailyWeekReward message. Does not implicitly {@link tutorial.ResGetDailyWeekReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {tutorial.IResGetDailyWeekReward} message ResGetDailyWeekReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetDailyWeekReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResGetDailyWeekReward message, length delimited. Does not implicitly {@link tutorial.ResGetDailyWeekReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {tutorial.IResGetDailyWeekReward} message ResGetDailyWeekReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetDailyWeekReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetDailyWeekReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetDailyWeekReward} ResGetDailyWeekReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetDailyWeekReward.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.ResGetDailyWeekReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetDailyWeekReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetDailyWeekReward} ResGetDailyWeekReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetDailyWeekReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetDailyWeekReward message.
* @function verify
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetDailyWeekReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResGetDailyWeekReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetDailyWeekReward} ResGetDailyWeekReward
*/
ResGetDailyWeekReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetDailyWeekReward)
return object;
var message = new $root.tutorial.ResGetDailyWeekReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResGetDailyWeekReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {tutorial.ResGetDailyWeekReward} message ResGetDailyWeekReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetDailyWeekReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResGetDailyWeekReward to JSON.
* @function toJSON
* @memberof tutorial.ResGetDailyWeekReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetDailyWeekReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetDailyWeekReward
* @function getTypeUrl
* @memberof tutorial.ResGetDailyWeekReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetDailyWeekReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetDailyWeekReward";
};
return ResGetDailyWeekReward;
})();
tutorial.ReqDailyUnlock = (function() {
/**
* Properties of a ReqDailyUnlock.
* @memberof tutorial
* @interface IReqDailyUnlock
*/
/**
* Constructs a new ReqDailyUnlock.
* @memberof tutorial
* @classdesc Represents a ReqDailyUnlock.
* @implements IReqDailyUnlock
* @constructor
* @param {tutorial.IReqDailyUnlock=} [properties] Properties to set
*/
function ReqDailyUnlock(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]];
}
/**
* Creates a new ReqDailyUnlock instance using the specified properties.
* @function create
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {tutorial.IReqDailyUnlock=} [properties] Properties to set
* @returns {tutorial.ReqDailyUnlock} ReqDailyUnlock instance
*/
ReqDailyUnlock.create = function create(properties) {
return new ReqDailyUnlock(properties);
};
/**
* Encodes the specified ReqDailyUnlock message. Does not implicitly {@link tutorial.ReqDailyUnlock.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {tutorial.IReqDailyUnlock} message ReqDailyUnlock message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDailyUnlock.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqDailyUnlock message, length delimited. Does not implicitly {@link tutorial.ReqDailyUnlock.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {tutorial.IReqDailyUnlock} message ReqDailyUnlock message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDailyUnlock.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqDailyUnlock message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqDailyUnlock} ReqDailyUnlock
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDailyUnlock.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.ReqDailyUnlock();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqDailyUnlock message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqDailyUnlock} ReqDailyUnlock
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDailyUnlock.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqDailyUnlock message.
* @function verify
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqDailyUnlock.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqDailyUnlock message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqDailyUnlock} ReqDailyUnlock
*/
ReqDailyUnlock.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqDailyUnlock)
return object;
return new $root.tutorial.ReqDailyUnlock();
};
/**
* Creates a plain object from a ReqDailyUnlock message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {tutorial.ReqDailyUnlock} message ReqDailyUnlock
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqDailyUnlock.toObject = function toObject() {
return {};
};
/**
* Converts this ReqDailyUnlock to JSON.
* @function toJSON
* @memberof tutorial.ReqDailyUnlock
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqDailyUnlock.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqDailyUnlock
* @function getTypeUrl
* @memberof tutorial.ReqDailyUnlock
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqDailyUnlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqDailyUnlock";
};
return ReqDailyUnlock;
})();
tutorial.ResDailyUnlock = (function() {
/**
* Properties of a ResDailyUnlock.
* @memberof tutorial
* @interface IResDailyUnlock
* @property {tutorial.RES_CODE|null} [Code] ResDailyUnlock Code
* @property {string|null} [Msg] ResDailyUnlock Msg
*/
/**
* Constructs a new ResDailyUnlock.
* @memberof tutorial
* @classdesc Represents a ResDailyUnlock.
* @implements IResDailyUnlock
* @constructor
* @param {tutorial.IResDailyUnlock=} [properties] Properties to set
*/
function ResDailyUnlock(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]];
}
/**
* ResDailyUnlock Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResDailyUnlock
* @instance
*/
ResDailyUnlock.prototype.Code = 0;
/**
* ResDailyUnlock Msg.
* @member {string} Msg
* @memberof tutorial.ResDailyUnlock
* @instance
*/
ResDailyUnlock.prototype.Msg = "";
/**
* Creates a new ResDailyUnlock instance using the specified properties.
* @function create
* @memberof tutorial.ResDailyUnlock
* @static
* @param {tutorial.IResDailyUnlock=} [properties] Properties to set
* @returns {tutorial.ResDailyUnlock} ResDailyUnlock instance
*/
ResDailyUnlock.create = function create(properties) {
return new ResDailyUnlock(properties);
};
/**
* Encodes the specified ResDailyUnlock message. Does not implicitly {@link tutorial.ResDailyUnlock.verify|verify} messages.
* @function encode
* @memberof tutorial.ResDailyUnlock
* @static
* @param {tutorial.IResDailyUnlock} message ResDailyUnlock message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDailyUnlock.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResDailyUnlock message, length delimited. Does not implicitly {@link tutorial.ResDailyUnlock.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResDailyUnlock
* @static
* @param {tutorial.IResDailyUnlock} message ResDailyUnlock message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDailyUnlock.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResDailyUnlock message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResDailyUnlock
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResDailyUnlock} ResDailyUnlock
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDailyUnlock.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.ResDailyUnlock();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResDailyUnlock message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResDailyUnlock
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResDailyUnlock} ResDailyUnlock
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDailyUnlock.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResDailyUnlock message.
* @function verify
* @memberof tutorial.ResDailyUnlock
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResDailyUnlock.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResDailyUnlock message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResDailyUnlock
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResDailyUnlock} ResDailyUnlock
*/
ResDailyUnlock.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResDailyUnlock)
return object;
var message = new $root.tutorial.ResDailyUnlock();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResDailyUnlock message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResDailyUnlock
* @static
* @param {tutorial.ResDailyUnlock} message ResDailyUnlock
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResDailyUnlock.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResDailyUnlock to JSON.
* @function toJSON
* @memberof tutorial.ResDailyUnlock
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResDailyUnlock.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResDailyUnlock
* @function getTypeUrl
* @memberof tutorial.ResDailyUnlock
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResDailyUnlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResDailyUnlock";
};
return ResDailyUnlock;
})();
tutorial.ResFaceInfo = (function() {
/**
* Properties of a ResFaceInfo.
* @memberof tutorial
* @interface IResFaceInfo
* @property {Array.<tutorial.IFaceInfo>|null} [FaceList] ResFaceInfo FaceList
* @property {number|null} [SetId] ResFaceInfo SetId
*/
/**
* Constructs a new ResFaceInfo.
* @memberof tutorial
* @classdesc Represents a ResFaceInfo.
* @implements IResFaceInfo
* @constructor
* @param {tutorial.IResFaceInfo=} [properties] Properties to set
*/
function ResFaceInfo(properties) {
this.FaceList = [];
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]];
}
/**
* ResFaceInfo FaceList.
* @member {Array.<tutorial.IFaceInfo>} FaceList
* @memberof tutorial.ResFaceInfo
* @instance
*/
ResFaceInfo.prototype.FaceList = $util.emptyArray;
/**
* ResFaceInfo SetId.
* @member {number} SetId
* @memberof tutorial.ResFaceInfo
* @instance
*/
ResFaceInfo.prototype.SetId = 0;
/**
* Creates a new ResFaceInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResFaceInfo
* @static
* @param {tutorial.IResFaceInfo=} [properties] Properties to set
* @returns {tutorial.ResFaceInfo} ResFaceInfo instance
*/
ResFaceInfo.create = function create(properties) {
return new ResFaceInfo(properties);
};
/**
* Encodes the specified ResFaceInfo message. Does not implicitly {@link tutorial.ResFaceInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFaceInfo
* @static
* @param {tutorial.IResFaceInfo} message ResFaceInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFaceInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.FaceList != null && message.FaceList.length)
for (var i = 0; i < message.FaceList.length; ++i)
$root.tutorial.FaceInfo.encode(message.FaceList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.SetId != null && Object.hasOwnProperty.call(message, "SetId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.SetId);
return writer;
};
/**
* Encodes the specified ResFaceInfo message, length delimited. Does not implicitly {@link tutorial.ResFaceInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFaceInfo
* @static
* @param {tutorial.IResFaceInfo} message ResFaceInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFaceInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFaceInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFaceInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFaceInfo} ResFaceInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFaceInfo.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.ResFaceInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.FaceList && message.FaceList.length))
message.FaceList = [];
message.FaceList.push($root.tutorial.FaceInfo.decode(reader, reader.uint32()));
break;
}
case 2: {
message.SetId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFaceInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFaceInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFaceInfo} ResFaceInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFaceInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFaceInfo message.
* @function verify
* @memberof tutorial.ResFaceInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFaceInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.FaceList != null && message.hasOwnProperty("FaceList")) {
if (!Array.isArray(message.FaceList))
return "FaceList: array expected";
for (var i = 0; i < message.FaceList.length; ++i) {
var error = $root.tutorial.FaceInfo.verify(message.FaceList[i]);
if (error)
return "FaceList." + error;
}
}
if (message.SetId != null && message.hasOwnProperty("SetId"))
if (!$util.isInteger(message.SetId))
return "SetId: integer expected";
return null;
};
/**
* Creates a ResFaceInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFaceInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFaceInfo} ResFaceInfo
*/
ResFaceInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFaceInfo)
return object;
var message = new $root.tutorial.ResFaceInfo();
if (object.FaceList) {
if (!Array.isArray(object.FaceList))
throw TypeError(".tutorial.ResFaceInfo.FaceList: array expected");
message.FaceList = [];
for (var i = 0; i < object.FaceList.length; ++i) {
if (typeof object.FaceList[i] !== "object")
throw TypeError(".tutorial.ResFaceInfo.FaceList: object expected");
message.FaceList[i] = $root.tutorial.FaceInfo.fromObject(object.FaceList[i]);
}
}
if (object.SetId != null)
message.SetId = object.SetId | 0;
return message;
};
/**
* Creates a plain object from a ResFaceInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFaceInfo
* @static
* @param {tutorial.ResFaceInfo} message ResFaceInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFaceInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.FaceList = [];
if (options.defaults)
object.SetId = 0;
if (message.FaceList && message.FaceList.length) {
object.FaceList = [];
for (var j = 0; j < message.FaceList.length; ++j)
object.FaceList[j] = $root.tutorial.FaceInfo.toObject(message.FaceList[j], options);
}
if (message.SetId != null && message.hasOwnProperty("SetId"))
object.SetId = message.SetId;
return object;
};
/**
* Converts this ResFaceInfo to JSON.
* @function toJSON
* @memberof tutorial.ResFaceInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFaceInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFaceInfo
* @function getTypeUrl
* @memberof tutorial.ResFaceInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFaceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFaceInfo";
};
return ResFaceInfo;
})();
tutorial.FaceInfo = (function() {
/**
* Properties of a FaceInfo.
* @memberof tutorial
* @interface IFaceInfo
* @property {number|null} [Id] FaceInfo Id
* @property {number|Long|null} [EndTime] FaceInfo EndTime
*/
/**
* Constructs a new FaceInfo.
* @memberof tutorial
* @classdesc Represents a FaceInfo.
* @implements IFaceInfo
* @constructor
* @param {tutorial.IFaceInfo=} [properties] Properties to set
*/
function FaceInfo(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]];
}
/**
* FaceInfo Id.
* @member {number} Id
* @memberof tutorial.FaceInfo
* @instance
*/
FaceInfo.prototype.Id = 0;
/**
* FaceInfo EndTime.
* @member {number|Long} EndTime
* @memberof tutorial.FaceInfo
* @instance
*/
FaceInfo.prototype.EndTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* Creates a new FaceInfo instance using the specified properties.
* @function create
* @memberof tutorial.FaceInfo
* @static
* @param {tutorial.IFaceInfo=} [properties] Properties to set
* @returns {tutorial.FaceInfo} FaceInfo instance
*/
FaceInfo.create = function create(properties) {
return new FaceInfo(properties);
};
/**
* Encodes the specified FaceInfo message. Does not implicitly {@link tutorial.FaceInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.FaceInfo
* @static
* @param {tutorial.IFaceInfo} message FaceInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FaceInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.EndTime);
return writer;
};
/**
* Encodes the specified FaceInfo message, length delimited. Does not implicitly {@link tutorial.FaceInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.FaceInfo
* @static
* @param {tutorial.IFaceInfo} message FaceInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FaceInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a FaceInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.FaceInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.FaceInfo} FaceInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FaceInfo.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.FaceInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.EndTime = reader.int64();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a FaceInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.FaceInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.FaceInfo} FaceInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FaceInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a FaceInfo message.
* @function verify
* @memberof tutorial.FaceInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
FaceInfo.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))
return "Id: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime) && !(message.EndTime && $util.isInteger(message.EndTime.low) && $util.isInteger(message.EndTime.high)))
return "EndTime: integer|Long expected";
return null;
};
/**
* Creates a FaceInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.FaceInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.FaceInfo} FaceInfo
*/
FaceInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.FaceInfo)
return object;
var message = new $root.tutorial.FaceInfo();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.EndTime != null)
if ($util.Long)
(message.EndTime = $util.Long.fromValue(object.EndTime)).unsigned = false;
else if (typeof object.EndTime === "string")
message.EndTime = parseInt(object.EndTime, 10);
else if (typeof object.EndTime === "number")
message.EndTime = object.EndTime;
else if (typeof object.EndTime === "object")
message.EndTime = new $util.LongBits(object.EndTime.low >>> 0, object.EndTime.high >>> 0).toNumber();
return message;
};
/**
* Creates a plain object from a FaceInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.FaceInfo
* @static
* @param {tutorial.FaceInfo} message FaceInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
FaceInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.EndTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.EndTime = options.longs === String ? "0" : 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (typeof message.EndTime === "number")
object.EndTime = options.longs === String ? String(message.EndTime) : message.EndTime;
else
object.EndTime = options.longs === String ? $util.Long.prototype.toString.call(message.EndTime) : options.longs === Number ? new $util.LongBits(message.EndTime.low >>> 0, message.EndTime.high >>> 0).toNumber() : message.EndTime;
return object;
};
/**
* Converts this FaceInfo to JSON.
* @function toJSON
* @memberof tutorial.FaceInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
FaceInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for FaceInfo
* @function getTypeUrl
* @memberof tutorial.FaceInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
FaceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.FaceInfo";
};
return FaceInfo;
})();
tutorial.ReqSetFace = (function() {
/**
* Properties of a ReqSetFace.
* @memberof tutorial
* @interface IReqSetFace
* @property {number|null} [Face] ReqSetFace Face
*/
/**
* Constructs a new ReqSetFace.
* @memberof tutorial
* @classdesc Represents a ReqSetFace.
* @implements IReqSetFace
* @constructor
* @param {tutorial.IReqSetFace=} [properties] Properties to set
*/
function ReqSetFace(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]];
}
/**
* ReqSetFace Face.
* @member {number} Face
* @memberof tutorial.ReqSetFace
* @instance
*/
ReqSetFace.prototype.Face = 0;
/**
* Creates a new ReqSetFace instance using the specified properties.
* @function create
* @memberof tutorial.ReqSetFace
* @static
* @param {tutorial.IReqSetFace=} [properties] Properties to set
* @returns {tutorial.ReqSetFace} ReqSetFace instance
*/
ReqSetFace.create = function create(properties) {
return new ReqSetFace(properties);
};
/**
* Encodes the specified ReqSetFace message. Does not implicitly {@link tutorial.ReqSetFace.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSetFace
* @static
* @param {tutorial.IReqSetFace} message ReqSetFace message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetFace.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Face);
return writer;
};
/**
* Encodes the specified ReqSetFace message, length delimited. Does not implicitly {@link tutorial.ReqSetFace.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSetFace
* @static
* @param {tutorial.IReqSetFace} message ReqSetFace message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetFace.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSetFace message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSetFace
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSetFace} ReqSetFace
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetFace.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.ReqSetFace();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Face = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSetFace message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSetFace
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSetFace} ReqSetFace
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetFace.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSetFace message.
* @function verify
* @memberof tutorial.ReqSetFace
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSetFace.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
return null;
};
/**
* Creates a ReqSetFace message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSetFace
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSetFace} ReqSetFace
*/
ReqSetFace.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSetFace)
return object;
var message = new $root.tutorial.ReqSetFace();
if (object.Face != null)
message.Face = object.Face | 0;
return message;
};
/**
* Creates a plain object from a ReqSetFace message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSetFace
* @static
* @param {tutorial.ReqSetFace} message ReqSetFace
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSetFace.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Face = 0;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
return object;
};
/**
* Converts this ReqSetFace to JSON.
* @function toJSON
* @memberof tutorial.ReqSetFace
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSetFace.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSetFace
* @function getTypeUrl
* @memberof tutorial.ReqSetFace
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSetFace.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSetFace";
};
return ReqSetFace;
})();
tutorial.ResSetFace = (function() {
/**
* Properties of a ResSetFace.
* @memberof tutorial
* @interface IResSetFace
* @property {tutorial.RES_CODE|null} [Code] ResSetFace Code
* @property {string|null} [Msg] ResSetFace Msg
*/
/**
* Constructs a new ResSetFace.
* @memberof tutorial
* @classdesc Represents a ResSetFace.
* @implements IResSetFace
* @constructor
* @param {tutorial.IResSetFace=} [properties] Properties to set
*/
function ResSetFace(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]];
}
/**
* ResSetFace Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResSetFace
* @instance
*/
ResSetFace.prototype.Code = 0;
/**
* ResSetFace Msg.
* @member {string} Msg
* @memberof tutorial.ResSetFace
* @instance
*/
ResSetFace.prototype.Msg = "";
/**
* Creates a new ResSetFace instance using the specified properties.
* @function create
* @memberof tutorial.ResSetFace
* @static
* @param {tutorial.IResSetFace=} [properties] Properties to set
* @returns {tutorial.ResSetFace} ResSetFace instance
*/
ResSetFace.create = function create(properties) {
return new ResSetFace(properties);
};
/**
* Encodes the specified ResSetFace message. Does not implicitly {@link tutorial.ResSetFace.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSetFace
* @static
* @param {tutorial.IResSetFace} message ResSetFace message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetFace.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResSetFace message, length delimited. Does not implicitly {@link tutorial.ResSetFace.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSetFace
* @static
* @param {tutorial.IResSetFace} message ResSetFace message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetFace.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSetFace message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSetFace
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSetFace} ResSetFace
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetFace.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.ResSetFace();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSetFace message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSetFace
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSetFace} ResSetFace
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetFace.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSetFace message.
* @function verify
* @memberof tutorial.ResSetFace
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSetFace.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResSetFace message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSetFace
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSetFace} ResSetFace
*/
ResSetFace.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSetFace)
return object;
var message = new $root.tutorial.ResSetFace();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResSetFace message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSetFace
* @static
* @param {tutorial.ResSetFace} message ResSetFace
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSetFace.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResSetFace to JSON.
* @function toJSON
* @memberof tutorial.ResSetFace
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSetFace.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSetFace
* @function getTypeUrl
* @memberof tutorial.ResSetFace
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSetFace.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSetFace";
};
return ResSetFace;
})();
tutorial.ResAvatarInfo = (function() {
/**
* Properties of a ResAvatarInfo.
* @memberof tutorial
* @interface IResAvatarInfo
* @property {Array.<tutorial.IAvatarInfo>|null} [AvatarList] ResAvatarInfo AvatarList
* @property {number|null} [SetId] ResAvatarInfo SetId
*/
/**
* Constructs a new ResAvatarInfo.
* @memberof tutorial
* @classdesc Represents a ResAvatarInfo.
* @implements IResAvatarInfo
* @constructor
* @param {tutorial.IResAvatarInfo=} [properties] Properties to set
*/
function ResAvatarInfo(properties) {
this.AvatarList = [];
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]];
}
/**
* ResAvatarInfo AvatarList.
* @member {Array.<tutorial.IAvatarInfo>} AvatarList
* @memberof tutorial.ResAvatarInfo
* @instance
*/
ResAvatarInfo.prototype.AvatarList = $util.emptyArray;
/**
* ResAvatarInfo SetId.
* @member {number} SetId
* @memberof tutorial.ResAvatarInfo
* @instance
*/
ResAvatarInfo.prototype.SetId = 0;
/**
* Creates a new ResAvatarInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResAvatarInfo
* @static
* @param {tutorial.IResAvatarInfo=} [properties] Properties to set
* @returns {tutorial.ResAvatarInfo} ResAvatarInfo instance
*/
ResAvatarInfo.create = function create(properties) {
return new ResAvatarInfo(properties);
};
/**
* Encodes the specified ResAvatarInfo message. Does not implicitly {@link tutorial.ResAvatarInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResAvatarInfo
* @static
* @param {tutorial.IResAvatarInfo} message ResAvatarInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAvatarInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.AvatarList != null && message.AvatarList.length)
for (var i = 0; i < message.AvatarList.length; ++i)
$root.tutorial.AvatarInfo.encode(message.AvatarList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.SetId != null && Object.hasOwnProperty.call(message, "SetId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.SetId);
return writer;
};
/**
* Encodes the specified ResAvatarInfo message, length delimited. Does not implicitly {@link tutorial.ResAvatarInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResAvatarInfo
* @static
* @param {tutorial.IResAvatarInfo} message ResAvatarInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAvatarInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResAvatarInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResAvatarInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResAvatarInfo} ResAvatarInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAvatarInfo.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.ResAvatarInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.AvatarList && message.AvatarList.length))
message.AvatarList = [];
message.AvatarList.push($root.tutorial.AvatarInfo.decode(reader, reader.uint32()));
break;
}
case 2: {
message.SetId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResAvatarInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResAvatarInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResAvatarInfo} ResAvatarInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAvatarInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResAvatarInfo message.
* @function verify
* @memberof tutorial.ResAvatarInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResAvatarInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.AvatarList != null && message.hasOwnProperty("AvatarList")) {
if (!Array.isArray(message.AvatarList))
return "AvatarList: array expected";
for (var i = 0; i < message.AvatarList.length; ++i) {
var error = $root.tutorial.AvatarInfo.verify(message.AvatarList[i]);
if (error)
return "AvatarList." + error;
}
}
if (message.SetId != null && message.hasOwnProperty("SetId"))
if (!$util.isInteger(message.SetId))
return "SetId: integer expected";
return null;
};
/**
* Creates a ResAvatarInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResAvatarInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResAvatarInfo} ResAvatarInfo
*/
ResAvatarInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResAvatarInfo)
return object;
var message = new $root.tutorial.ResAvatarInfo();
if (object.AvatarList) {
if (!Array.isArray(object.AvatarList))
throw TypeError(".tutorial.ResAvatarInfo.AvatarList: array expected");
message.AvatarList = [];
for (var i = 0; i < object.AvatarList.length; ++i) {
if (typeof object.AvatarList[i] !== "object")
throw TypeError(".tutorial.ResAvatarInfo.AvatarList: object expected");
message.AvatarList[i] = $root.tutorial.AvatarInfo.fromObject(object.AvatarList[i]);
}
}
if (object.SetId != null)
message.SetId = object.SetId | 0;
return message;
};
/**
* Creates a plain object from a ResAvatarInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResAvatarInfo
* @static
* @param {tutorial.ResAvatarInfo} message ResAvatarInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResAvatarInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.AvatarList = [];
if (options.defaults)
object.SetId = 0;
if (message.AvatarList && message.AvatarList.length) {
object.AvatarList = [];
for (var j = 0; j < message.AvatarList.length; ++j)
object.AvatarList[j] = $root.tutorial.AvatarInfo.toObject(message.AvatarList[j], options);
}
if (message.SetId != null && message.hasOwnProperty("SetId"))
object.SetId = message.SetId;
return object;
};
/**
* Converts this ResAvatarInfo to JSON.
* @function toJSON
* @memberof tutorial.ResAvatarInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResAvatarInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResAvatarInfo
* @function getTypeUrl
* @memberof tutorial.ResAvatarInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResAvatarInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResAvatarInfo";
};
return ResAvatarInfo;
})();
tutorial.AvatarInfo = (function() {
/**
* Properties of an AvatarInfo.
* @memberof tutorial
* @interface IAvatarInfo
* @property {number|null} [Id] AvatarInfo Id
* @property {number|Long|null} [EndTime] AvatarInfo EndTime
*/
/**
* Constructs a new AvatarInfo.
* @memberof tutorial
* @classdesc Represents an AvatarInfo.
* @implements IAvatarInfo
* @constructor
* @param {tutorial.IAvatarInfo=} [properties] Properties to set
*/
function AvatarInfo(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]];
}
/**
* AvatarInfo Id.
* @member {number} Id
* @memberof tutorial.AvatarInfo
* @instance
*/
AvatarInfo.prototype.Id = 0;
/**
* AvatarInfo EndTime.
* @member {number|Long} EndTime
* @memberof tutorial.AvatarInfo
* @instance
*/
AvatarInfo.prototype.EndTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* Creates a new AvatarInfo instance using the specified properties.
* @function create
* @memberof tutorial.AvatarInfo
* @static
* @param {tutorial.IAvatarInfo=} [properties] Properties to set
* @returns {tutorial.AvatarInfo} AvatarInfo instance
*/
AvatarInfo.create = function create(properties) {
return new AvatarInfo(properties);
};
/**
* Encodes the specified AvatarInfo message. Does not implicitly {@link tutorial.AvatarInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.AvatarInfo
* @static
* @param {tutorial.IAvatarInfo} message AvatarInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
AvatarInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.EndTime);
return writer;
};
/**
* Encodes the specified AvatarInfo message, length delimited. Does not implicitly {@link tutorial.AvatarInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.AvatarInfo
* @static
* @param {tutorial.IAvatarInfo} message AvatarInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
AvatarInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an AvatarInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.AvatarInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.AvatarInfo} AvatarInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
AvatarInfo.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.AvatarInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.EndTime = reader.int64();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an AvatarInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.AvatarInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.AvatarInfo} AvatarInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
AvatarInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an AvatarInfo message.
* @function verify
* @memberof tutorial.AvatarInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
AvatarInfo.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))
return "Id: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime) && !(message.EndTime && $util.isInteger(message.EndTime.low) && $util.isInteger(message.EndTime.high)))
return "EndTime: integer|Long expected";
return null;
};
/**
* Creates an AvatarInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.AvatarInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.AvatarInfo} AvatarInfo
*/
AvatarInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.AvatarInfo)
return object;
var message = new $root.tutorial.AvatarInfo();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.EndTime != null)
if ($util.Long)
(message.EndTime = $util.Long.fromValue(object.EndTime)).unsigned = false;
else if (typeof object.EndTime === "string")
message.EndTime = parseInt(object.EndTime, 10);
else if (typeof object.EndTime === "number")
message.EndTime = object.EndTime;
else if (typeof object.EndTime === "object")
message.EndTime = new $util.LongBits(object.EndTime.low >>> 0, object.EndTime.high >>> 0).toNumber();
return message;
};
/**
* Creates a plain object from an AvatarInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.AvatarInfo
* @static
* @param {tutorial.AvatarInfo} message AvatarInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
AvatarInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.EndTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.EndTime = options.longs === String ? "0" : 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (typeof message.EndTime === "number")
object.EndTime = options.longs === String ? String(message.EndTime) : message.EndTime;
else
object.EndTime = options.longs === String ? $util.Long.prototype.toString.call(message.EndTime) : options.longs === Number ? new $util.LongBits(message.EndTime.low >>> 0, message.EndTime.high >>> 0).toNumber() : message.EndTime;
return object;
};
/**
* Converts this AvatarInfo to JSON.
* @function toJSON
* @memberof tutorial.AvatarInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
AvatarInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for AvatarInfo
* @function getTypeUrl
* @memberof tutorial.AvatarInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
AvatarInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.AvatarInfo";
};
return AvatarInfo;
})();
tutorial.ReqSetAvatar = (function() {
/**
* Properties of a ReqSetAvatar.
* @memberof tutorial
* @interface IReqSetAvatar
* @property {number|null} [Avatar] ReqSetAvatar Avatar
*/
/**
* Constructs a new ReqSetAvatar.
* @memberof tutorial
* @classdesc Represents a ReqSetAvatar.
* @implements IReqSetAvatar
* @constructor
* @param {tutorial.IReqSetAvatar=} [properties] Properties to set
*/
function ReqSetAvatar(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]];
}
/**
* ReqSetAvatar Avatar.
* @member {number} Avatar
* @memberof tutorial.ReqSetAvatar
* @instance
*/
ReqSetAvatar.prototype.Avatar = 0;
/**
* Creates a new ReqSetAvatar instance using the specified properties.
* @function create
* @memberof tutorial.ReqSetAvatar
* @static
* @param {tutorial.IReqSetAvatar=} [properties] Properties to set
* @returns {tutorial.ReqSetAvatar} ReqSetAvatar instance
*/
ReqSetAvatar.create = function create(properties) {
return new ReqSetAvatar(properties);
};
/**
* Encodes the specified ReqSetAvatar message. Does not implicitly {@link tutorial.ReqSetAvatar.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSetAvatar
* @static
* @param {tutorial.IReqSetAvatar} message ReqSetAvatar message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetAvatar.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Avatar);
return writer;
};
/**
* Encodes the specified ReqSetAvatar message, length delimited. Does not implicitly {@link tutorial.ReqSetAvatar.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSetAvatar
* @static
* @param {tutorial.IReqSetAvatar} message ReqSetAvatar message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetAvatar.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSetAvatar message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSetAvatar
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSetAvatar} ReqSetAvatar
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetAvatar.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.ReqSetAvatar();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Avatar = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSetAvatar message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSetAvatar
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSetAvatar} ReqSetAvatar
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetAvatar.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSetAvatar message.
* @function verify
* @memberof tutorial.ReqSetAvatar
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSetAvatar.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
return null;
};
/**
* Creates a ReqSetAvatar message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSetAvatar
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSetAvatar} ReqSetAvatar
*/
ReqSetAvatar.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSetAvatar)
return object;
var message = new $root.tutorial.ReqSetAvatar();
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
return message;
};
/**
* Creates a plain object from a ReqSetAvatar message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSetAvatar
* @static
* @param {tutorial.ReqSetAvatar} message ReqSetAvatar
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSetAvatar.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Avatar = 0;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
return object;
};
/**
* Converts this ReqSetAvatar to JSON.
* @function toJSON
* @memberof tutorial.ReqSetAvatar
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSetAvatar.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSetAvatar
* @function getTypeUrl
* @memberof tutorial.ReqSetAvatar
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSetAvatar.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSetAvatar";
};
return ReqSetAvatar;
})();
tutorial.ResSetAvatar = (function() {
/**
* Properties of a ResSetAvatar.
* @memberof tutorial
* @interface IResSetAvatar
* @property {tutorial.RES_CODE|null} [Code] ResSetAvatar Code
* @property {string|null} [Msg] ResSetAvatar Msg
*/
/**
* Constructs a new ResSetAvatar.
* @memberof tutorial
* @classdesc Represents a ResSetAvatar.
* @implements IResSetAvatar
* @constructor
* @param {tutorial.IResSetAvatar=} [properties] Properties to set
*/
function ResSetAvatar(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]];
}
/**
* ResSetAvatar Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResSetAvatar
* @instance
*/
ResSetAvatar.prototype.Code = 0;
/**
* ResSetAvatar Msg.
* @member {string} Msg
* @memberof tutorial.ResSetAvatar
* @instance
*/
ResSetAvatar.prototype.Msg = "";
/**
* Creates a new ResSetAvatar instance using the specified properties.
* @function create
* @memberof tutorial.ResSetAvatar
* @static
* @param {tutorial.IResSetAvatar=} [properties] Properties to set
* @returns {tutorial.ResSetAvatar} ResSetAvatar instance
*/
ResSetAvatar.create = function create(properties) {
return new ResSetAvatar(properties);
};
/**
* Encodes the specified ResSetAvatar message. Does not implicitly {@link tutorial.ResSetAvatar.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSetAvatar
* @static
* @param {tutorial.IResSetAvatar} message ResSetAvatar message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetAvatar.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResSetAvatar message, length delimited. Does not implicitly {@link tutorial.ResSetAvatar.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSetAvatar
* @static
* @param {tutorial.IResSetAvatar} message ResSetAvatar message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetAvatar.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSetAvatar message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSetAvatar
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSetAvatar} ResSetAvatar
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetAvatar.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.ResSetAvatar();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSetAvatar message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSetAvatar
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSetAvatar} ResSetAvatar
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetAvatar.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSetAvatar message.
* @function verify
* @memberof tutorial.ResSetAvatar
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSetAvatar.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResSetAvatar message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSetAvatar
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSetAvatar} ResSetAvatar
*/
ResSetAvatar.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSetAvatar)
return object;
var message = new $root.tutorial.ResSetAvatar();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResSetAvatar message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSetAvatar
* @static
* @param {tutorial.ResSetAvatar} message ResSetAvatar
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSetAvatar.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResSetAvatar to JSON.
* @function toJSON
* @memberof tutorial.ResSetAvatar
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSetAvatar.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSetAvatar
* @function getTypeUrl
* @memberof tutorial.ResSetAvatar
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSetAvatar.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSetAvatar";
};
return ResSetAvatar;
})();
tutorial.ResSevenLogin = (function() {
/**
* Properties of a ResSevenLogin.
* @memberof tutorial
* @interface IResSevenLogin
* @property {Array.<tutorial.ISevenLoginReward>|null} [WeekReward] ResSevenLogin WeekReward
* @property {Array.<tutorial.ISevenLoginReward>|null} [MonthReward] ResSevenLogin MonthReward
* @property {number|null} [Active] ResSevenLogin Active
* @property {boolean|null} [IsBack] ResSevenLogin IsBack
*/
/**
* Constructs a new ResSevenLogin.
* @memberof tutorial
* @classdesc Represents a ResSevenLogin.
* @implements IResSevenLogin
* @constructor
* @param {tutorial.IResSevenLogin=} [properties] Properties to set
*/
function ResSevenLogin(properties) {
this.WeekReward = [];
this.MonthReward = [];
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]];
}
/**
* ResSevenLogin WeekReward.
* @member {Array.<tutorial.ISevenLoginReward>} WeekReward
* @memberof tutorial.ResSevenLogin
* @instance
*/
ResSevenLogin.prototype.WeekReward = $util.emptyArray;
/**
* ResSevenLogin MonthReward.
* @member {Array.<tutorial.ISevenLoginReward>} MonthReward
* @memberof tutorial.ResSevenLogin
* @instance
*/
ResSevenLogin.prototype.MonthReward = $util.emptyArray;
/**
* ResSevenLogin Active.
* @member {number} Active
* @memberof tutorial.ResSevenLogin
* @instance
*/
ResSevenLogin.prototype.Active = 0;
/**
* ResSevenLogin IsBack.
* @member {boolean} IsBack
* @memberof tutorial.ResSevenLogin
* @instance
*/
ResSevenLogin.prototype.IsBack = false;
/**
* Creates a new ResSevenLogin instance using the specified properties.
* @function create
* @memberof tutorial.ResSevenLogin
* @static
* @param {tutorial.IResSevenLogin=} [properties] Properties to set
* @returns {tutorial.ResSevenLogin} ResSevenLogin instance
*/
ResSevenLogin.create = function create(properties) {
return new ResSevenLogin(properties);
};
/**
* Encodes the specified ResSevenLogin message. Does not implicitly {@link tutorial.ResSevenLogin.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSevenLogin
* @static
* @param {tutorial.IResSevenLogin} message ResSevenLogin message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSevenLogin.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.WeekReward != null && message.WeekReward.length)
for (var i = 0; i < message.WeekReward.length; ++i)
$root.tutorial.SevenLoginReward.encode(message.WeekReward[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.MonthReward != null && message.MonthReward.length)
for (var i = 0; i < message.MonthReward.length; ++i)
$root.tutorial.SevenLoginReward.encode(message.MonthReward[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.Active != null && Object.hasOwnProperty.call(message, "Active"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Active);
if (message.IsBack != null && Object.hasOwnProperty.call(message, "IsBack"))
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.IsBack);
return writer;
};
/**
* Encodes the specified ResSevenLogin message, length delimited. Does not implicitly {@link tutorial.ResSevenLogin.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSevenLogin
* @static
* @param {tutorial.IResSevenLogin} message ResSevenLogin message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSevenLogin.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSevenLogin message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSevenLogin
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSevenLogin} ResSevenLogin
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSevenLogin.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.ResSevenLogin();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.WeekReward && message.WeekReward.length))
message.WeekReward = [];
message.WeekReward.push($root.tutorial.SevenLoginReward.decode(reader, reader.uint32()));
break;
}
case 2: {
if (!(message.MonthReward && message.MonthReward.length))
message.MonthReward = [];
message.MonthReward.push($root.tutorial.SevenLoginReward.decode(reader, reader.uint32()));
break;
}
case 3: {
message.Active = reader.int32();
break;
}
case 4: {
message.IsBack = reader.bool();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSevenLogin message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSevenLogin
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSevenLogin} ResSevenLogin
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSevenLogin.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSevenLogin message.
* @function verify
* @memberof tutorial.ResSevenLogin
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSevenLogin.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.WeekReward != null && message.hasOwnProperty("WeekReward")) {
if (!Array.isArray(message.WeekReward))
return "WeekReward: array expected";
for (var i = 0; i < message.WeekReward.length; ++i) {
var error = $root.tutorial.SevenLoginReward.verify(message.WeekReward[i]);
if (error)
return "WeekReward." + error;
}
}
if (message.MonthReward != null && message.hasOwnProperty("MonthReward")) {
if (!Array.isArray(message.MonthReward))
return "MonthReward: array expected";
for (var i = 0; i < message.MonthReward.length; ++i) {
var error = $root.tutorial.SevenLoginReward.verify(message.MonthReward[i]);
if (error)
return "MonthReward." + error;
}
}
if (message.Active != null && message.hasOwnProperty("Active"))
if (!$util.isInteger(message.Active))
return "Active: integer expected";
if (message.IsBack != null && message.hasOwnProperty("IsBack"))
if (typeof message.IsBack !== "boolean")
return "IsBack: boolean expected";
return null;
};
/**
* Creates a ResSevenLogin message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSevenLogin
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSevenLogin} ResSevenLogin
*/
ResSevenLogin.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSevenLogin)
return object;
var message = new $root.tutorial.ResSevenLogin();
if (object.WeekReward) {
if (!Array.isArray(object.WeekReward))
throw TypeError(".tutorial.ResSevenLogin.WeekReward: array expected");
message.WeekReward = [];
for (var i = 0; i < object.WeekReward.length; ++i) {
if (typeof object.WeekReward[i] !== "object")
throw TypeError(".tutorial.ResSevenLogin.WeekReward: object expected");
message.WeekReward[i] = $root.tutorial.SevenLoginReward.fromObject(object.WeekReward[i]);
}
}
if (object.MonthReward) {
if (!Array.isArray(object.MonthReward))
throw TypeError(".tutorial.ResSevenLogin.MonthReward: array expected");
message.MonthReward = [];
for (var i = 0; i < object.MonthReward.length; ++i) {
if (typeof object.MonthReward[i] !== "object")
throw TypeError(".tutorial.ResSevenLogin.MonthReward: object expected");
message.MonthReward[i] = $root.tutorial.SevenLoginReward.fromObject(object.MonthReward[i]);
}
}
if (object.Active != null)
message.Active = object.Active | 0;
if (object.IsBack != null)
message.IsBack = Boolean(object.IsBack);
return message;
};
/**
* Creates a plain object from a ResSevenLogin message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSevenLogin
* @static
* @param {tutorial.ResSevenLogin} message ResSevenLogin
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSevenLogin.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.WeekReward = [];
object.MonthReward = [];
}
if (options.defaults) {
object.Active = 0;
object.IsBack = false;
}
if (message.WeekReward && message.WeekReward.length) {
object.WeekReward = [];
for (var j = 0; j < message.WeekReward.length; ++j)
object.WeekReward[j] = $root.tutorial.SevenLoginReward.toObject(message.WeekReward[j], options);
}
if (message.MonthReward && message.MonthReward.length) {
object.MonthReward = [];
for (var j = 0; j < message.MonthReward.length; ++j)
object.MonthReward[j] = $root.tutorial.SevenLoginReward.toObject(message.MonthReward[j], options);
}
if (message.Active != null && message.hasOwnProperty("Active"))
object.Active = message.Active;
if (message.IsBack != null && message.hasOwnProperty("IsBack"))
object.IsBack = message.IsBack;
return object;
};
/**
* Converts this ResSevenLogin to JSON.
* @function toJSON
* @memberof tutorial.ResSevenLogin
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSevenLogin.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSevenLogin
* @function getTypeUrl
* @memberof tutorial.ResSevenLogin
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSevenLogin.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSevenLogin";
};
return ResSevenLogin;
})();
tutorial.SevenLoginReward = (function() {
/**
* Properties of a SevenLoginReward.
* @memberof tutorial
* @interface ISevenLoginReward
* @property {Array.<tutorial.IItemInfo>|null} [Item1] SevenLoginReward Item1
* @property {Array.<tutorial.IItemInfo>|null} [Item2] SevenLoginReward Item2
* @property {Array.<tutorial.IItemInfo>|null} [Item3] SevenLoginReward Item3
* @property {number|null} [Status] SevenLoginReward Status
* @property {number|null} [Id] SevenLoginReward Id
*/
/**
* Constructs a new SevenLoginReward.
* @memberof tutorial
* @classdesc Represents a SevenLoginReward.
* @implements ISevenLoginReward
* @constructor
* @param {tutorial.ISevenLoginReward=} [properties] Properties to set
*/
function SevenLoginReward(properties) {
this.Item1 = [];
this.Item2 = [];
this.Item3 = [];
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]];
}
/**
* SevenLoginReward Item1.
* @member {Array.<tutorial.IItemInfo>} Item1
* @memberof tutorial.SevenLoginReward
* @instance
*/
SevenLoginReward.prototype.Item1 = $util.emptyArray;
/**
* SevenLoginReward Item2.
* @member {Array.<tutorial.IItemInfo>} Item2
* @memberof tutorial.SevenLoginReward
* @instance
*/
SevenLoginReward.prototype.Item2 = $util.emptyArray;
/**
* SevenLoginReward Item3.
* @member {Array.<tutorial.IItemInfo>} Item3
* @memberof tutorial.SevenLoginReward
* @instance
*/
SevenLoginReward.prototype.Item3 = $util.emptyArray;
/**
* SevenLoginReward Status.
* @member {number} Status
* @memberof tutorial.SevenLoginReward
* @instance
*/
SevenLoginReward.prototype.Status = 0;
/**
* SevenLoginReward Id.
* @member {number} Id
* @memberof tutorial.SevenLoginReward
* @instance
*/
SevenLoginReward.prototype.Id = 0;
/**
* Creates a new SevenLoginReward instance using the specified properties.
* @function create
* @memberof tutorial.SevenLoginReward
* @static
* @param {tutorial.ISevenLoginReward=} [properties] Properties to set
* @returns {tutorial.SevenLoginReward} SevenLoginReward instance
*/
SevenLoginReward.create = function create(properties) {
return new SevenLoginReward(properties);
};
/**
* Encodes the specified SevenLoginReward message. Does not implicitly {@link tutorial.SevenLoginReward.verify|verify} messages.
* @function encode
* @memberof tutorial.SevenLoginReward
* @static
* @param {tutorial.ISevenLoginReward} message SevenLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SevenLoginReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Item1 != null && message.Item1.length)
for (var i = 0; i < message.Item1.length; ++i)
$root.tutorial.ItemInfo.encode(message.Item1[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.Item2 != null && message.Item2.length)
for (var i = 0; i < message.Item2.length; ++i)
$root.tutorial.ItemInfo.encode(message.Item2[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.Item3 != null && message.Item3.length)
for (var i = 0; i < message.Item3.length; ++i)
$root.tutorial.ItemInfo.encode(message.Item3[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Status);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Id);
return writer;
};
/**
* Encodes the specified SevenLoginReward message, length delimited. Does not implicitly {@link tutorial.SevenLoginReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.SevenLoginReward
* @static
* @param {tutorial.ISevenLoginReward} message SevenLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SevenLoginReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SevenLoginReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.SevenLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.SevenLoginReward} SevenLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SevenLoginReward.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.SevenLoginReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.Item1 && message.Item1.length))
message.Item1 = [];
message.Item1.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
case 2: {
if (!(message.Item2 && message.Item2.length))
message.Item2 = [];
message.Item2.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
case 3: {
if (!(message.Item3 && message.Item3.length))
message.Item3 = [];
message.Item3.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
case 4: {
message.Status = reader.int32();
break;
}
case 5: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SevenLoginReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.SevenLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.SevenLoginReward} SevenLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SevenLoginReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SevenLoginReward message.
* @function verify
* @memberof tutorial.SevenLoginReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SevenLoginReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Item1 != null && message.hasOwnProperty("Item1")) {
if (!Array.isArray(message.Item1))
return "Item1: array expected";
for (var i = 0; i < message.Item1.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Item1[i]);
if (error)
return "Item1." + error;
}
}
if (message.Item2 != null && message.hasOwnProperty("Item2")) {
if (!Array.isArray(message.Item2))
return "Item2: array expected";
for (var i = 0; i < message.Item2.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Item2[i]);
if (error)
return "Item2." + error;
}
}
if (message.Item3 != null && message.hasOwnProperty("Item3")) {
if (!Array.isArray(message.Item3))
return "Item3: array expected";
for (var i = 0; i < message.Item3.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Item3[i]);
if (error)
return "Item3." + error;
}
}
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isInteger(message.Id))
return "Id: integer expected";
return null;
};
/**
* Creates a SevenLoginReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.SevenLoginReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.SevenLoginReward} SevenLoginReward
*/
SevenLoginReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.SevenLoginReward)
return object;
var message = new $root.tutorial.SevenLoginReward();
if (object.Item1) {
if (!Array.isArray(object.Item1))
throw TypeError(".tutorial.SevenLoginReward.Item1: array expected");
message.Item1 = [];
for (var i = 0; i < object.Item1.length; ++i) {
if (typeof object.Item1[i] !== "object")
throw TypeError(".tutorial.SevenLoginReward.Item1: object expected");
message.Item1[i] = $root.tutorial.ItemInfo.fromObject(object.Item1[i]);
}
}
if (object.Item2) {
if (!Array.isArray(object.Item2))
throw TypeError(".tutorial.SevenLoginReward.Item2: array expected");
message.Item2 = [];
for (var i = 0; i < object.Item2.length; ++i) {
if (typeof object.Item2[i] !== "object")
throw TypeError(".tutorial.SevenLoginReward.Item2: object expected");
message.Item2[i] = $root.tutorial.ItemInfo.fromObject(object.Item2[i]);
}
}
if (object.Item3) {
if (!Array.isArray(object.Item3))
throw TypeError(".tutorial.SevenLoginReward.Item3: array expected");
message.Item3 = [];
for (var i = 0; i < object.Item3.length; ++i) {
if (typeof object.Item3[i] !== "object")
throw TypeError(".tutorial.SevenLoginReward.Item3: object expected");
message.Item3[i] = $root.tutorial.ItemInfo.fromObject(object.Item3[i]);
}
}
if (object.Status != null)
message.Status = object.Status | 0;
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a SevenLoginReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.SevenLoginReward
* @static
* @param {tutorial.SevenLoginReward} message SevenLoginReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SevenLoginReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.Item1 = [];
object.Item2 = [];
object.Item3 = [];
}
if (options.defaults) {
object.Status = 0;
object.Id = 0;
}
if (message.Item1 && message.Item1.length) {
object.Item1 = [];
for (var j = 0; j < message.Item1.length; ++j)
object.Item1[j] = $root.tutorial.ItemInfo.toObject(message.Item1[j], options);
}
if (message.Item2 && message.Item2.length) {
object.Item2 = [];
for (var j = 0; j < message.Item2.length; ++j)
object.Item2[j] = $root.tutorial.ItemInfo.toObject(message.Item2[j], options);
}
if (message.Item3 && message.Item3.length) {
object.Item3 = [];
for (var j = 0; j < message.Item3.length; ++j)
object.Item3[j] = $root.tutorial.ItemInfo.toObject(message.Item3[j], options);
}
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this SevenLoginReward to JSON.
* @function toJSON
* @memberof tutorial.SevenLoginReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
SevenLoginReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SevenLoginReward
* @function getTypeUrl
* @memberof tutorial.SevenLoginReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SevenLoginReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.SevenLoginReward";
};
return SevenLoginReward;
})();
tutorial.ReqGetSevenLoginReward = (function() {
/**
* Properties of a ReqGetSevenLoginReward.
* @memberof tutorial
* @interface IReqGetSevenLoginReward
* @property {number|null} [Id] ReqGetSevenLoginReward Id
*/
/**
* Constructs a new ReqGetSevenLoginReward.
* @memberof tutorial
* @classdesc Represents a ReqGetSevenLoginReward.
* @implements IReqGetSevenLoginReward
* @constructor
* @param {tutorial.IReqGetSevenLoginReward=} [properties] Properties to set
*/
function ReqGetSevenLoginReward(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]];
}
/**
* ReqGetSevenLoginReward Id.
* @member {number} Id
* @memberof tutorial.ReqGetSevenLoginReward
* @instance
*/
ReqGetSevenLoginReward.prototype.Id = 0;
/**
* Creates a new ReqGetSevenLoginReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {tutorial.IReqGetSevenLoginReward=} [properties] Properties to set
* @returns {tutorial.ReqGetSevenLoginReward} ReqGetSevenLoginReward instance
*/
ReqGetSevenLoginReward.create = function create(properties) {
return new ReqGetSevenLoginReward(properties);
};
/**
* Encodes the specified ReqGetSevenLoginReward message. Does not implicitly {@link tutorial.ReqGetSevenLoginReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {tutorial.IReqGetSevenLoginReward} message ReqGetSevenLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetSevenLoginReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqGetSevenLoginReward message, length delimited. Does not implicitly {@link tutorial.ReqGetSevenLoginReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {tutorial.IReqGetSevenLoginReward} message ReqGetSevenLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetSevenLoginReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetSevenLoginReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetSevenLoginReward} ReqGetSevenLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetSevenLoginReward.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.ReqGetSevenLoginReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetSevenLoginReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetSevenLoginReward} ReqGetSevenLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetSevenLoginReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetSevenLoginReward message.
* @function verify
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetSevenLoginReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqGetSevenLoginReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetSevenLoginReward} ReqGetSevenLoginReward
*/
ReqGetSevenLoginReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetSevenLoginReward)
return object;
var message = new $root.tutorial.ReqGetSevenLoginReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqGetSevenLoginReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {tutorial.ReqGetSevenLoginReward} message ReqGetSevenLoginReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetSevenLoginReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqGetSevenLoginReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGetSevenLoginReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetSevenLoginReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetSevenLoginReward
* @function getTypeUrl
* @memberof tutorial.ReqGetSevenLoginReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetSevenLoginReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetSevenLoginReward";
};
return ReqGetSevenLoginReward;
})();
tutorial.ResGetSevenLoginReward = (function() {
/**
* Properties of a ResGetSevenLoginReward.
* @memberof tutorial
* @interface IResGetSevenLoginReward
* @property {tutorial.RES_CODE|null} [Code] ResGetSevenLoginReward Code
* @property {string|null} [Msg] ResGetSevenLoginReward Msg
*/
/**
* Constructs a new ResGetSevenLoginReward.
* @memberof tutorial
* @classdesc Represents a ResGetSevenLoginReward.
* @implements IResGetSevenLoginReward
* @constructor
* @param {tutorial.IResGetSevenLoginReward=} [properties] Properties to set
*/
function ResGetSevenLoginReward(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]];
}
/**
* ResGetSevenLoginReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGetSevenLoginReward
* @instance
*/
ResGetSevenLoginReward.prototype.Code = 0;
/**
* ResGetSevenLoginReward Msg.
* @member {string} Msg
* @memberof tutorial.ResGetSevenLoginReward
* @instance
*/
ResGetSevenLoginReward.prototype.Msg = "";
/**
* Creates a new ResGetSevenLoginReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {tutorial.IResGetSevenLoginReward=} [properties] Properties to set
* @returns {tutorial.ResGetSevenLoginReward} ResGetSevenLoginReward instance
*/
ResGetSevenLoginReward.create = function create(properties) {
return new ResGetSevenLoginReward(properties);
};
/**
* Encodes the specified ResGetSevenLoginReward message. Does not implicitly {@link tutorial.ResGetSevenLoginReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {tutorial.IResGetSevenLoginReward} message ResGetSevenLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetSevenLoginReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResGetSevenLoginReward message, length delimited. Does not implicitly {@link tutorial.ResGetSevenLoginReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {tutorial.IResGetSevenLoginReward} message ResGetSevenLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetSevenLoginReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetSevenLoginReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetSevenLoginReward} ResGetSevenLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetSevenLoginReward.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.ResGetSevenLoginReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetSevenLoginReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetSevenLoginReward} ResGetSevenLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetSevenLoginReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetSevenLoginReward message.
* @function verify
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetSevenLoginReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResGetSevenLoginReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetSevenLoginReward} ResGetSevenLoginReward
*/
ResGetSevenLoginReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetSevenLoginReward)
return object;
var message = new $root.tutorial.ResGetSevenLoginReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResGetSevenLoginReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {tutorial.ResGetSevenLoginReward} message ResGetSevenLoginReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetSevenLoginReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResGetSevenLoginReward to JSON.
* @function toJSON
* @memberof tutorial.ResGetSevenLoginReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetSevenLoginReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetSevenLoginReward
* @function getTypeUrl
* @memberof tutorial.ResGetSevenLoginReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetSevenLoginReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetSevenLoginReward";
};
return ResGetSevenLoginReward;
})();
tutorial.ReqGetMonthLoginReward = (function() {
/**
* Properties of a ReqGetMonthLoginReward.
* @memberof tutorial
* @interface IReqGetMonthLoginReward
* @property {number|null} [Id] ReqGetMonthLoginReward Id
*/
/**
* Constructs a new ReqGetMonthLoginReward.
* @memberof tutorial
* @classdesc Represents a ReqGetMonthLoginReward.
* @implements IReqGetMonthLoginReward
* @constructor
* @param {tutorial.IReqGetMonthLoginReward=} [properties] Properties to set
*/
function ReqGetMonthLoginReward(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]];
}
/**
* ReqGetMonthLoginReward Id.
* @member {number} Id
* @memberof tutorial.ReqGetMonthLoginReward
* @instance
*/
ReqGetMonthLoginReward.prototype.Id = 0;
/**
* Creates a new ReqGetMonthLoginReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {tutorial.IReqGetMonthLoginReward=} [properties] Properties to set
* @returns {tutorial.ReqGetMonthLoginReward} ReqGetMonthLoginReward instance
*/
ReqGetMonthLoginReward.create = function create(properties) {
return new ReqGetMonthLoginReward(properties);
};
/**
* Encodes the specified ReqGetMonthLoginReward message. Does not implicitly {@link tutorial.ReqGetMonthLoginReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {tutorial.IReqGetMonthLoginReward} message ReqGetMonthLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetMonthLoginReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqGetMonthLoginReward message, length delimited. Does not implicitly {@link tutorial.ReqGetMonthLoginReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {tutorial.IReqGetMonthLoginReward} message ReqGetMonthLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetMonthLoginReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetMonthLoginReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetMonthLoginReward} ReqGetMonthLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetMonthLoginReward.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.ReqGetMonthLoginReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetMonthLoginReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetMonthLoginReward} ReqGetMonthLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetMonthLoginReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetMonthLoginReward message.
* @function verify
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetMonthLoginReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqGetMonthLoginReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetMonthLoginReward} ReqGetMonthLoginReward
*/
ReqGetMonthLoginReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetMonthLoginReward)
return object;
var message = new $root.tutorial.ReqGetMonthLoginReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqGetMonthLoginReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {tutorial.ReqGetMonthLoginReward} message ReqGetMonthLoginReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetMonthLoginReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqGetMonthLoginReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGetMonthLoginReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetMonthLoginReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetMonthLoginReward
* @function getTypeUrl
* @memberof tutorial.ReqGetMonthLoginReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetMonthLoginReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetMonthLoginReward";
};
return ReqGetMonthLoginReward;
})();
tutorial.ResGetMonthLoginReward = (function() {
/**
* Properties of a ResGetMonthLoginReward.
* @memberof tutorial
* @interface IResGetMonthLoginReward
* @property {tutorial.RES_CODE|null} [Code] ResGetMonthLoginReward Code
* @property {string|null} [Msg] ResGetMonthLoginReward Msg
*/
/**
* Constructs a new ResGetMonthLoginReward.
* @memberof tutorial
* @classdesc Represents a ResGetMonthLoginReward.
* @implements IResGetMonthLoginReward
* @constructor
* @param {tutorial.IResGetMonthLoginReward=} [properties] Properties to set
*/
function ResGetMonthLoginReward(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]];
}
/**
* ResGetMonthLoginReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGetMonthLoginReward
* @instance
*/
ResGetMonthLoginReward.prototype.Code = 0;
/**
* ResGetMonthLoginReward Msg.
* @member {string} Msg
* @memberof tutorial.ResGetMonthLoginReward
* @instance
*/
ResGetMonthLoginReward.prototype.Msg = "";
/**
* Creates a new ResGetMonthLoginReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {tutorial.IResGetMonthLoginReward=} [properties] Properties to set
* @returns {tutorial.ResGetMonthLoginReward} ResGetMonthLoginReward instance
*/
ResGetMonthLoginReward.create = function create(properties) {
return new ResGetMonthLoginReward(properties);
};
/**
* Encodes the specified ResGetMonthLoginReward message. Does not implicitly {@link tutorial.ResGetMonthLoginReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {tutorial.IResGetMonthLoginReward} message ResGetMonthLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetMonthLoginReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResGetMonthLoginReward message, length delimited. Does not implicitly {@link tutorial.ResGetMonthLoginReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {tutorial.IResGetMonthLoginReward} message ResGetMonthLoginReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetMonthLoginReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetMonthLoginReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetMonthLoginReward} ResGetMonthLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetMonthLoginReward.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.ResGetMonthLoginReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetMonthLoginReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetMonthLoginReward} ResGetMonthLoginReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetMonthLoginReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetMonthLoginReward message.
* @function verify
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetMonthLoginReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResGetMonthLoginReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetMonthLoginReward} ResGetMonthLoginReward
*/
ResGetMonthLoginReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetMonthLoginReward)
return object;
var message = new $root.tutorial.ResGetMonthLoginReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResGetMonthLoginReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {tutorial.ResGetMonthLoginReward} message ResGetMonthLoginReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetMonthLoginReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResGetMonthLoginReward to JSON.
* @function toJSON
* @memberof tutorial.ResGetMonthLoginReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetMonthLoginReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetMonthLoginReward
* @function getTypeUrl
* @memberof tutorial.ResGetMonthLoginReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetMonthLoginReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetMonthLoginReward";
};
return ResGetMonthLoginReward;
})();
tutorial.ResActivity = (function() {
/**
* Properties of a ResActivity.
* @memberof tutorial
* @interface IResActivity
* @property {Array.<tutorial.IActivityInfo>|null} [ActiveList] ResActivity ActiveList
*/
/**
* Constructs a new ResActivity.
* @memberof tutorial
* @classdesc Represents a ResActivity.
* @implements IResActivity
* @constructor
* @param {tutorial.IResActivity=} [properties] Properties to set
*/
function ResActivity(properties) {
this.ActiveList = [];
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]];
}
/**
* ResActivity ActiveList.
* @member {Array.<tutorial.IActivityInfo>} ActiveList
* @memberof tutorial.ResActivity
* @instance
*/
ResActivity.prototype.ActiveList = $util.emptyArray;
/**
* Creates a new ResActivity instance using the specified properties.
* @function create
* @memberof tutorial.ResActivity
* @static
* @param {tutorial.IResActivity=} [properties] Properties to set
* @returns {tutorial.ResActivity} ResActivity instance
*/
ResActivity.create = function create(properties) {
return new ResActivity(properties);
};
/**
* Encodes the specified ResActivity message. Does not implicitly {@link tutorial.ResActivity.verify|verify} messages.
* @function encode
* @memberof tutorial.ResActivity
* @static
* @param {tutorial.IResActivity} message ResActivity message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResActivity.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ActiveList != null && message.ActiveList.length)
for (var i = 0; i < message.ActiveList.length; ++i)
$root.tutorial.ActivityInfo.encode(message.ActiveList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResActivity message, length delimited. Does not implicitly {@link tutorial.ResActivity.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResActivity
* @static
* @param {tutorial.IResActivity} message ResActivity message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResActivity.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResActivity message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResActivity
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResActivity} ResActivity
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResActivity.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.ResActivity();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.ActiveList && message.ActiveList.length))
message.ActiveList = [];
message.ActiveList.push($root.tutorial.ActivityInfo.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResActivity message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResActivity
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResActivity} ResActivity
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResActivity.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResActivity message.
* @function verify
* @memberof tutorial.ResActivity
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResActivity.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ActiveList != null && message.hasOwnProperty("ActiveList")) {
if (!Array.isArray(message.ActiveList))
return "ActiveList: array expected";
for (var i = 0; i < message.ActiveList.length; ++i) {
var error = $root.tutorial.ActivityInfo.verify(message.ActiveList[i]);
if (error)
return "ActiveList." + error;
}
}
return null;
};
/**
* Creates a ResActivity message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResActivity
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResActivity} ResActivity
*/
ResActivity.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResActivity)
return object;
var message = new $root.tutorial.ResActivity();
if (object.ActiveList) {
if (!Array.isArray(object.ActiveList))
throw TypeError(".tutorial.ResActivity.ActiveList: array expected");
message.ActiveList = [];
for (var i = 0; i < object.ActiveList.length; ++i) {
if (typeof object.ActiveList[i] !== "object")
throw TypeError(".tutorial.ResActivity.ActiveList: object expected");
message.ActiveList[i] = $root.tutorial.ActivityInfo.fromObject(object.ActiveList[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResActivity message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResActivity
* @static
* @param {tutorial.ResActivity} message ResActivity
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResActivity.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.ActiveList = [];
if (message.ActiveList && message.ActiveList.length) {
object.ActiveList = [];
for (var j = 0; j < message.ActiveList.length; ++j)
object.ActiveList[j] = $root.tutorial.ActivityInfo.toObject(message.ActiveList[j], options);
}
return object;
};
/**
* Converts this ResActivity to JSON.
* @function toJSON
* @memberof tutorial.ResActivity
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResActivity.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResActivity
* @function getTypeUrl
* @memberof tutorial.ResActivity
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResActivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResActivity";
};
return ResActivity;
})();
tutorial.ActivityInfo = (function() {
/**
* Properties of an ActivityInfo.
* @memberof tutorial
* @interface IActivityInfo
* @property {number|null} [Id] ActivityInfo Id
* @property {number|null} [Type] ActivityInfo Type
* @property {number|null} [StartTime] ActivityInfo StartTime
* @property {number|null} [EndTime] ActivityInfo EndTime
* @property {number|null} [Status] ActivityInfo Status
* @property {string|null} [Title] ActivityInfo Title
* @property {number|null} [Red] ActivityInfo Red
*/
/**
* Constructs a new ActivityInfo.
* @memberof tutorial
* @classdesc Represents an ActivityInfo.
* @implements IActivityInfo
* @constructor
* @param {tutorial.IActivityInfo=} [properties] Properties to set
*/
function ActivityInfo(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]];
}
/**
* ActivityInfo Id.
* @member {number} Id
* @memberof tutorial.ActivityInfo
* @instance
*/
ActivityInfo.prototype.Id = 0;
/**
* ActivityInfo Type.
* @member {number} Type
* @memberof tutorial.ActivityInfo
* @instance
*/
ActivityInfo.prototype.Type = 0;
/**
* ActivityInfo StartTime.
* @member {number} StartTime
* @memberof tutorial.ActivityInfo
* @instance
*/
ActivityInfo.prototype.StartTime = 0;
/**
* ActivityInfo EndTime.
* @member {number} EndTime
* @memberof tutorial.ActivityInfo
* @instance
*/
ActivityInfo.prototype.EndTime = 0;
/**
* ActivityInfo Status.
* @member {number} Status
* @memberof tutorial.ActivityInfo
* @instance
*/
ActivityInfo.prototype.Status = 0;
/**
* ActivityInfo Title.
* @member {string} Title
* @memberof tutorial.ActivityInfo
* @instance
*/
ActivityInfo.prototype.Title = "";
/**
* ActivityInfo Red.
* @member {number} Red
* @memberof tutorial.ActivityInfo
* @instance
*/
ActivityInfo.prototype.Red = 0;
/**
* Creates a new ActivityInfo instance using the specified properties.
* @function create
* @memberof tutorial.ActivityInfo
* @static
* @param {tutorial.IActivityInfo=} [properties] Properties to set
* @returns {tutorial.ActivityInfo} ActivityInfo instance
*/
ActivityInfo.create = function create(properties) {
return new ActivityInfo(properties);
};
/**
* Encodes the specified ActivityInfo message. Does not implicitly {@link tutorial.ActivityInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ActivityInfo
* @static
* @param {tutorial.IActivityInfo} message ActivityInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ActivityInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Type);
if (message.StartTime != null && Object.hasOwnProperty.call(message, "StartTime"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.StartTime);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.EndTime);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Status);
if (message.Title != null && Object.hasOwnProperty.call(message, "Title"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.Title);
if (message.Red != null && Object.hasOwnProperty.call(message, "Red"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.Red);
return writer;
};
/**
* Encodes the specified ActivityInfo message, length delimited. Does not implicitly {@link tutorial.ActivityInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ActivityInfo
* @static
* @param {tutorial.IActivityInfo} message ActivityInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ActivityInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ActivityInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ActivityInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ActivityInfo} ActivityInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ActivityInfo.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.ActivityInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Type = reader.int32();
break;
}
case 3: {
message.StartTime = reader.int32();
break;
}
case 4: {
message.EndTime = reader.int32();
break;
}
case 5: {
message.Status = reader.int32();
break;
}
case 6: {
message.Title = reader.string();
break;
}
case 7: {
message.Red = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ActivityInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ActivityInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ActivityInfo} ActivityInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ActivityInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ActivityInfo message.
* @function verify
* @memberof tutorial.ActivityInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ActivityInfo.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))
return "Id: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.StartTime != null && message.hasOwnProperty("StartTime"))
if (!$util.isInteger(message.StartTime))
return "StartTime: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.Title != null && message.hasOwnProperty("Title"))
if (!$util.isString(message.Title))
return "Title: string expected";
if (message.Red != null && message.hasOwnProperty("Red"))
if (!$util.isInteger(message.Red))
return "Red: integer expected";
return null;
};
/**
* Creates an ActivityInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ActivityInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ActivityInfo} ActivityInfo
*/
ActivityInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ActivityInfo)
return object;
var message = new $root.tutorial.ActivityInfo();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Type != null)
message.Type = object.Type | 0;
if (object.StartTime != null)
message.StartTime = object.StartTime | 0;
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
if (object.Status != null)
message.Status = object.Status | 0;
if (object.Title != null)
message.Title = String(object.Title);
if (object.Red != null)
message.Red = object.Red | 0;
return message;
};
/**
* Creates a plain object from an ActivityInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ActivityInfo
* @static
* @param {tutorial.ActivityInfo} message ActivityInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ActivityInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.Type = 0;
object.StartTime = 0;
object.EndTime = 0;
object.Status = 0;
object.Title = "";
object.Red = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.StartTime != null && message.hasOwnProperty("StartTime"))
object.StartTime = message.StartTime;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.Title != null && message.hasOwnProperty("Title"))
object.Title = message.Title;
if (message.Red != null && message.hasOwnProperty("Red"))
object.Red = message.Red;
return object;
};
/**
* Converts this ActivityInfo to JSON.
* @function toJSON
* @memberof tutorial.ActivityInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ActivityInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ActivityInfo
* @function getTypeUrl
* @memberof tutorial.ActivityInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ActivityInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ActivityInfo";
};
return ActivityInfo;
})();
tutorial.ReqLimitEvent = (function() {
/**
* Properties of a ReqLimitEvent.
* @memberof tutorial
* @interface IReqLimitEvent
*/
/**
* Constructs a new ReqLimitEvent.
* @memberof tutorial
* @classdesc Represents a ReqLimitEvent.
* @implements IReqLimitEvent
* @constructor
* @param {tutorial.IReqLimitEvent=} [properties] Properties to set
*/
function ReqLimitEvent(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]];
}
/**
* Creates a new ReqLimitEvent instance using the specified properties.
* @function create
* @memberof tutorial.ReqLimitEvent
* @static
* @param {tutorial.IReqLimitEvent=} [properties] Properties to set
* @returns {tutorial.ReqLimitEvent} ReqLimitEvent instance
*/
ReqLimitEvent.create = function create(properties) {
return new ReqLimitEvent(properties);
};
/**
* Encodes the specified ReqLimitEvent message. Does not implicitly {@link tutorial.ReqLimitEvent.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqLimitEvent
* @static
* @param {tutorial.IReqLimitEvent} message ReqLimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqLimitEvent.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqLimitEvent message, length delimited. Does not implicitly {@link tutorial.ReqLimitEvent.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqLimitEvent
* @static
* @param {tutorial.IReqLimitEvent} message ReqLimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqLimitEvent.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqLimitEvent message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqLimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqLimitEvent} ReqLimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqLimitEvent.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.ReqLimitEvent();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqLimitEvent message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqLimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqLimitEvent} ReqLimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqLimitEvent.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqLimitEvent message.
* @function verify
* @memberof tutorial.ReqLimitEvent
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqLimitEvent.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqLimitEvent message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqLimitEvent
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqLimitEvent} ReqLimitEvent
*/
ReqLimitEvent.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqLimitEvent)
return object;
return new $root.tutorial.ReqLimitEvent();
};
/**
* Creates a plain object from a ReqLimitEvent message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqLimitEvent
* @static
* @param {tutorial.ReqLimitEvent} message ReqLimitEvent
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqLimitEvent.toObject = function toObject() {
return {};
};
/**
* Converts this ReqLimitEvent to JSON.
* @function toJSON
* @memberof tutorial.ReqLimitEvent
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqLimitEvent.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqLimitEvent
* @function getTypeUrl
* @memberof tutorial.ReqLimitEvent
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqLimitEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqLimitEvent";
};
return ReqLimitEvent;
})();
tutorial.ResLimitEvent = (function() {
/**
* Properties of a ResLimitEvent.
* @memberof tutorial
* @interface IResLimitEvent
* @property {Object.<string,tutorial.ILimitEvent>|null} [LimitEventList] ResLimitEvent LimitEventList
*/
/**
* Constructs a new ResLimitEvent.
* @memberof tutorial
* @classdesc Represents a ResLimitEvent.
* @implements IResLimitEvent
* @constructor
* @param {tutorial.IResLimitEvent=} [properties] Properties to set
*/
function ResLimitEvent(properties) {
this.LimitEventList = {};
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]];
}
/**
* ResLimitEvent LimitEventList.
* @member {Object.<string,tutorial.ILimitEvent>} LimitEventList
* @memberof tutorial.ResLimitEvent
* @instance
*/
ResLimitEvent.prototype.LimitEventList = $util.emptyObject;
/**
* Creates a new ResLimitEvent instance using the specified properties.
* @function create
* @memberof tutorial.ResLimitEvent
* @static
* @param {tutorial.IResLimitEvent=} [properties] Properties to set
* @returns {tutorial.ResLimitEvent} ResLimitEvent instance
*/
ResLimitEvent.create = function create(properties) {
return new ResLimitEvent(properties);
};
/**
* Encodes the specified ResLimitEvent message. Does not implicitly {@link tutorial.ResLimitEvent.verify|verify} messages.
* @function encode
* @memberof tutorial.ResLimitEvent
* @static
* @param {tutorial.IResLimitEvent} message ResLimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLimitEvent.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.LimitEventList != null && Object.hasOwnProperty.call(message, "LimitEventList"))
for (var keys = Object.keys(message.LimitEventList), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.LimitEvent.encode(message.LimitEventList[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
return writer;
};
/**
* Encodes the specified ResLimitEvent message, length delimited. Does not implicitly {@link tutorial.ResLimitEvent.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResLimitEvent
* @static
* @param {tutorial.IResLimitEvent} message ResLimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLimitEvent.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResLimitEvent message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResLimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResLimitEvent} ResLimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLimitEvent.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.ResLimitEvent(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.LimitEventList === $util.emptyObject)
message.LimitEventList = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.LimitEvent.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.LimitEventList[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResLimitEvent message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResLimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResLimitEvent} ResLimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLimitEvent.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResLimitEvent message.
* @function verify
* @memberof tutorial.ResLimitEvent
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResLimitEvent.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.LimitEventList != null && message.hasOwnProperty("LimitEventList")) {
if (!$util.isObject(message.LimitEventList))
return "LimitEventList: object expected";
var key = Object.keys(message.LimitEventList);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "LimitEventList: integer key{k:int32} expected";
{
var error = $root.tutorial.LimitEvent.verify(message.LimitEventList[key[i]]);
if (error)
return "LimitEventList." + error;
}
}
}
return null;
};
/**
* Creates a ResLimitEvent message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResLimitEvent
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResLimitEvent} ResLimitEvent
*/
ResLimitEvent.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResLimitEvent)
return object;
var message = new $root.tutorial.ResLimitEvent();
if (object.LimitEventList) {
if (typeof object.LimitEventList !== "object")
throw TypeError(".tutorial.ResLimitEvent.LimitEventList: object expected");
message.LimitEventList = {};
for (var keys = Object.keys(object.LimitEventList), i = 0; i < keys.length; ++i) {
if (typeof object.LimitEventList[keys[i]] !== "object")
throw TypeError(".tutorial.ResLimitEvent.LimitEventList: object expected");
message.LimitEventList[keys[i]] = $root.tutorial.LimitEvent.fromObject(object.LimitEventList[keys[i]]);
}
}
return message;
};
/**
* Creates a plain object from a ResLimitEvent message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResLimitEvent
* @static
* @param {tutorial.ResLimitEvent} message ResLimitEvent
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResLimitEvent.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.LimitEventList = {};
var keys2;
if (message.LimitEventList && (keys2 = Object.keys(message.LimitEventList)).length) {
object.LimitEventList = {};
for (var j = 0; j < keys2.length; ++j)
object.LimitEventList[keys2[j]] = $root.tutorial.LimitEvent.toObject(message.LimitEventList[keys2[j]], options);
}
return object;
};
/**
* Converts this ResLimitEvent to JSON.
* @function toJSON
* @memberof tutorial.ResLimitEvent
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResLimitEvent.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResLimitEvent
* @function getTypeUrl
* @memberof tutorial.ResLimitEvent
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResLimitEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResLimitEvent";
};
return ResLimitEvent;
})();
tutorial.ResLimitEventProgress = (function() {
/**
* Properties of a ResLimitEventProgress.
* @memberof tutorial
* @interface IResLimitEventProgress
* @property {number|null} [Progress] ResLimitEventProgress Progress
* @property {Object.<string,number>|null} [ProgressReward] ResLimitEventProgress ProgressReward
*/
/**
* Constructs a new ResLimitEventProgress.
* @memberof tutorial
* @classdesc Represents a ResLimitEventProgress.
* @implements IResLimitEventProgress
* @constructor
* @param {tutorial.IResLimitEventProgress=} [properties] Properties to set
*/
function ResLimitEventProgress(properties) {
this.ProgressReward = {};
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]];
}
/**
* ResLimitEventProgress Progress.
* @member {number} Progress
* @memberof tutorial.ResLimitEventProgress
* @instance
*/
ResLimitEventProgress.prototype.Progress = 0;
/**
* ResLimitEventProgress ProgressReward.
* @member {Object.<string,number>} ProgressReward
* @memberof tutorial.ResLimitEventProgress
* @instance
*/
ResLimitEventProgress.prototype.ProgressReward = $util.emptyObject;
/**
* Creates a new ResLimitEventProgress instance using the specified properties.
* @function create
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {tutorial.IResLimitEventProgress=} [properties] Properties to set
* @returns {tutorial.ResLimitEventProgress} ResLimitEventProgress instance
*/
ResLimitEventProgress.create = function create(properties) {
return new ResLimitEventProgress(properties);
};
/**
* Encodes the specified ResLimitEventProgress message. Does not implicitly {@link tutorial.ResLimitEventProgress.verify|verify} messages.
* @function encode
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {tutorial.IResLimitEventProgress} message ResLimitEventProgress message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLimitEventProgress.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Progress != null && Object.hasOwnProperty.call(message, "Progress"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Progress);
if (message.ProgressReward != null && Object.hasOwnProperty.call(message, "ProgressReward"))
for (var keys = Object.keys(message.ProgressReward), i = 0; i < keys.length; ++i)
writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.ProgressReward[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ResLimitEventProgress message, length delimited. Does not implicitly {@link tutorial.ResLimitEventProgress.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {tutorial.IResLimitEventProgress} message ResLimitEventProgress message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLimitEventProgress.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResLimitEventProgress message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResLimitEventProgress} ResLimitEventProgress
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLimitEventProgress.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.ResLimitEventProgress(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 2: {
message.Progress = reader.int32();
break;
}
case 3: {
if (message.ProgressReward === $util.emptyObject)
message.ProgressReward = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.ProgressReward[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResLimitEventProgress message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResLimitEventProgress} ResLimitEventProgress
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLimitEventProgress.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResLimitEventProgress message.
* @function verify
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResLimitEventProgress.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Progress != null && message.hasOwnProperty("Progress"))
if (!$util.isInteger(message.Progress))
return "Progress: integer expected";
if (message.ProgressReward != null && message.hasOwnProperty("ProgressReward")) {
if (!$util.isObject(message.ProgressReward))
return "ProgressReward: object expected";
var key = Object.keys(message.ProgressReward);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "ProgressReward: integer key{k:int32} expected";
if (!$util.isInteger(message.ProgressReward[key[i]]))
return "ProgressReward: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates a ResLimitEventProgress message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResLimitEventProgress} ResLimitEventProgress
*/
ResLimitEventProgress.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResLimitEventProgress)
return object;
var message = new $root.tutorial.ResLimitEventProgress();
if (object.Progress != null)
message.Progress = object.Progress | 0;
if (object.ProgressReward) {
if (typeof object.ProgressReward !== "object")
throw TypeError(".tutorial.ResLimitEventProgress.ProgressReward: object expected");
message.ProgressReward = {};
for (var keys = Object.keys(object.ProgressReward), i = 0; i < keys.length; ++i)
message.ProgressReward[keys[i]] = object.ProgressReward[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ResLimitEventProgress message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {tutorial.ResLimitEventProgress} message ResLimitEventProgress
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResLimitEventProgress.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.ProgressReward = {};
if (options.defaults)
object.Progress = 0;
if (message.Progress != null && message.hasOwnProperty("Progress"))
object.Progress = message.Progress;
var keys2;
if (message.ProgressReward && (keys2 = Object.keys(message.ProgressReward)).length) {
object.ProgressReward = {};
for (var j = 0; j < keys2.length; ++j)
object.ProgressReward[keys2[j]] = message.ProgressReward[keys2[j]];
}
return object;
};
/**
* Converts this ResLimitEventProgress to JSON.
* @function toJSON
* @memberof tutorial.ResLimitEventProgress
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResLimitEventProgress.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResLimitEventProgress
* @function getTypeUrl
* @memberof tutorial.ResLimitEventProgress
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResLimitEventProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResLimitEventProgress";
};
return ResLimitEventProgress;
})();
tutorial.ReqLimitEventReward = (function() {
/**
* Properties of a ReqLimitEventReward.
* @memberof tutorial
* @interface IReqLimitEventReward
* @property {number|null} [Id] ReqLimitEventReward Id
*/
/**
* Constructs a new ReqLimitEventReward.
* @memberof tutorial
* @classdesc Represents a ReqLimitEventReward.
* @implements IReqLimitEventReward
* @constructor
* @param {tutorial.IReqLimitEventReward=} [properties] Properties to set
*/
function ReqLimitEventReward(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]];
}
/**
* ReqLimitEventReward Id.
* @member {number} Id
* @memberof tutorial.ReqLimitEventReward
* @instance
*/
ReqLimitEventReward.prototype.Id = 0;
/**
* Creates a new ReqLimitEventReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {tutorial.IReqLimitEventReward=} [properties] Properties to set
* @returns {tutorial.ReqLimitEventReward} ReqLimitEventReward instance
*/
ReqLimitEventReward.create = function create(properties) {
return new ReqLimitEventReward(properties);
};
/**
* Encodes the specified ReqLimitEventReward message. Does not implicitly {@link tutorial.ReqLimitEventReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {tutorial.IReqLimitEventReward} message ReqLimitEventReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqLimitEventReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqLimitEventReward message, length delimited. Does not implicitly {@link tutorial.ReqLimitEventReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {tutorial.IReqLimitEventReward} message ReqLimitEventReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqLimitEventReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqLimitEventReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqLimitEventReward} ReqLimitEventReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqLimitEventReward.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.ReqLimitEventReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqLimitEventReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqLimitEventReward} ReqLimitEventReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqLimitEventReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqLimitEventReward message.
* @function verify
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqLimitEventReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqLimitEventReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqLimitEventReward} ReqLimitEventReward
*/
ReqLimitEventReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqLimitEventReward)
return object;
var message = new $root.tutorial.ReqLimitEventReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqLimitEventReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {tutorial.ReqLimitEventReward} message ReqLimitEventReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqLimitEventReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqLimitEventReward to JSON.
* @function toJSON
* @memberof tutorial.ReqLimitEventReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqLimitEventReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqLimitEventReward
* @function getTypeUrl
* @memberof tutorial.ReqLimitEventReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqLimitEventReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqLimitEventReward";
};
return ReqLimitEventReward;
})();
tutorial.ResLimitEventReward = (function() {
/**
* Properties of a ResLimitEventReward.
* @memberof tutorial
* @interface IResLimitEventReward
* @property {tutorial.RES_CODE|null} [Code] ResLimitEventReward Code
* @property {string|null} [Msg] ResLimitEventReward Msg
*/
/**
* Constructs a new ResLimitEventReward.
* @memberof tutorial
* @classdesc Represents a ResLimitEventReward.
* @implements IResLimitEventReward
* @constructor
* @param {tutorial.IResLimitEventReward=} [properties] Properties to set
*/
function ResLimitEventReward(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]];
}
/**
* ResLimitEventReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResLimitEventReward
* @instance
*/
ResLimitEventReward.prototype.Code = 0;
/**
* ResLimitEventReward Msg.
* @member {string} Msg
* @memberof tutorial.ResLimitEventReward
* @instance
*/
ResLimitEventReward.prototype.Msg = "";
/**
* Creates a new ResLimitEventReward instance using the specified properties.
* @function create
* @memberof tutorial.ResLimitEventReward
* @static
* @param {tutorial.IResLimitEventReward=} [properties] Properties to set
* @returns {tutorial.ResLimitEventReward} ResLimitEventReward instance
*/
ResLimitEventReward.create = function create(properties) {
return new ResLimitEventReward(properties);
};
/**
* Encodes the specified ResLimitEventReward message. Does not implicitly {@link tutorial.ResLimitEventReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResLimitEventReward
* @static
* @param {tutorial.IResLimitEventReward} message ResLimitEventReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLimitEventReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResLimitEventReward message, length delimited. Does not implicitly {@link tutorial.ResLimitEventReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResLimitEventReward
* @static
* @param {tutorial.IResLimitEventReward} message ResLimitEventReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLimitEventReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResLimitEventReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResLimitEventReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResLimitEventReward} ResLimitEventReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLimitEventReward.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.ResLimitEventReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResLimitEventReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResLimitEventReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResLimitEventReward} ResLimitEventReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLimitEventReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResLimitEventReward message.
* @function verify
* @memberof tutorial.ResLimitEventReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResLimitEventReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResLimitEventReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResLimitEventReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResLimitEventReward} ResLimitEventReward
*/
ResLimitEventReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResLimitEventReward)
return object;
var message = new $root.tutorial.ResLimitEventReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResLimitEventReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResLimitEventReward
* @static
* @param {tutorial.ResLimitEventReward} message ResLimitEventReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResLimitEventReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResLimitEventReward to JSON.
* @function toJSON
* @memberof tutorial.ResLimitEventReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResLimitEventReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResLimitEventReward
* @function getTypeUrl
* @memberof tutorial.ResLimitEventReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResLimitEventReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResLimitEventReward";
};
return ResLimitEventReward;
})();
tutorial.ReqSelectLimitEvent = (function() {
/**
* Properties of a ReqSelectLimitEvent.
* @memberof tutorial
* @interface IReqSelectLimitEvent
* @property {number|null} [Id] ReqSelectLimitEvent Id
*/
/**
* Constructs a new ReqSelectLimitEvent.
* @memberof tutorial
* @classdesc Represents a ReqSelectLimitEvent.
* @implements IReqSelectLimitEvent
* @constructor
* @param {tutorial.IReqSelectLimitEvent=} [properties] Properties to set
*/
function ReqSelectLimitEvent(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]];
}
/**
* ReqSelectLimitEvent Id.
* @member {number} Id
* @memberof tutorial.ReqSelectLimitEvent
* @instance
*/
ReqSelectLimitEvent.prototype.Id = 0;
/**
* Creates a new ReqSelectLimitEvent instance using the specified properties.
* @function create
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {tutorial.IReqSelectLimitEvent=} [properties] Properties to set
* @returns {tutorial.ReqSelectLimitEvent} ReqSelectLimitEvent instance
*/
ReqSelectLimitEvent.create = function create(properties) {
return new ReqSelectLimitEvent(properties);
};
/**
* Encodes the specified ReqSelectLimitEvent message. Does not implicitly {@link tutorial.ReqSelectLimitEvent.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {tutorial.IReqSelectLimitEvent} message ReqSelectLimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSelectLimitEvent.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqSelectLimitEvent message, length delimited. Does not implicitly {@link tutorial.ReqSelectLimitEvent.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {tutorial.IReqSelectLimitEvent} message ReqSelectLimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSelectLimitEvent.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSelectLimitEvent message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSelectLimitEvent} ReqSelectLimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSelectLimitEvent.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.ReqSelectLimitEvent();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSelectLimitEvent message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSelectLimitEvent} ReqSelectLimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSelectLimitEvent.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSelectLimitEvent message.
* @function verify
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSelectLimitEvent.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqSelectLimitEvent message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSelectLimitEvent} ReqSelectLimitEvent
*/
ReqSelectLimitEvent.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSelectLimitEvent)
return object;
var message = new $root.tutorial.ReqSelectLimitEvent();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqSelectLimitEvent message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {tutorial.ReqSelectLimitEvent} message ReqSelectLimitEvent
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSelectLimitEvent.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqSelectLimitEvent to JSON.
* @function toJSON
* @memberof tutorial.ReqSelectLimitEvent
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSelectLimitEvent.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSelectLimitEvent
* @function getTypeUrl
* @memberof tutorial.ReqSelectLimitEvent
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSelectLimitEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSelectLimitEvent";
};
return ReqSelectLimitEvent;
})();
tutorial.ResSelectLimitEvent = (function() {
/**
* Properties of a ResSelectLimitEvent.
* @memberof tutorial
* @interface IResSelectLimitEvent
* @property {tutorial.RES_CODE|null} [Code] ResSelectLimitEvent Code
* @property {string|null} [Msg] ResSelectLimitEvent Msg
*/
/**
* Constructs a new ResSelectLimitEvent.
* @memberof tutorial
* @classdesc Represents a ResSelectLimitEvent.
* @implements IResSelectLimitEvent
* @constructor
* @param {tutorial.IResSelectLimitEvent=} [properties] Properties to set
*/
function ResSelectLimitEvent(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]];
}
/**
* ResSelectLimitEvent Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResSelectLimitEvent
* @instance
*/
ResSelectLimitEvent.prototype.Code = 0;
/**
* ResSelectLimitEvent Msg.
* @member {string} Msg
* @memberof tutorial.ResSelectLimitEvent
* @instance
*/
ResSelectLimitEvent.prototype.Msg = "";
/**
* Creates a new ResSelectLimitEvent instance using the specified properties.
* @function create
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {tutorial.IResSelectLimitEvent=} [properties] Properties to set
* @returns {tutorial.ResSelectLimitEvent} ResSelectLimitEvent instance
*/
ResSelectLimitEvent.create = function create(properties) {
return new ResSelectLimitEvent(properties);
};
/**
* Encodes the specified ResSelectLimitEvent message. Does not implicitly {@link tutorial.ResSelectLimitEvent.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {tutorial.IResSelectLimitEvent} message ResSelectLimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSelectLimitEvent.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResSelectLimitEvent message, length delimited. Does not implicitly {@link tutorial.ResSelectLimitEvent.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {tutorial.IResSelectLimitEvent} message ResSelectLimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSelectLimitEvent.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSelectLimitEvent message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSelectLimitEvent} ResSelectLimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSelectLimitEvent.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.ResSelectLimitEvent();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSelectLimitEvent message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSelectLimitEvent} ResSelectLimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSelectLimitEvent.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSelectLimitEvent message.
* @function verify
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSelectLimitEvent.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResSelectLimitEvent message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSelectLimitEvent} ResSelectLimitEvent
*/
ResSelectLimitEvent.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSelectLimitEvent)
return object;
var message = new $root.tutorial.ResSelectLimitEvent();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResSelectLimitEvent message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {tutorial.ResSelectLimitEvent} message ResSelectLimitEvent
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSelectLimitEvent.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResSelectLimitEvent to JSON.
* @function toJSON
* @memberof tutorial.ResSelectLimitEvent
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSelectLimitEvent.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSelectLimitEvent
* @function getTypeUrl
* @memberof tutorial.ResSelectLimitEvent
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSelectLimitEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSelectLimitEvent";
};
return ResSelectLimitEvent;
})();
tutorial.LimitEvent = (function() {
/**
* Properties of a LimitEvent.
* @memberof tutorial
* @interface ILimitEvent
* @property {number|null} [EndTime] LimitEvent EndTime
* @property {number|null} [Cd] LimitEvent Cd
*/
/**
* Constructs a new LimitEvent.
* @memberof tutorial
* @classdesc Represents a LimitEvent.
* @implements ILimitEvent
* @constructor
* @param {tutorial.ILimitEvent=} [properties] Properties to set
*/
function LimitEvent(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]];
}
/**
* LimitEvent EndTime.
* @member {number} EndTime
* @memberof tutorial.LimitEvent
* @instance
*/
LimitEvent.prototype.EndTime = 0;
/**
* LimitEvent Cd.
* @member {number} Cd
* @memberof tutorial.LimitEvent
* @instance
*/
LimitEvent.prototype.Cd = 0;
/**
* Creates a new LimitEvent instance using the specified properties.
* @function create
* @memberof tutorial.LimitEvent
* @static
* @param {tutorial.ILimitEvent=} [properties] Properties to set
* @returns {tutorial.LimitEvent} LimitEvent instance
*/
LimitEvent.create = function create(properties) {
return new LimitEvent(properties);
};
/**
* Encodes the specified LimitEvent message. Does not implicitly {@link tutorial.LimitEvent.verify|verify} messages.
* @function encode
* @memberof tutorial.LimitEvent
* @static
* @param {tutorial.ILimitEvent} message LimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
LimitEvent.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.EndTime);
if (message.Cd != null && Object.hasOwnProperty.call(message, "Cd"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Cd);
return writer;
};
/**
* Encodes the specified LimitEvent message, length delimited. Does not implicitly {@link tutorial.LimitEvent.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.LimitEvent
* @static
* @param {tutorial.ILimitEvent} message LimitEvent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
LimitEvent.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a LimitEvent message from the specified reader or buffer.
* @function decode
* @memberof tutorial.LimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.LimitEvent} LimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
LimitEvent.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.LimitEvent();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.EndTime = reader.int32();
break;
}
case 2: {
message.Cd = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a LimitEvent message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.LimitEvent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.LimitEvent} LimitEvent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
LimitEvent.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a LimitEvent message.
* @function verify
* @memberof tutorial.LimitEvent
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
LimitEvent.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
if (message.Cd != null && message.hasOwnProperty("Cd"))
if (!$util.isInteger(message.Cd))
return "Cd: integer expected";
return null;
};
/**
* Creates a LimitEvent message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.LimitEvent
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.LimitEvent} LimitEvent
*/
LimitEvent.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.LimitEvent)
return object;
var message = new $root.tutorial.LimitEvent();
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
if (object.Cd != null)
message.Cd = object.Cd | 0;
return message;
};
/**
* Creates a plain object from a LimitEvent message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.LimitEvent
* @static
* @param {tutorial.LimitEvent} message LimitEvent
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
LimitEvent.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.EndTime = 0;
object.Cd = 0;
}
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
if (message.Cd != null && message.hasOwnProperty("Cd"))
object.Cd = message.Cd;
return object;
};
/**
* Converts this LimitEvent to JSON.
* @function toJSON
* @memberof tutorial.LimitEvent
* @instance
* @returns {Object.<string,*>} JSON object
*/
LimitEvent.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for LimitEvent
* @function getTypeUrl
* @memberof tutorial.LimitEvent
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
LimitEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.LimitEvent";
};
return LimitEvent;
})();
tutorial.LimitEventNotify = (function() {
/**
* Properties of a LimitEventNotify.
* @memberof tutorial
* @interface ILimitEventNotify
* @property {number|null} [Id] LimitEventNotify Id
* @property {number|null} [Type] LimitEventNotify Type
* @property {number|null} [EndTime] LimitEventNotify EndTime
* @property {number|null} [Cd] LimitEventNotify Cd
*/
/**
* Constructs a new LimitEventNotify.
* @memberof tutorial
* @classdesc Represents a LimitEventNotify.
* @implements ILimitEventNotify
* @constructor
* @param {tutorial.ILimitEventNotify=} [properties] Properties to set
*/
function LimitEventNotify(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]];
}
/**
* LimitEventNotify Id.
* @member {number} Id
* @memberof tutorial.LimitEventNotify
* @instance
*/
LimitEventNotify.prototype.Id = 0;
/**
* LimitEventNotify Type.
* @member {number} Type
* @memberof tutorial.LimitEventNotify
* @instance
*/
LimitEventNotify.prototype.Type = 0;
/**
* LimitEventNotify EndTime.
* @member {number} EndTime
* @memberof tutorial.LimitEventNotify
* @instance
*/
LimitEventNotify.prototype.EndTime = 0;
/**
* LimitEventNotify Cd.
* @member {number} Cd
* @memberof tutorial.LimitEventNotify
* @instance
*/
LimitEventNotify.prototype.Cd = 0;
/**
* Creates a new LimitEventNotify instance using the specified properties.
* @function create
* @memberof tutorial.LimitEventNotify
* @static
* @param {tutorial.ILimitEventNotify=} [properties] Properties to set
* @returns {tutorial.LimitEventNotify} LimitEventNotify instance
*/
LimitEventNotify.create = function create(properties) {
return new LimitEventNotify(properties);
};
/**
* Encodes the specified LimitEventNotify message. Does not implicitly {@link tutorial.LimitEventNotify.verify|verify} messages.
* @function encode
* @memberof tutorial.LimitEventNotify
* @static
* @param {tutorial.ILimitEventNotify} message LimitEventNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
LimitEventNotify.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Type);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.EndTime);
if (message.Cd != null && Object.hasOwnProperty.call(message, "Cd"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Cd);
return writer;
};
/**
* Encodes the specified LimitEventNotify message, length delimited. Does not implicitly {@link tutorial.LimitEventNotify.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.LimitEventNotify
* @static
* @param {tutorial.ILimitEventNotify} message LimitEventNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
LimitEventNotify.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a LimitEventNotify message from the specified reader or buffer.
* @function decode
* @memberof tutorial.LimitEventNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.LimitEventNotify} LimitEventNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
LimitEventNotify.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.LimitEventNotify();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Type = reader.int32();
break;
}
case 3: {
message.EndTime = reader.int32();
break;
}
case 4: {
message.Cd = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a LimitEventNotify message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.LimitEventNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.LimitEventNotify} LimitEventNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
LimitEventNotify.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a LimitEventNotify message.
* @function verify
* @memberof tutorial.LimitEventNotify
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
LimitEventNotify.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))
return "Id: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
if (message.Cd != null && message.hasOwnProperty("Cd"))
if (!$util.isInteger(message.Cd))
return "Cd: integer expected";
return null;
};
/**
* Creates a LimitEventNotify message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.LimitEventNotify
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.LimitEventNotify} LimitEventNotify
*/
LimitEventNotify.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.LimitEventNotify)
return object;
var message = new $root.tutorial.LimitEventNotify();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Type != null)
message.Type = object.Type | 0;
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
if (object.Cd != null)
message.Cd = object.Cd | 0;
return message;
};
/**
* Creates a plain object from a LimitEventNotify message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.LimitEventNotify
* @static
* @param {tutorial.LimitEventNotify} message LimitEventNotify
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
LimitEventNotify.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.Type = 0;
object.EndTime = 0;
object.Cd = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
if (message.Cd != null && message.hasOwnProperty("Cd"))
object.Cd = message.Cd;
return object;
};
/**
* Converts this LimitEventNotify to JSON.
* @function toJSON
* @memberof tutorial.LimitEventNotify
* @instance
* @returns {Object.<string,*>} JSON object
*/
LimitEventNotify.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for LimitEventNotify
* @function getTypeUrl
* @memberof tutorial.LimitEventNotify
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
LimitEventNotify.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.LimitEventNotify";
};
return LimitEventNotify;
})();
tutorial.ReqLimitSenceReward = (function() {
/**
* Properties of a ReqLimitSenceReward.
* @memberof tutorial
* @interface IReqLimitSenceReward
*/
/**
* Constructs a new ReqLimitSenceReward.
* @memberof tutorial
* @classdesc Represents a ReqLimitSenceReward.
* @implements IReqLimitSenceReward
* @constructor
* @param {tutorial.IReqLimitSenceReward=} [properties] Properties to set
*/
function ReqLimitSenceReward(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]];
}
/**
* Creates a new ReqLimitSenceReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {tutorial.IReqLimitSenceReward=} [properties] Properties to set
* @returns {tutorial.ReqLimitSenceReward} ReqLimitSenceReward instance
*/
ReqLimitSenceReward.create = function create(properties) {
return new ReqLimitSenceReward(properties);
};
/**
* Encodes the specified ReqLimitSenceReward message. Does not implicitly {@link tutorial.ReqLimitSenceReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {tutorial.IReqLimitSenceReward} message ReqLimitSenceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqLimitSenceReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqLimitSenceReward message, length delimited. Does not implicitly {@link tutorial.ReqLimitSenceReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {tutorial.IReqLimitSenceReward} message ReqLimitSenceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqLimitSenceReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqLimitSenceReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqLimitSenceReward} ReqLimitSenceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqLimitSenceReward.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.ReqLimitSenceReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqLimitSenceReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqLimitSenceReward} ReqLimitSenceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqLimitSenceReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqLimitSenceReward message.
* @function verify
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqLimitSenceReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqLimitSenceReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqLimitSenceReward} ReqLimitSenceReward
*/
ReqLimitSenceReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqLimitSenceReward)
return object;
return new $root.tutorial.ReqLimitSenceReward();
};
/**
* Creates a plain object from a ReqLimitSenceReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {tutorial.ReqLimitSenceReward} message ReqLimitSenceReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqLimitSenceReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqLimitSenceReward to JSON.
* @function toJSON
* @memberof tutorial.ReqLimitSenceReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqLimitSenceReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqLimitSenceReward
* @function getTypeUrl
* @memberof tutorial.ReqLimitSenceReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqLimitSenceReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqLimitSenceReward";
};
return ReqLimitSenceReward;
})();
tutorial.ResLimitSenceReward = (function() {
/**
* Properties of a ResLimitSenceReward.
* @memberof tutorial
* @interface IResLimitSenceReward
* @property {tutorial.RES_CODE|null} [Code] ResLimitSenceReward Code
* @property {string|null} [Msg] ResLimitSenceReward Msg
*/
/**
* Constructs a new ResLimitSenceReward.
* @memberof tutorial
* @classdesc Represents a ResLimitSenceReward.
* @implements IResLimitSenceReward
* @constructor
* @param {tutorial.IResLimitSenceReward=} [properties] Properties to set
*/
function ResLimitSenceReward(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]];
}
/**
* ResLimitSenceReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResLimitSenceReward
* @instance
*/
ResLimitSenceReward.prototype.Code = 0;
/**
* ResLimitSenceReward Msg.
* @member {string} Msg
* @memberof tutorial.ResLimitSenceReward
* @instance
*/
ResLimitSenceReward.prototype.Msg = "";
/**
* Creates a new ResLimitSenceReward instance using the specified properties.
* @function create
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {tutorial.IResLimitSenceReward=} [properties] Properties to set
* @returns {tutorial.ResLimitSenceReward} ResLimitSenceReward instance
*/
ResLimitSenceReward.create = function create(properties) {
return new ResLimitSenceReward(properties);
};
/**
* Encodes the specified ResLimitSenceReward message. Does not implicitly {@link tutorial.ResLimitSenceReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {tutorial.IResLimitSenceReward} message ResLimitSenceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLimitSenceReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResLimitSenceReward message, length delimited. Does not implicitly {@link tutorial.ResLimitSenceReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {tutorial.IResLimitSenceReward} message ResLimitSenceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResLimitSenceReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResLimitSenceReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResLimitSenceReward} ResLimitSenceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLimitSenceReward.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.ResLimitSenceReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResLimitSenceReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResLimitSenceReward} ResLimitSenceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResLimitSenceReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResLimitSenceReward message.
* @function verify
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResLimitSenceReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResLimitSenceReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResLimitSenceReward} ResLimitSenceReward
*/
ResLimitSenceReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResLimitSenceReward)
return object;
var message = new $root.tutorial.ResLimitSenceReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResLimitSenceReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {tutorial.ResLimitSenceReward} message ResLimitSenceReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResLimitSenceReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResLimitSenceReward to JSON.
* @function toJSON
* @memberof tutorial.ResLimitSenceReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResLimitSenceReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResLimitSenceReward
* @function getTypeUrl
* @memberof tutorial.ResLimitSenceReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResLimitSenceReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResLimitSenceReward";
};
return ResLimitSenceReward;
})();
tutorial.ResChessRainReward = (function() {
/**
* Properties of a ResChessRainReward.
* @memberof tutorial
* @interface IResChessRainReward
* @property {number|null} [Chest] ResChessRainReward Chest
*/
/**
* Constructs a new ResChessRainReward.
* @memberof tutorial
* @classdesc Represents a ResChessRainReward.
* @implements IResChessRainReward
* @constructor
* @param {tutorial.IResChessRainReward=} [properties] Properties to set
*/
function ResChessRainReward(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]];
}
/**
* ResChessRainReward Chest.
* @member {number} Chest
* @memberof tutorial.ResChessRainReward
* @instance
*/
ResChessRainReward.prototype.Chest = 0;
/**
* Creates a new ResChessRainReward instance using the specified properties.
* @function create
* @memberof tutorial.ResChessRainReward
* @static
* @param {tutorial.IResChessRainReward=} [properties] Properties to set
* @returns {tutorial.ResChessRainReward} ResChessRainReward instance
*/
ResChessRainReward.create = function create(properties) {
return new ResChessRainReward(properties);
};
/**
* Encodes the specified ResChessRainReward message. Does not implicitly {@link tutorial.ResChessRainReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChessRainReward
* @static
* @param {tutorial.IResChessRainReward} message ResChessRainReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChessRainReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Chest != null && Object.hasOwnProperty.call(message, "Chest"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Chest);
return writer;
};
/**
* Encodes the specified ResChessRainReward message, length delimited. Does not implicitly {@link tutorial.ResChessRainReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChessRainReward
* @static
* @param {tutorial.IResChessRainReward} message ResChessRainReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChessRainReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChessRainReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChessRainReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChessRainReward} ResChessRainReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChessRainReward.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.ResChessRainReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Chest = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChessRainReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChessRainReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChessRainReward} ResChessRainReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChessRainReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChessRainReward message.
* @function verify
* @memberof tutorial.ResChessRainReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChessRainReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Chest != null && message.hasOwnProperty("Chest"))
if (!$util.isInteger(message.Chest))
return "Chest: integer expected";
return null;
};
/**
* Creates a ResChessRainReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChessRainReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChessRainReward} ResChessRainReward
*/
ResChessRainReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChessRainReward)
return object;
var message = new $root.tutorial.ResChessRainReward();
if (object.Chest != null)
message.Chest = object.Chest | 0;
return message;
};
/**
* Creates a plain object from a ResChessRainReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChessRainReward
* @static
* @param {tutorial.ResChessRainReward} message ResChessRainReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChessRainReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Chest = 0;
if (message.Chest != null && message.hasOwnProperty("Chest"))
object.Chest = message.Chest;
return object;
};
/**
* Converts this ResChessRainReward to JSON.
* @function toJSON
* @memberof tutorial.ResChessRainReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChessRainReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChessRainReward
* @function getTypeUrl
* @memberof tutorial.ResChessRainReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChessRainReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChessRainReward";
};
return ResChessRainReward;
})();
tutorial.ReqFastProduceReward = (function() {
/**
* Properties of a ReqFastProduceReward.
* @memberof tutorial
* @interface IReqFastProduceReward
* @property {number|null} [Energy] ReqFastProduceReward Energy
*/
/**
* Constructs a new ReqFastProduceReward.
* @memberof tutorial
* @classdesc Represents a ReqFastProduceReward.
* @implements IReqFastProduceReward
* @constructor
* @param {tutorial.IReqFastProduceReward=} [properties] Properties to set
*/
function ReqFastProduceReward(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]];
}
/**
* ReqFastProduceReward Energy.
* @member {number} Energy
* @memberof tutorial.ReqFastProduceReward
* @instance
*/
ReqFastProduceReward.prototype.Energy = 0;
/**
* Creates a new ReqFastProduceReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {tutorial.IReqFastProduceReward=} [properties] Properties to set
* @returns {tutorial.ReqFastProduceReward} ReqFastProduceReward instance
*/
ReqFastProduceReward.create = function create(properties) {
return new ReqFastProduceReward(properties);
};
/**
* Encodes the specified ReqFastProduceReward message. Does not implicitly {@link tutorial.ReqFastProduceReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {tutorial.IReqFastProduceReward} message ReqFastProduceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFastProduceReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Energy != null && Object.hasOwnProperty.call(message, "Energy"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Energy);
return writer;
};
/**
* Encodes the specified ReqFastProduceReward message, length delimited. Does not implicitly {@link tutorial.ReqFastProduceReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {tutorial.IReqFastProduceReward} message ReqFastProduceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFastProduceReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFastProduceReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFastProduceReward} ReqFastProduceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFastProduceReward.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.ReqFastProduceReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Energy = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFastProduceReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFastProduceReward} ReqFastProduceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFastProduceReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFastProduceReward message.
* @function verify
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFastProduceReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Energy != null && message.hasOwnProperty("Energy"))
if (!$util.isInteger(message.Energy))
return "Energy: integer expected";
return null;
};
/**
* Creates a ReqFastProduceReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFastProduceReward} ReqFastProduceReward
*/
ReqFastProduceReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFastProduceReward)
return object;
var message = new $root.tutorial.ReqFastProduceReward();
if (object.Energy != null)
message.Energy = object.Energy | 0;
return message;
};
/**
* Creates a plain object from a ReqFastProduceReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {tutorial.ReqFastProduceReward} message ReqFastProduceReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFastProduceReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Energy = 0;
if (message.Energy != null && message.hasOwnProperty("Energy"))
object.Energy = message.Energy;
return object;
};
/**
* Converts this ReqFastProduceReward to JSON.
* @function toJSON
* @memberof tutorial.ReqFastProduceReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFastProduceReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFastProduceReward
* @function getTypeUrl
* @memberof tutorial.ReqFastProduceReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFastProduceReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFastProduceReward";
};
return ReqFastProduceReward;
})();
tutorial.ResFastProduceReward = (function() {
/**
* Properties of a ResFastProduceReward.
* @memberof tutorial
* @interface IResFastProduceReward
* @property {tutorial.RES_CODE|null} [Code] ResFastProduceReward Code
* @property {string|null} [Msg] ResFastProduceReward Msg
*/
/**
* Constructs a new ResFastProduceReward.
* @memberof tutorial
* @classdesc Represents a ResFastProduceReward.
* @implements IResFastProduceReward
* @constructor
* @param {tutorial.IResFastProduceReward=} [properties] Properties to set
*/
function ResFastProduceReward(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]];
}
/**
* ResFastProduceReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResFastProduceReward
* @instance
*/
ResFastProduceReward.prototype.Code = 0;
/**
* ResFastProduceReward Msg.
* @member {string} Msg
* @memberof tutorial.ResFastProduceReward
* @instance
*/
ResFastProduceReward.prototype.Msg = "";
/**
* Creates a new ResFastProduceReward instance using the specified properties.
* @function create
* @memberof tutorial.ResFastProduceReward
* @static
* @param {tutorial.IResFastProduceReward=} [properties] Properties to set
* @returns {tutorial.ResFastProduceReward} ResFastProduceReward instance
*/
ResFastProduceReward.create = function create(properties) {
return new ResFastProduceReward(properties);
};
/**
* Encodes the specified ResFastProduceReward message. Does not implicitly {@link tutorial.ResFastProduceReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFastProduceReward
* @static
* @param {tutorial.IResFastProduceReward} message ResFastProduceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFastProduceReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResFastProduceReward message, length delimited. Does not implicitly {@link tutorial.ResFastProduceReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFastProduceReward
* @static
* @param {tutorial.IResFastProduceReward} message ResFastProduceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFastProduceReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFastProduceReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFastProduceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFastProduceReward} ResFastProduceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFastProduceReward.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.ResFastProduceReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFastProduceReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFastProduceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFastProduceReward} ResFastProduceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFastProduceReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFastProduceReward message.
* @function verify
* @memberof tutorial.ResFastProduceReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFastProduceReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResFastProduceReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFastProduceReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFastProduceReward} ResFastProduceReward
*/
ResFastProduceReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFastProduceReward)
return object;
var message = new $root.tutorial.ResFastProduceReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResFastProduceReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFastProduceReward
* @static
* @param {tutorial.ResFastProduceReward} message ResFastProduceReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFastProduceReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResFastProduceReward to JSON.
* @function toJSON
* @memberof tutorial.ResFastProduceReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFastProduceReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFastProduceReward
* @function getTypeUrl
* @memberof tutorial.ResFastProduceReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFastProduceReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFastProduceReward";
};
return ResFastProduceReward;
})();
tutorial.ReqSearchPlayer = (function() {
/**
* Properties of a ReqSearchPlayer.
* @memberof tutorial
* @interface IReqSearchPlayer
* @property {string|null} [Uid] ReqSearchPlayer Uid
*/
/**
* Constructs a new ReqSearchPlayer.
* @memberof tutorial
* @classdesc Represents a ReqSearchPlayer.
* @implements IReqSearchPlayer
* @constructor
* @param {tutorial.IReqSearchPlayer=} [properties] Properties to set
*/
function ReqSearchPlayer(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]];
}
/**
* ReqSearchPlayer Uid.
* @member {string} Uid
* @memberof tutorial.ReqSearchPlayer
* @instance
*/
ReqSearchPlayer.prototype.Uid = "";
/**
* Creates a new ReqSearchPlayer instance using the specified properties.
* @function create
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {tutorial.IReqSearchPlayer=} [properties] Properties to set
* @returns {tutorial.ReqSearchPlayer} ReqSearchPlayer instance
*/
ReqSearchPlayer.create = function create(properties) {
return new ReqSearchPlayer(properties);
};
/**
* Encodes the specified ReqSearchPlayer message. Does not implicitly {@link tutorial.ReqSearchPlayer.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {tutorial.IReqSearchPlayer} message ReqSearchPlayer message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSearchPlayer.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Uid);
return writer;
};
/**
* Encodes the specified ReqSearchPlayer message, length delimited. Does not implicitly {@link tutorial.ReqSearchPlayer.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {tutorial.IReqSearchPlayer} message ReqSearchPlayer message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSearchPlayer.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSearchPlayer message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSearchPlayer} ReqSearchPlayer
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSearchPlayer.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.ReqSearchPlayer();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSearchPlayer message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSearchPlayer} ReqSearchPlayer
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSearchPlayer.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSearchPlayer message.
* @function verify
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSearchPlayer.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isString(message.Uid))
return "Uid: string expected";
return null;
};
/**
* Creates a ReqSearchPlayer message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSearchPlayer} ReqSearchPlayer
*/
ReqSearchPlayer.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSearchPlayer)
return object;
var message = new $root.tutorial.ReqSearchPlayer();
if (object.Uid != null)
message.Uid = String(object.Uid);
return message;
};
/**
* Creates a plain object from a ReqSearchPlayer message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {tutorial.ReqSearchPlayer} message ReqSearchPlayer
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSearchPlayer.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Uid = "";
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ReqSearchPlayer to JSON.
* @function toJSON
* @memberof tutorial.ReqSearchPlayer
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSearchPlayer.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSearchPlayer
* @function getTypeUrl
* @memberof tutorial.ReqSearchPlayer
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSearchPlayer.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSearchPlayer";
};
return ReqSearchPlayer;
})();
tutorial.ResSearchPlayer = (function() {
/**
* Properties of a ResSearchPlayer.
* @memberof tutorial
* @interface IResSearchPlayer
* @property {number|null} [Code] ResSearchPlayer Code
* @property {Array.<tutorial.IResPlayerSimple>|null} [List] ResSearchPlayer List
*/
/**
* Constructs a new ResSearchPlayer.
* @memberof tutorial
* @classdesc Represents a ResSearchPlayer.
* @implements IResSearchPlayer
* @constructor
* @param {tutorial.IResSearchPlayer=} [properties] Properties to set
*/
function ResSearchPlayer(properties) {
this.List = [];
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]];
}
/**
* ResSearchPlayer Code.
* @member {number} Code
* @memberof tutorial.ResSearchPlayer
* @instance
*/
ResSearchPlayer.prototype.Code = 0;
/**
* ResSearchPlayer List.
* @member {Array.<tutorial.IResPlayerSimple>} List
* @memberof tutorial.ResSearchPlayer
* @instance
*/
ResSearchPlayer.prototype.List = $util.emptyArray;
/**
* Creates a new ResSearchPlayer instance using the specified properties.
* @function create
* @memberof tutorial.ResSearchPlayer
* @static
* @param {tutorial.IResSearchPlayer=} [properties] Properties to set
* @returns {tutorial.ResSearchPlayer} ResSearchPlayer instance
*/
ResSearchPlayer.create = function create(properties) {
return new ResSearchPlayer(properties);
};
/**
* Encodes the specified ResSearchPlayer message. Does not implicitly {@link tutorial.ResSearchPlayer.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSearchPlayer
* @static
* @param {tutorial.IResSearchPlayer} message ResSearchPlayer message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSearchPlayer.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.List != null && message.List.length)
for (var i = 0; i < message.List.length; ++i)
$root.tutorial.ResPlayerSimple.encode(message.List[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResSearchPlayer message, length delimited. Does not implicitly {@link tutorial.ResSearchPlayer.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSearchPlayer
* @static
* @param {tutorial.IResSearchPlayer} message ResSearchPlayer message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSearchPlayer.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSearchPlayer message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSearchPlayer
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSearchPlayer} ResSearchPlayer
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSearchPlayer.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.ResSearchPlayer();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
if (!(message.List && message.List.length))
message.List = [];
message.List.push($root.tutorial.ResPlayerSimple.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSearchPlayer message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSearchPlayer
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSearchPlayer} ResSearchPlayer
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSearchPlayer.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSearchPlayer message.
* @function verify
* @memberof tutorial.ResSearchPlayer
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSearchPlayer.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
if (!$util.isInteger(message.Code))
return "Code: integer expected";
if (message.List != null && message.hasOwnProperty("List")) {
if (!Array.isArray(message.List))
return "List: array expected";
for (var i = 0; i < message.List.length; ++i) {
var error = $root.tutorial.ResPlayerSimple.verify(message.List[i]);
if (error)
return "List." + error;
}
}
return null;
};
/**
* Creates a ResSearchPlayer message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSearchPlayer
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSearchPlayer} ResSearchPlayer
*/
ResSearchPlayer.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSearchPlayer)
return object;
var message = new $root.tutorial.ResSearchPlayer();
if (object.Code != null)
message.Code = object.Code | 0;
if (object.List) {
if (!Array.isArray(object.List))
throw TypeError(".tutorial.ResSearchPlayer.List: array expected");
message.List = [];
for (var i = 0; i < object.List.length; ++i) {
if (typeof object.List[i] !== "object")
throw TypeError(".tutorial.ResSearchPlayer.List: object expected");
message.List[i] = $root.tutorial.ResPlayerSimple.fromObject(object.List[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResSearchPlayer message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSearchPlayer
* @static
* @param {tutorial.ResSearchPlayer} message ResSearchPlayer
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSearchPlayer.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.List = [];
if (options.defaults)
object.Code = 0;
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = message.Code;
if (message.List && message.List.length) {
object.List = [];
for (var j = 0; j < message.List.length; ++j)
object.List[j] = $root.tutorial.ResPlayerSimple.toObject(message.List[j], options);
}
return object;
};
/**
* Converts this ResSearchPlayer to JSON.
* @function toJSON
* @memberof tutorial.ResSearchPlayer
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSearchPlayer.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSearchPlayer
* @function getTypeUrl
* @memberof tutorial.ResSearchPlayer
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSearchPlayer.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSearchPlayer";
};
return ResSearchPlayer;
})();
tutorial.ResPlayerSimple = (function() {
/**
* Properties of a ResPlayerSimple.
* @memberof tutorial
* @interface IResPlayerSimple
* @property {number|null} [Uid] ResPlayerSimple Uid
* @property {string|null} [Name] ResPlayerSimple Name
* @property {number|null} [Face] ResPlayerSimple Face
* @property {number|null} [Avatar] ResPlayerSimple Avatar
* @property {number|null} [Level] ResPlayerSimple Level
* @property {number|null} [Decorate] ResPlayerSimple Decorate
* @property {number|null} [login] ResPlayerSimple login
* @property {number|null} [loginout] ResPlayerSimple loginout
* @property {string|null} [Facebook] ResPlayerSimple Facebook
*/
/**
* Constructs a new ResPlayerSimple.
* @memberof tutorial
* @classdesc Represents a ResPlayerSimple.
* @implements IResPlayerSimple
* @constructor
* @param {tutorial.IResPlayerSimple=} [properties] Properties to set
*/
function ResPlayerSimple(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]];
}
/**
* ResPlayerSimple Uid.
* @member {number} Uid
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.Uid = 0;
/**
* ResPlayerSimple Name.
* @member {string} Name
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.Name = "";
/**
* ResPlayerSimple Face.
* @member {number} Face
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.Face = 0;
/**
* ResPlayerSimple Avatar.
* @member {number} Avatar
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.Avatar = 0;
/**
* ResPlayerSimple Level.
* @member {number} Level
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.Level = 0;
/**
* ResPlayerSimple Decorate.
* @member {number} Decorate
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.Decorate = 0;
/**
* ResPlayerSimple login.
* @member {number} login
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.login = 0;
/**
* ResPlayerSimple loginout.
* @member {number} loginout
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.loginout = 0;
/**
* ResPlayerSimple Facebook.
* @member {string} Facebook
* @memberof tutorial.ResPlayerSimple
* @instance
*/
ResPlayerSimple.prototype.Facebook = "";
/**
* Creates a new ResPlayerSimple instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayerSimple
* @static
* @param {tutorial.IResPlayerSimple=} [properties] Properties to set
* @returns {tutorial.ResPlayerSimple} ResPlayerSimple instance
*/
ResPlayerSimple.create = function create(properties) {
return new ResPlayerSimple(properties);
};
/**
* Encodes the specified ResPlayerSimple message. Does not implicitly {@link tutorial.ResPlayerSimple.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayerSimple
* @static
* @param {tutorial.IResPlayerSimple} message ResPlayerSimple message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerSimple.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Name);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Avatar);
if (message.Level != null && Object.hasOwnProperty.call(message, "Level"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Level);
if (message.Decorate != null && Object.hasOwnProperty.call(message, "Decorate"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.Decorate);
if (message.login != null && Object.hasOwnProperty.call(message, "login"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.login);
if (message.loginout != null && Object.hasOwnProperty.call(message, "loginout"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.loginout);
if (message.Facebook != null && Object.hasOwnProperty.call(message, "Facebook"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.Facebook);
return writer;
};
/**
* Encodes the specified ResPlayerSimple message, length delimited. Does not implicitly {@link tutorial.ResPlayerSimple.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayerSimple
* @static
* @param {tutorial.IResPlayerSimple} message ResPlayerSimple message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerSimple.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayerSimple message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayerSimple
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayerSimple} ResPlayerSimple
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerSimple.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.ResPlayerSimple();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.Name = reader.string();
break;
}
case 3: {
message.Face = reader.int32();
break;
}
case 4: {
message.Avatar = reader.int32();
break;
}
case 5: {
message.Level = reader.int32();
break;
}
case 6: {
message.Decorate = reader.int32();
break;
}
case 7: {
message.login = reader.int32();
break;
}
case 8: {
message.loginout = reader.int32();
break;
}
case 9: {
message.Facebook = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayerSimple message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayerSimple
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayerSimple} ResPlayerSimple
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerSimple.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayerSimple message.
* @function verify
* @memberof tutorial.ResPlayerSimple
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayerSimple.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
if (message.Level != null && message.hasOwnProperty("Level"))
if (!$util.isInteger(message.Level))
return "Level: integer expected";
if (message.Decorate != null && message.hasOwnProperty("Decorate"))
if (!$util.isInteger(message.Decorate))
return "Decorate: integer expected";
if (message.login != null && message.hasOwnProperty("login"))
if (!$util.isInteger(message.login))
return "login: integer expected";
if (message.loginout != null && message.hasOwnProperty("loginout"))
if (!$util.isInteger(message.loginout))
return "loginout: integer expected";
if (message.Facebook != null && message.hasOwnProperty("Facebook"))
if (!$util.isString(message.Facebook))
return "Facebook: string expected";
return null;
};
/**
* Creates a ResPlayerSimple message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayerSimple
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayerSimple} ResPlayerSimple
*/
ResPlayerSimple.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayerSimple)
return object;
var message = new $root.tutorial.ResPlayerSimple();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.Name != null)
message.Name = String(object.Name);
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
if (object.Level != null)
message.Level = object.Level | 0;
if (object.Decorate != null)
message.Decorate = object.Decorate | 0;
if (object.login != null)
message.login = object.login | 0;
if (object.loginout != null)
message.loginout = object.loginout | 0;
if (object.Facebook != null)
message.Facebook = String(object.Facebook);
return message;
};
/**
* Creates a plain object from a ResPlayerSimple message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayerSimple
* @static
* @param {tutorial.ResPlayerSimple} message ResPlayerSimple
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayerSimple.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Uid = 0;
object.Name = "";
object.Face = 0;
object.Avatar = 0;
object.Level = 0;
object.Decorate = 0;
object.login = 0;
object.loginout = 0;
object.Facebook = "";
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
if (message.Level != null && message.hasOwnProperty("Level"))
object.Level = message.Level;
if (message.Decorate != null && message.hasOwnProperty("Decorate"))
object.Decorate = message.Decorate;
if (message.login != null && message.hasOwnProperty("login"))
object.login = message.login;
if (message.loginout != null && message.hasOwnProperty("loginout"))
object.loginout = message.loginout;
if (message.Facebook != null && message.hasOwnProperty("Facebook"))
object.Facebook = message.Facebook;
return object;
};
/**
* Converts this ResPlayerSimple to JSON.
* @function toJSON
* @memberof tutorial.ResPlayerSimple
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayerSimple.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayerSimple
* @function getTypeUrl
* @memberof tutorial.ResPlayerSimple
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayerSimple.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayerSimple";
};
return ResPlayerSimple;
})();
tutorial.ResPlayerRank = (function() {
/**
* Properties of a ResPlayerRank.
* @memberof tutorial
* @interface IResPlayerRank
* @property {number|null} [Uid] ResPlayerRank Uid
* @property {string|null} [Name] ResPlayerRank Name
* @property {number|null} [Face] ResPlayerRank Face
* @property {number|null} [Avatar] ResPlayerRank Avatar
* @property {number|null} [Level] ResPlayerRank Level
* @property {number|null} [score] ResPlayerRank score
*/
/**
* Constructs a new ResPlayerRank.
* @memberof tutorial
* @classdesc Represents a ResPlayerRank.
* @implements IResPlayerRank
* @constructor
* @param {tutorial.IResPlayerRank=} [properties] Properties to set
*/
function ResPlayerRank(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]];
}
/**
* ResPlayerRank Uid.
* @member {number} Uid
* @memberof tutorial.ResPlayerRank
* @instance
*/
ResPlayerRank.prototype.Uid = 0;
/**
* ResPlayerRank Name.
* @member {string} Name
* @memberof tutorial.ResPlayerRank
* @instance
*/
ResPlayerRank.prototype.Name = "";
/**
* ResPlayerRank Face.
* @member {number} Face
* @memberof tutorial.ResPlayerRank
* @instance
*/
ResPlayerRank.prototype.Face = 0;
/**
* ResPlayerRank Avatar.
* @member {number} Avatar
* @memberof tutorial.ResPlayerRank
* @instance
*/
ResPlayerRank.prototype.Avatar = 0;
/**
* ResPlayerRank Level.
* @member {number} Level
* @memberof tutorial.ResPlayerRank
* @instance
*/
ResPlayerRank.prototype.Level = 0;
/**
* ResPlayerRank score.
* @member {number} score
* @memberof tutorial.ResPlayerRank
* @instance
*/
ResPlayerRank.prototype.score = 0;
/**
* Creates a new ResPlayerRank instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayerRank
* @static
* @param {tutorial.IResPlayerRank=} [properties] Properties to set
* @returns {tutorial.ResPlayerRank} ResPlayerRank instance
*/
ResPlayerRank.create = function create(properties) {
return new ResPlayerRank(properties);
};
/**
* Encodes the specified ResPlayerRank message. Does not implicitly {@link tutorial.ResPlayerRank.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayerRank
* @static
* @param {tutorial.IResPlayerRank} message ResPlayerRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerRank.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Name);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Avatar);
if (message.Level != null && Object.hasOwnProperty.call(message, "Level"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Level);
if (message.score != null && Object.hasOwnProperty.call(message, "score"))
writer.uint32(/* id 6, wireType 5 =*/53).float(message.score);
return writer;
};
/**
* Encodes the specified ResPlayerRank message, length delimited. Does not implicitly {@link tutorial.ResPlayerRank.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayerRank
* @static
* @param {tutorial.IResPlayerRank} message ResPlayerRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayerRank.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayerRank message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayerRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayerRank} ResPlayerRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerRank.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.ResPlayerRank();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.Name = reader.string();
break;
}
case 3: {
message.Face = reader.int32();
break;
}
case 4: {
message.Avatar = reader.int32();
break;
}
case 5: {
message.Level = reader.int32();
break;
}
case 6: {
message.score = reader.float();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayerRank message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayerRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayerRank} ResPlayerRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayerRank.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayerRank message.
* @function verify
* @memberof tutorial.ResPlayerRank
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayerRank.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
if (message.Level != null && message.hasOwnProperty("Level"))
if (!$util.isInteger(message.Level))
return "Level: integer expected";
if (message.score != null && message.hasOwnProperty("score"))
if (typeof message.score !== "number")
return "score: number expected";
return null;
};
/**
* Creates a ResPlayerRank message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayerRank
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayerRank} ResPlayerRank
*/
ResPlayerRank.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayerRank)
return object;
var message = new $root.tutorial.ResPlayerRank();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.Name != null)
message.Name = String(object.Name);
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
if (object.Level != null)
message.Level = object.Level | 0;
if (object.score != null)
message.score = Number(object.score);
return message;
};
/**
* Creates a plain object from a ResPlayerRank message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayerRank
* @static
* @param {tutorial.ResPlayerRank} message ResPlayerRank
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayerRank.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Uid = 0;
object.Name = "";
object.Face = 0;
object.Avatar = 0;
object.Level = 0;
object.score = 0;
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
if (message.Level != null && message.hasOwnProperty("Level"))
object.Level = message.Level;
if (message.score != null && message.hasOwnProperty("score"))
object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score;
return object;
};
/**
* Converts this ResPlayerRank to JSON.
* @function toJSON
* @memberof tutorial.ResPlayerRank
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayerRank.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayerRank
* @function getTypeUrl
* @memberof tutorial.ResPlayerRank
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayerRank.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayerRank";
};
return ResPlayerRank;
})();
tutorial.ResFriendLog = (function() {
/**
* Properties of a ResFriendLog.
* @memberof tutorial
* @interface IResFriendLog
* @property {tutorial.IResPlayerSimple|null} [Player] ResFriendLog Player
* @property {number|null} [Type] ResFriendLog Type
* @property {number|null} [Time] ResFriendLog Time
* @property {string|null} [Param] ResFriendLog Param
* @property {number|null} [Id] ResFriendLog Id
*/
/**
* Constructs a new ResFriendLog.
* @memberof tutorial
* @classdesc Represents a ResFriendLog.
* @implements IResFriendLog
* @constructor
* @param {tutorial.IResFriendLog=} [properties] Properties to set
*/
function ResFriendLog(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]];
}
/**
* ResFriendLog Player.
* @member {tutorial.IResPlayerSimple|null|undefined} Player
* @memberof tutorial.ResFriendLog
* @instance
*/
ResFriendLog.prototype.Player = null;
/**
* ResFriendLog Type.
* @member {number} Type
* @memberof tutorial.ResFriendLog
* @instance
*/
ResFriendLog.prototype.Type = 0;
/**
* ResFriendLog Time.
* @member {number} Time
* @memberof tutorial.ResFriendLog
* @instance
*/
ResFriendLog.prototype.Time = 0;
/**
* ResFriendLog Param.
* @member {string} Param
* @memberof tutorial.ResFriendLog
* @instance
*/
ResFriendLog.prototype.Param = "";
/**
* ResFriendLog Id.
* @member {number} Id
* @memberof tutorial.ResFriendLog
* @instance
*/
ResFriendLog.prototype.Id = 0;
/**
* Creates a new ResFriendLog instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendLog
* @static
* @param {tutorial.IResFriendLog=} [properties] Properties to set
* @returns {tutorial.ResFriendLog} ResFriendLog instance
*/
ResFriendLog.create = function create(properties) {
return new ResFriendLog(properties);
};
/**
* Encodes the specified ResFriendLog message. Does not implicitly {@link tutorial.ResFriendLog.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendLog
* @static
* @param {tutorial.IResFriendLog} message ResFriendLog message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendLog.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Player != null && Object.hasOwnProperty.call(message, "Player"))
$root.tutorial.ResPlayerSimple.encode(message.Player, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Type);
if (message.Time != null && Object.hasOwnProperty.call(message, "Time"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Time);
if (message.Param != null && Object.hasOwnProperty.call(message, "Param"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.Param);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Id);
return writer;
};
/**
* Encodes the specified ResFriendLog message, length delimited. Does not implicitly {@link tutorial.ResFriendLog.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendLog
* @static
* @param {tutorial.IResFriendLog} message ResFriendLog message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendLog.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendLog message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendLog
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendLog} ResFriendLog
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendLog.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.ResFriendLog();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Player = $root.tutorial.ResPlayerSimple.decode(reader, reader.uint32());
break;
}
case 2: {
message.Type = reader.int32();
break;
}
case 3: {
message.Time = reader.int32();
break;
}
case 4: {
message.Param = reader.string();
break;
}
case 5: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendLog message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendLog
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendLog} ResFriendLog
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendLog.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendLog message.
* @function verify
* @memberof tutorial.ResFriendLog
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendLog.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Player != null && message.hasOwnProperty("Player")) {
var error = $root.tutorial.ResPlayerSimple.verify(message.Player);
if (error)
return "Player." + error;
}
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Time != null && message.hasOwnProperty("Time"))
if (!$util.isInteger(message.Time))
return "Time: integer expected";
if (message.Param != null && message.hasOwnProperty("Param"))
if (!$util.isString(message.Param))
return "Param: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isInteger(message.Id))
return "Id: integer expected";
return null;
};
/**
* Creates a ResFriendLog message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendLog
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendLog} ResFriendLog
*/
ResFriendLog.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendLog)
return object;
var message = new $root.tutorial.ResFriendLog();
if (object.Player != null) {
if (typeof object.Player !== "object")
throw TypeError(".tutorial.ResFriendLog.Player: object expected");
message.Player = $root.tutorial.ResPlayerSimple.fromObject(object.Player);
}
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Time != null)
message.Time = object.Time | 0;
if (object.Param != null)
message.Param = String(object.Param);
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ResFriendLog message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendLog
* @static
* @param {tutorial.ResFriendLog} message ResFriendLog
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendLog.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Player = null;
object.Type = 0;
object.Time = 0;
object.Param = "";
object.Id = 0;
}
if (message.Player != null && message.hasOwnProperty("Player"))
object.Player = $root.tutorial.ResPlayerSimple.toObject(message.Player, options);
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.Time != null && message.hasOwnProperty("Time"))
object.Time = message.Time;
if (message.Param != null && message.hasOwnProperty("Param"))
object.Param = message.Param;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResFriendLog to JSON.
* @function toJSON
* @memberof tutorial.ResFriendLog
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendLog.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendLog
* @function getTypeUrl
* @memberof tutorial.ResFriendLog
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendLog.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendLog";
};
return ResFriendLog;
})();
tutorial.NotifyFriendLog = (function() {
/**
* Properties of a NotifyFriendLog.
* @memberof tutorial
* @interface INotifyFriendLog
* @property {tutorial.IResFriendLog|null} [info] NotifyFriendLog info
*/
/**
* Constructs a new NotifyFriendLog.
* @memberof tutorial
* @classdesc Represents a NotifyFriendLog.
* @implements INotifyFriendLog
* @constructor
* @param {tutorial.INotifyFriendLog=} [properties] Properties to set
*/
function NotifyFriendLog(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]];
}
/**
* NotifyFriendLog info.
* @member {tutorial.IResFriendLog|null|undefined} info
* @memberof tutorial.NotifyFriendLog
* @instance
*/
NotifyFriendLog.prototype.info = null;
/**
* Creates a new NotifyFriendLog instance using the specified properties.
* @function create
* @memberof tutorial.NotifyFriendLog
* @static
* @param {tutorial.INotifyFriendLog=} [properties] Properties to set
* @returns {tutorial.NotifyFriendLog} NotifyFriendLog instance
*/
NotifyFriendLog.create = function create(properties) {
return new NotifyFriendLog(properties);
};
/**
* Encodes the specified NotifyFriendLog message. Does not implicitly {@link tutorial.NotifyFriendLog.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyFriendLog
* @static
* @param {tutorial.INotifyFriendLog} message NotifyFriendLog message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyFriendLog.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.info != null && Object.hasOwnProperty.call(message, "info"))
$root.tutorial.ResFriendLog.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified NotifyFriendLog message, length delimited. Does not implicitly {@link tutorial.NotifyFriendLog.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyFriendLog
* @static
* @param {tutorial.INotifyFriendLog} message NotifyFriendLog message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyFriendLog.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyFriendLog message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyFriendLog
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyFriendLog} NotifyFriendLog
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyFriendLog.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.NotifyFriendLog();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.info = $root.tutorial.ResFriendLog.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyFriendLog message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyFriendLog
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyFriendLog} NotifyFriendLog
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyFriendLog.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyFriendLog message.
* @function verify
* @memberof tutorial.NotifyFriendLog
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyFriendLog.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.info != null && message.hasOwnProperty("info")) {
var error = $root.tutorial.ResFriendLog.verify(message.info);
if (error)
return "info." + error;
}
return null;
};
/**
* Creates a NotifyFriendLog message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyFriendLog
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyFriendLog} NotifyFriendLog
*/
NotifyFriendLog.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyFriendLog)
return object;
var message = new $root.tutorial.NotifyFriendLog();
if (object.info != null) {
if (typeof object.info !== "object")
throw TypeError(".tutorial.NotifyFriendLog.info: object expected");
message.info = $root.tutorial.ResFriendLog.fromObject(object.info);
}
return message;
};
/**
* Creates a plain object from a NotifyFriendLog message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyFriendLog
* @static
* @param {tutorial.NotifyFriendLog} message NotifyFriendLog
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyFriendLog.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.info = null;
if (message.info != null && message.hasOwnProperty("info"))
object.info = $root.tutorial.ResFriendLog.toObject(message.info, options);
return object;
};
/**
* Converts this NotifyFriendLog to JSON.
* @function toJSON
* @memberof tutorial.NotifyFriendLog
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyFriendLog.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyFriendLog
* @function getTypeUrl
* @memberof tutorial.NotifyFriendLog
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyFriendLog.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyFriendLog";
};
return NotifyFriendLog;
})();
tutorial.NotifyFriendCard = (function() {
/**
* Properties of a NotifyFriendCard.
* @memberof tutorial
* @interface INotifyFriendCard
* @property {tutorial.IResFriendCard|null} [Info] NotifyFriendCard Info
*/
/**
* Constructs a new NotifyFriendCard.
* @memberof tutorial
* @classdesc Represents a NotifyFriendCard.
* @implements INotifyFriendCard
* @constructor
* @param {tutorial.INotifyFriendCard=} [properties] Properties to set
*/
function NotifyFriendCard(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]];
}
/**
* NotifyFriendCard Info.
* @member {tutorial.IResFriendCard|null|undefined} Info
* @memberof tutorial.NotifyFriendCard
* @instance
*/
NotifyFriendCard.prototype.Info = null;
/**
* Creates a new NotifyFriendCard instance using the specified properties.
* @function create
* @memberof tutorial.NotifyFriendCard
* @static
* @param {tutorial.INotifyFriendCard=} [properties] Properties to set
* @returns {tutorial.NotifyFriendCard} NotifyFriendCard instance
*/
NotifyFriendCard.create = function create(properties) {
return new NotifyFriendCard(properties);
};
/**
* Encodes the specified NotifyFriendCard message. Does not implicitly {@link tutorial.NotifyFriendCard.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyFriendCard
* @static
* @param {tutorial.INotifyFriendCard} message NotifyFriendCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyFriendCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Info != null && Object.hasOwnProperty.call(message, "Info"))
$root.tutorial.ResFriendCard.encode(message.Info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified NotifyFriendCard message, length delimited. Does not implicitly {@link tutorial.NotifyFriendCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyFriendCard
* @static
* @param {tutorial.INotifyFriendCard} message NotifyFriendCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyFriendCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyFriendCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyFriendCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyFriendCard} NotifyFriendCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyFriendCard.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.NotifyFriendCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Info = $root.tutorial.ResFriendCard.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyFriendCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyFriendCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyFriendCard} NotifyFriendCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyFriendCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyFriendCard message.
* @function verify
* @memberof tutorial.NotifyFriendCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyFriendCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Info != null && message.hasOwnProperty("Info")) {
var error = $root.tutorial.ResFriendCard.verify(message.Info);
if (error)
return "Info." + error;
}
return null;
};
/**
* Creates a NotifyFriendCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyFriendCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyFriendCard} NotifyFriendCard
*/
NotifyFriendCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyFriendCard)
return object;
var message = new $root.tutorial.NotifyFriendCard();
if (object.Info != null) {
if (typeof object.Info !== "object")
throw TypeError(".tutorial.NotifyFriendCard.Info: object expected");
message.Info = $root.tutorial.ResFriendCard.fromObject(object.Info);
}
return message;
};
/**
* Creates a plain object from a NotifyFriendCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyFriendCard
* @static
* @param {tutorial.NotifyFriendCard} message NotifyFriendCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyFriendCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Info = null;
if (message.Info != null && message.hasOwnProperty("Info"))
object.Info = $root.tutorial.ResFriendCard.toObject(message.Info, options);
return object;
};
/**
* Converts this NotifyFriendCard to JSON.
* @function toJSON
* @memberof tutorial.NotifyFriendCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyFriendCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyFriendCard
* @function getTypeUrl
* @memberof tutorial.NotifyFriendCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyFriendCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyFriendCard";
};
return NotifyFriendCard;
})();
tutorial.ResFriendCard = (function() {
/**
* Properties of a ResFriendCard.
* @memberof tutorial
* @interface IResFriendCard
* @property {number|null} [Uid] ResFriendCard Uid
* @property {string|null} [Name] ResFriendCard Name
* @property {number|null} [Face] ResFriendCard Face
* @property {number|null} [Avatar] ResFriendCard Avatar
* @property {number|null} [Level] ResFriendCard Level
* @property {number|null} [Type] ResFriendCard Type
* @property {number|null} [Time] ResFriendCard Time
* @property {number|null} [CardId] ResFriendCard CardId
* @property {number|null} [ExCardId] ResFriendCard ExCardId
* @property {number|null} [Status] ResFriendCard Status
* @property {string|null} [Id] ResFriendCard Id
*/
/**
* Constructs a new ResFriendCard.
* @memberof tutorial
* @classdesc Represents a ResFriendCard.
* @implements IResFriendCard
* @constructor
* @param {tutorial.IResFriendCard=} [properties] Properties to set
*/
function ResFriendCard(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]];
}
/**
* ResFriendCard Uid.
* @member {number} Uid
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Uid = 0;
/**
* ResFriendCard Name.
* @member {string} Name
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Name = "";
/**
* ResFriendCard Face.
* @member {number} Face
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Face = 0;
/**
* ResFriendCard Avatar.
* @member {number} Avatar
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Avatar = 0;
/**
* ResFriendCard Level.
* @member {number} Level
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Level = 0;
/**
* ResFriendCard Type.
* @member {number} Type
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Type = 0;
/**
* ResFriendCard Time.
* @member {number} Time
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Time = 0;
/**
* ResFriendCard CardId.
* @member {number} CardId
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.CardId = 0;
/**
* ResFriendCard ExCardId.
* @member {number} ExCardId
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.ExCardId = 0;
/**
* ResFriendCard Status.
* @member {number} Status
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Status = 0;
/**
* ResFriendCard Id.
* @member {string} Id
* @memberof tutorial.ResFriendCard
* @instance
*/
ResFriendCard.prototype.Id = "";
/**
* Creates a new ResFriendCard instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendCard
* @static
* @param {tutorial.IResFriendCard=} [properties] Properties to set
* @returns {tutorial.ResFriendCard} ResFriendCard instance
*/
ResFriendCard.create = function create(properties) {
return new ResFriendCard(properties);
};
/**
* Encodes the specified ResFriendCard message. Does not implicitly {@link tutorial.ResFriendCard.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendCard
* @static
* @param {tutorial.IResFriendCard} message ResFriendCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Name);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Avatar);
if (message.Level != null && Object.hasOwnProperty.call(message, "Level"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Level);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.Type);
if (message.Time != null && Object.hasOwnProperty.call(message, "Time"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.Time);
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.CardId);
if (message.ExCardId != null && Object.hasOwnProperty.call(message, "ExCardId"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.ExCardId);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.Status);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 11, wireType 2 =*/90).string(message.Id);
return writer;
};
/**
* Encodes the specified ResFriendCard message, length delimited. Does not implicitly {@link tutorial.ResFriendCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendCard
* @static
* @param {tutorial.IResFriendCard} message ResFriendCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendCard} ResFriendCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendCard.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.ResFriendCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.Name = reader.string();
break;
}
case 3: {
message.Face = reader.int32();
break;
}
case 4: {
message.Avatar = reader.int32();
break;
}
case 5: {
message.Level = reader.int32();
break;
}
case 6: {
message.Type = reader.int32();
break;
}
case 7: {
message.Time = reader.int32();
break;
}
case 8: {
message.CardId = reader.int32();
break;
}
case 9: {
message.ExCardId = reader.int32();
break;
}
case 10: {
message.Status = reader.int32();
break;
}
case 11: {
message.Id = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendCard} ResFriendCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendCard message.
* @function verify
* @memberof tutorial.ResFriendCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
if (message.Level != null && message.hasOwnProperty("Level"))
if (!$util.isInteger(message.Level))
return "Level: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Time != null && message.hasOwnProperty("Time"))
if (!$util.isInteger(message.Time))
return "Time: integer expected";
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
if (message.ExCardId != null && message.hasOwnProperty("ExCardId"))
if (!$util.isInteger(message.ExCardId))
return "ExCardId: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isString(message.Id))
return "Id: string expected";
return null;
};
/**
* Creates a ResFriendCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendCard} ResFriendCard
*/
ResFriendCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendCard)
return object;
var message = new $root.tutorial.ResFriendCard();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.Name != null)
message.Name = String(object.Name);
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
if (object.Level != null)
message.Level = object.Level | 0;
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Time != null)
message.Time = object.Time | 0;
if (object.CardId != null)
message.CardId = object.CardId | 0;
if (object.ExCardId != null)
message.ExCardId = object.ExCardId | 0;
if (object.Status != null)
message.Status = object.Status | 0;
if (object.Id != null)
message.Id = String(object.Id);
return message;
};
/**
* Creates a plain object from a ResFriendCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendCard
* @static
* @param {tutorial.ResFriendCard} message ResFriendCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Uid = 0;
object.Name = "";
object.Face = 0;
object.Avatar = 0;
object.Level = 0;
object.Type = 0;
object.Time = 0;
object.CardId = 0;
object.ExCardId = 0;
object.Status = 0;
object.Id = "";
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
if (message.Level != null && message.hasOwnProperty("Level"))
object.Level = message.Level;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.Time != null && message.hasOwnProperty("Time"))
object.Time = message.Time;
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
if (message.ExCardId != null && message.hasOwnProperty("ExCardId"))
object.ExCardId = message.ExCardId;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResFriendCard to JSON.
* @function toJSON
* @memberof tutorial.ResFriendCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendCard
* @function getTypeUrl
* @memberof tutorial.ResFriendCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendCard";
};
return ResFriendCard;
})();
tutorial.ReqKv = (function() {
/**
* Properties of a ReqKv.
* @memberof tutorial
* @interface IReqKv
* @property {number|null} [key] ReqKv key
* @property {string|null} [value] ReqKv value
*/
/**
* Constructs a new ReqKv.
* @memberof tutorial
* @classdesc Represents a ReqKv.
* @implements IReqKv
* @constructor
* @param {tutorial.IReqKv=} [properties] Properties to set
*/
function ReqKv(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]];
}
/**
* ReqKv key.
* @member {number} key
* @memberof tutorial.ReqKv
* @instance
*/
ReqKv.prototype.key = 0;
/**
* ReqKv value.
* @member {string} value
* @memberof tutorial.ReqKv
* @instance
*/
ReqKv.prototype.value = "";
/**
* Creates a new ReqKv instance using the specified properties.
* @function create
* @memberof tutorial.ReqKv
* @static
* @param {tutorial.IReqKv=} [properties] Properties to set
* @returns {tutorial.ReqKv} ReqKv instance
*/
ReqKv.create = function create(properties) {
return new ReqKv(properties);
};
/**
* Encodes the specified ReqKv message. Does not implicitly {@link tutorial.ReqKv.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqKv
* @static
* @param {tutorial.IReqKv} message ReqKv message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqKv.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.key != null && Object.hasOwnProperty.call(message, "key"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.key);
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.value);
return writer;
};
/**
* Encodes the specified ReqKv message, length delimited. Does not implicitly {@link tutorial.ReqKv.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqKv
* @static
* @param {tutorial.IReqKv} message ReqKv message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqKv.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqKv message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqKv
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqKv} ReqKv
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqKv.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.ReqKv();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.key = reader.int32();
break;
}
case 2: {
message.value = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqKv message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqKv
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqKv} ReqKv
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqKv.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqKv message.
* @function verify
* @memberof tutorial.ReqKv
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqKv.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.key != null && message.hasOwnProperty("key"))
if (!$util.isInteger(message.key))
return "key: integer expected";
if (message.value != null && message.hasOwnProperty("value"))
if (!$util.isString(message.value))
return "value: string expected";
return null;
};
/**
* Creates a ReqKv message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqKv
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqKv} ReqKv
*/
ReqKv.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqKv)
return object;
var message = new $root.tutorial.ReqKv();
if (object.key != null)
message.key = object.key | 0;
if (object.value != null)
message.value = String(object.value);
return message;
};
/**
* Creates a plain object from a ReqKv message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqKv
* @static
* @param {tutorial.ReqKv} message ReqKv
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqKv.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.key = 0;
object.value = "";
}
if (message.key != null && message.hasOwnProperty("key"))
object.key = message.key;
if (message.value != null && message.hasOwnProperty("value"))
object.value = message.value;
return object;
};
/**
* Converts this ReqKv to JSON.
* @function toJSON
* @memberof tutorial.ReqKv
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqKv.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqKv
* @function getTypeUrl
* @memberof tutorial.ReqKv
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqKv.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqKv";
};
return ReqKv;
})();
tutorial.ResKv = (function() {
/**
* Properties of a ResKv.
* @memberof tutorial
* @interface IResKv
* @property {Object.<string,string>|null} [kv] ResKv kv
*/
/**
* Constructs a new ResKv.
* @memberof tutorial
* @classdesc Represents a ResKv.
* @implements IResKv
* @constructor
* @param {tutorial.IResKv=} [properties] Properties to set
*/
function ResKv(properties) {
this.kv = {};
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]];
}
/**
* ResKv kv.
* @member {Object.<string,string>} kv
* @memberof tutorial.ResKv
* @instance
*/
ResKv.prototype.kv = $util.emptyObject;
/**
* Creates a new ResKv instance using the specified properties.
* @function create
* @memberof tutorial.ResKv
* @static
* @param {tutorial.IResKv=} [properties] Properties to set
* @returns {tutorial.ResKv} ResKv instance
*/
ResKv.create = function create(properties) {
return new ResKv(properties);
};
/**
* Encodes the specified ResKv message. Does not implicitly {@link tutorial.ResKv.verify|verify} messages.
* @function encode
* @memberof tutorial.ResKv
* @static
* @param {tutorial.IResKv} message ResKv message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResKv.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.kv != null && Object.hasOwnProperty.call(message, "kv"))
for (var keys = Object.keys(message.kv), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.kv[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ResKv message, length delimited. Does not implicitly {@link tutorial.ResKv.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResKv
* @static
* @param {tutorial.IResKv} message ResKv message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResKv.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResKv message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResKv
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResKv} ResKv
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResKv.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.ResKv(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.kv === $util.emptyObject)
message.kv = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.kv[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResKv message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResKv
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResKv} ResKv
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResKv.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResKv message.
* @function verify
* @memberof tutorial.ResKv
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResKv.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.kv != null && message.hasOwnProperty("kv")) {
if (!$util.isObject(message.kv))
return "kv: object expected";
var key = Object.keys(message.kv);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "kv: integer key{k:int32} expected";
if (!$util.isString(message.kv[key[i]]))
return "kv: string{k:int32} expected";
}
}
return null;
};
/**
* Creates a ResKv message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResKv
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResKv} ResKv
*/
ResKv.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResKv)
return object;
var message = new $root.tutorial.ResKv();
if (object.kv) {
if (typeof object.kv !== "object")
throw TypeError(".tutorial.ResKv.kv: object expected");
message.kv = {};
for (var keys = Object.keys(object.kv), i = 0; i < keys.length; ++i)
message.kv[keys[i]] = String(object.kv[keys[i]]);
}
return message;
};
/**
* Creates a plain object from a ResKv message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResKv
* @static
* @param {tutorial.ResKv} message ResKv
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResKv.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.kv = {};
var keys2;
if (message.kv && (keys2 = Object.keys(message.kv)).length) {
object.kv = {};
for (var j = 0; j < keys2.length; ++j)
object.kv[keys2[j]] = message.kv[keys2[j]];
}
return object;
};
/**
* Converts this ResKv to JSON.
* @function toJSON
* @memberof tutorial.ResKv
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResKv.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResKv
* @function getTypeUrl
* @memberof tutorial.ResKv
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResKv.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResKv";
};
return ResKv;
})();
tutorial.ReqFriendRecommend = (function() {
/**
* Properties of a ReqFriendRecommend.
* @memberof tutorial
* @interface IReqFriendRecommend
*/
/**
* Constructs a new ReqFriendRecommend.
* @memberof tutorial
* @classdesc Represents a ReqFriendRecommend.
* @implements IReqFriendRecommend
* @constructor
* @param {tutorial.IReqFriendRecommend=} [properties] Properties to set
*/
function ReqFriendRecommend(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]];
}
/**
* Creates a new ReqFriendRecommend instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {tutorial.IReqFriendRecommend=} [properties] Properties to set
* @returns {tutorial.ReqFriendRecommend} ReqFriendRecommend instance
*/
ReqFriendRecommend.create = function create(properties) {
return new ReqFriendRecommend(properties);
};
/**
* Encodes the specified ReqFriendRecommend message. Does not implicitly {@link tutorial.ReqFriendRecommend.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {tutorial.IReqFriendRecommend} message ReqFriendRecommend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendRecommend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFriendRecommend message, length delimited. Does not implicitly {@link tutorial.ReqFriendRecommend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {tutorial.IReqFriendRecommend} message ReqFriendRecommend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendRecommend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendRecommend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendRecommend} ReqFriendRecommend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendRecommend.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.ReqFriendRecommend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendRecommend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendRecommend} ReqFriendRecommend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendRecommend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendRecommend message.
* @function verify
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendRecommend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFriendRecommend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendRecommend} ReqFriendRecommend
*/
ReqFriendRecommend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendRecommend)
return object;
return new $root.tutorial.ReqFriendRecommend();
};
/**
* Creates a plain object from a ReqFriendRecommend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {tutorial.ReqFriendRecommend} message ReqFriendRecommend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendRecommend.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFriendRecommend to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendRecommend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendRecommend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendRecommend
* @function getTypeUrl
* @memberof tutorial.ReqFriendRecommend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendRecommend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendRecommend";
};
return ReqFriendRecommend;
})();
tutorial.ResFriendRecommend = (function() {
/**
* Properties of a ResFriendRecommend.
* @memberof tutorial
* @interface IResFriendRecommend
* @property {Array.<tutorial.IResPlayerSimple>|null} [List] ResFriendRecommend List
*/
/**
* Constructs a new ResFriendRecommend.
* @memberof tutorial
* @classdesc Represents a ResFriendRecommend.
* @implements IResFriendRecommend
* @constructor
* @param {tutorial.IResFriendRecommend=} [properties] Properties to set
*/
function ResFriendRecommend(properties) {
this.List = [];
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]];
}
/**
* ResFriendRecommend List.
* @member {Array.<tutorial.IResPlayerSimple>} List
* @memberof tutorial.ResFriendRecommend
* @instance
*/
ResFriendRecommend.prototype.List = $util.emptyArray;
/**
* Creates a new ResFriendRecommend instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendRecommend
* @static
* @param {tutorial.IResFriendRecommend=} [properties] Properties to set
* @returns {tutorial.ResFriendRecommend} ResFriendRecommend instance
*/
ResFriendRecommend.create = function create(properties) {
return new ResFriendRecommend(properties);
};
/**
* Encodes the specified ResFriendRecommend message. Does not implicitly {@link tutorial.ResFriendRecommend.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendRecommend
* @static
* @param {tutorial.IResFriendRecommend} message ResFriendRecommend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendRecommend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.List != null && message.List.length)
for (var i = 0; i < message.List.length; ++i)
$root.tutorial.ResPlayerSimple.encode(message.List[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResFriendRecommend message, length delimited. Does not implicitly {@link tutorial.ResFriendRecommend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendRecommend
* @static
* @param {tutorial.IResFriendRecommend} message ResFriendRecommend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendRecommend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendRecommend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendRecommend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendRecommend} ResFriendRecommend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendRecommend.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.ResFriendRecommend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.List && message.List.length))
message.List = [];
message.List.push($root.tutorial.ResPlayerSimple.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendRecommend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendRecommend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendRecommend} ResFriendRecommend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendRecommend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendRecommend message.
* @function verify
* @memberof tutorial.ResFriendRecommend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendRecommend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.List != null && message.hasOwnProperty("List")) {
if (!Array.isArray(message.List))
return "List: array expected";
for (var i = 0; i < message.List.length; ++i) {
var error = $root.tutorial.ResPlayerSimple.verify(message.List[i]);
if (error)
return "List." + error;
}
}
return null;
};
/**
* Creates a ResFriendRecommend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendRecommend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendRecommend} ResFriendRecommend
*/
ResFriendRecommend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendRecommend)
return object;
var message = new $root.tutorial.ResFriendRecommend();
if (object.List) {
if (!Array.isArray(object.List))
throw TypeError(".tutorial.ResFriendRecommend.List: array expected");
message.List = [];
for (var i = 0; i < object.List.length; ++i) {
if (typeof object.List[i] !== "object")
throw TypeError(".tutorial.ResFriendRecommend.List: object expected");
message.List[i] = $root.tutorial.ResPlayerSimple.fromObject(object.List[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResFriendRecommend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendRecommend
* @static
* @param {tutorial.ResFriendRecommend} message ResFriendRecommend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendRecommend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.List = [];
if (message.List && message.List.length) {
object.List = [];
for (var j = 0; j < message.List.length; ++j)
object.List[j] = $root.tutorial.ResPlayerSimple.toObject(message.List[j], options);
}
return object;
};
/**
* Converts this ResFriendRecommend to JSON.
* @function toJSON
* @memberof tutorial.ResFriendRecommend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendRecommend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendRecommend
* @function getTypeUrl
* @memberof tutorial.ResFriendRecommend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendRecommend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendRecommend";
};
return ResFriendRecommend;
})();
tutorial.ReqFriendIgnore = (function() {
/**
* Properties of a ReqFriendIgnore.
* @memberof tutorial
* @interface IReqFriendIgnore
* @property {number|null} [Uid] ReqFriendIgnore Uid
*/
/**
* Constructs a new ReqFriendIgnore.
* @memberof tutorial
* @classdesc Represents a ReqFriendIgnore.
* @implements IReqFriendIgnore
* @constructor
* @param {tutorial.IReqFriendIgnore=} [properties] Properties to set
*/
function ReqFriendIgnore(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]];
}
/**
* ReqFriendIgnore Uid.
* @member {number} Uid
* @memberof tutorial.ReqFriendIgnore
* @instance
*/
ReqFriendIgnore.prototype.Uid = 0;
/**
* Creates a new ReqFriendIgnore instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {tutorial.IReqFriendIgnore=} [properties] Properties to set
* @returns {tutorial.ReqFriendIgnore} ReqFriendIgnore instance
*/
ReqFriendIgnore.create = function create(properties) {
return new ReqFriendIgnore(properties);
};
/**
* Encodes the specified ReqFriendIgnore message. Does not implicitly {@link tutorial.ReqFriendIgnore.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {tutorial.IReqFriendIgnore} message ReqFriendIgnore message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendIgnore.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ReqFriendIgnore message, length delimited. Does not implicitly {@link tutorial.ReqFriendIgnore.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {tutorial.IReqFriendIgnore} message ReqFriendIgnore message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendIgnore.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendIgnore message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendIgnore} ReqFriendIgnore
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendIgnore.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.ReqFriendIgnore();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendIgnore message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendIgnore} ReqFriendIgnore
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendIgnore.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendIgnore message.
* @function verify
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendIgnore.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ReqFriendIgnore message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendIgnore} ReqFriendIgnore
*/
ReqFriendIgnore.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendIgnore)
return object;
var message = new $root.tutorial.ReqFriendIgnore();
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ReqFriendIgnore message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {tutorial.ReqFriendIgnore} message ReqFriendIgnore
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendIgnore.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Uid = 0;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ReqFriendIgnore to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendIgnore
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendIgnore.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendIgnore
* @function getTypeUrl
* @memberof tutorial.ReqFriendIgnore
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendIgnore.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendIgnore";
};
return ReqFriendIgnore;
})();
tutorial.ResFriendIgnore = (function() {
/**
* Properties of a ResFriendIgnore.
* @memberof tutorial
* @interface IResFriendIgnore
* @property {tutorial.RES_CODE|null} [Code] ResFriendIgnore Code
* @property {string|null} [Msg] ResFriendIgnore Msg
*/
/**
* Constructs a new ResFriendIgnore.
* @memberof tutorial
* @classdesc Represents a ResFriendIgnore.
* @implements IResFriendIgnore
* @constructor
* @param {tutorial.IResFriendIgnore=} [properties] Properties to set
*/
function ResFriendIgnore(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]];
}
/**
* ResFriendIgnore Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResFriendIgnore
* @instance
*/
ResFriendIgnore.prototype.Code = 0;
/**
* ResFriendIgnore Msg.
* @member {string} Msg
* @memberof tutorial.ResFriendIgnore
* @instance
*/
ResFriendIgnore.prototype.Msg = "";
/**
* Creates a new ResFriendIgnore instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendIgnore
* @static
* @param {tutorial.IResFriendIgnore=} [properties] Properties to set
* @returns {tutorial.ResFriendIgnore} ResFriendIgnore instance
*/
ResFriendIgnore.create = function create(properties) {
return new ResFriendIgnore(properties);
};
/**
* Encodes the specified ResFriendIgnore message. Does not implicitly {@link tutorial.ResFriendIgnore.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendIgnore
* @static
* @param {tutorial.IResFriendIgnore} message ResFriendIgnore message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendIgnore.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResFriendIgnore message, length delimited. Does not implicitly {@link tutorial.ResFriendIgnore.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendIgnore
* @static
* @param {tutorial.IResFriendIgnore} message ResFriendIgnore message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendIgnore.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendIgnore message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendIgnore
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendIgnore} ResFriendIgnore
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendIgnore.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.ResFriendIgnore();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendIgnore message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendIgnore
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendIgnore} ResFriendIgnore
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendIgnore.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendIgnore message.
* @function verify
* @memberof tutorial.ResFriendIgnore
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendIgnore.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResFriendIgnore message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendIgnore
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendIgnore} ResFriendIgnore
*/
ResFriendIgnore.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendIgnore)
return object;
var message = new $root.tutorial.ResFriendIgnore();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResFriendIgnore message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendIgnore
* @static
* @param {tutorial.ResFriendIgnore} message ResFriendIgnore
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendIgnore.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResFriendIgnore to JSON.
* @function toJSON
* @memberof tutorial.ResFriendIgnore
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendIgnore.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendIgnore
* @function getTypeUrl
* @memberof tutorial.ResFriendIgnore
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendIgnore.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendIgnore";
};
return ResFriendIgnore;
})();
tutorial.ReqFriendList = (function() {
/**
* Properties of a ReqFriendList.
* @memberof tutorial
* @interface IReqFriendList
*/
/**
* Constructs a new ReqFriendList.
* @memberof tutorial
* @classdesc Represents a ReqFriendList.
* @implements IReqFriendList
* @constructor
* @param {tutorial.IReqFriendList=} [properties] Properties to set
*/
function ReqFriendList(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]];
}
/**
* Creates a new ReqFriendList instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendList
* @static
* @param {tutorial.IReqFriendList=} [properties] Properties to set
* @returns {tutorial.ReqFriendList} ReqFriendList instance
*/
ReqFriendList.create = function create(properties) {
return new ReqFriendList(properties);
};
/**
* Encodes the specified ReqFriendList message. Does not implicitly {@link tutorial.ReqFriendList.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendList
* @static
* @param {tutorial.IReqFriendList} message ReqFriendList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendList.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFriendList message, length delimited. Does not implicitly {@link tutorial.ReqFriendList.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendList
* @static
* @param {tutorial.IReqFriendList} message ReqFriendList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendList.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendList message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendList} ReqFriendList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendList.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.ReqFriendList();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendList message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendList} ReqFriendList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendList.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendList message.
* @function verify
* @memberof tutorial.ReqFriendList
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendList.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFriendList message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendList
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendList} ReqFriendList
*/
ReqFriendList.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendList)
return object;
return new $root.tutorial.ReqFriendList();
};
/**
* Creates a plain object from a ReqFriendList message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendList
* @static
* @param {tutorial.ReqFriendList} message ReqFriendList
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendList.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFriendList to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendList
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendList.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendList
* @function getTypeUrl
* @memberof tutorial.ReqFriendList
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendList";
};
return ReqFriendList;
})();
tutorial.ResFriendList = (function() {
/**
* Properties of a ResFriendList.
* @memberof tutorial
* @interface IResFriendList
* @property {Array.<tutorial.IResPlayerSimple>|null} [FriendList] ResFriendList FriendList
*/
/**
* Constructs a new ResFriendList.
* @memberof tutorial
* @classdesc Represents a ResFriendList.
* @implements IResFriendList
* @constructor
* @param {tutorial.IResFriendList=} [properties] Properties to set
*/
function ResFriendList(properties) {
this.FriendList = [];
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]];
}
/**
* ResFriendList FriendList.
* @member {Array.<tutorial.IResPlayerSimple>} FriendList
* @memberof tutorial.ResFriendList
* @instance
*/
ResFriendList.prototype.FriendList = $util.emptyArray;
/**
* Creates a new ResFriendList instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendList
* @static
* @param {tutorial.IResFriendList=} [properties] Properties to set
* @returns {tutorial.ResFriendList} ResFriendList instance
*/
ResFriendList.create = function create(properties) {
return new ResFriendList(properties);
};
/**
* Encodes the specified ResFriendList message. Does not implicitly {@link tutorial.ResFriendList.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendList
* @static
* @param {tutorial.IResFriendList} message ResFriendList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendList.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.FriendList != null && message.FriendList.length)
for (var i = 0; i < message.FriendList.length; ++i)
$root.tutorial.ResPlayerSimple.encode(message.FriendList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResFriendList message, length delimited. Does not implicitly {@link tutorial.ResFriendList.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendList
* @static
* @param {tutorial.IResFriendList} message ResFriendList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendList.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendList message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendList} ResFriendList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendList.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.ResFriendList();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.FriendList && message.FriendList.length))
message.FriendList = [];
message.FriendList.push($root.tutorial.ResPlayerSimple.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendList message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendList} ResFriendList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendList.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendList message.
* @function verify
* @memberof tutorial.ResFriendList
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendList.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.FriendList != null && message.hasOwnProperty("FriendList")) {
if (!Array.isArray(message.FriendList))
return "FriendList: array expected";
for (var i = 0; i < message.FriendList.length; ++i) {
var error = $root.tutorial.ResPlayerSimple.verify(message.FriendList[i]);
if (error)
return "FriendList." + error;
}
}
return null;
};
/**
* Creates a ResFriendList message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendList
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendList} ResFriendList
*/
ResFriendList.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendList)
return object;
var message = new $root.tutorial.ResFriendList();
if (object.FriendList) {
if (!Array.isArray(object.FriendList))
throw TypeError(".tutorial.ResFriendList.FriendList: array expected");
message.FriendList = [];
for (var i = 0; i < object.FriendList.length; ++i) {
if (typeof object.FriendList[i] !== "object")
throw TypeError(".tutorial.ResFriendList.FriendList: object expected");
message.FriendList[i] = $root.tutorial.ResPlayerSimple.fromObject(object.FriendList[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResFriendList message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendList
* @static
* @param {tutorial.ResFriendList} message ResFriendList
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendList.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.FriendList = [];
if (message.FriendList && message.FriendList.length) {
object.FriendList = [];
for (var j = 0; j < message.FriendList.length; ++j)
object.FriendList[j] = $root.tutorial.ResPlayerSimple.toObject(message.FriendList[j], options);
}
return object;
};
/**
* Converts this ResFriendList to JSON.
* @function toJSON
* @memberof tutorial.ResFriendList
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendList.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendList
* @function getTypeUrl
* @memberof tutorial.ResFriendList
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendList";
};
return ResFriendList;
})();
tutorial.ReqFriendApply = (function() {
/**
* Properties of a ReqFriendApply.
* @memberof tutorial
* @interface IReqFriendApply
*/
/**
* Constructs a new ReqFriendApply.
* @memberof tutorial
* @classdesc Represents a ReqFriendApply.
* @implements IReqFriendApply
* @constructor
* @param {tutorial.IReqFriendApply=} [properties] Properties to set
*/
function ReqFriendApply(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]];
}
/**
* Creates a new ReqFriendApply instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendApply
* @static
* @param {tutorial.IReqFriendApply=} [properties] Properties to set
* @returns {tutorial.ReqFriendApply} ReqFriendApply instance
*/
ReqFriendApply.create = function create(properties) {
return new ReqFriendApply(properties);
};
/**
* Encodes the specified ReqFriendApply message. Does not implicitly {@link tutorial.ReqFriendApply.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendApply
* @static
* @param {tutorial.IReqFriendApply} message ReqFriendApply message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendApply.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFriendApply message, length delimited. Does not implicitly {@link tutorial.ReqFriendApply.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendApply
* @static
* @param {tutorial.IReqFriendApply} message ReqFriendApply message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendApply.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendApply message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendApply
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendApply} ReqFriendApply
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendApply.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.ReqFriendApply();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendApply message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendApply
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendApply} ReqFriendApply
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendApply.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendApply message.
* @function verify
* @memberof tutorial.ReqFriendApply
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendApply.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFriendApply message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendApply
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendApply} ReqFriendApply
*/
ReqFriendApply.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendApply)
return object;
return new $root.tutorial.ReqFriendApply();
};
/**
* Creates a plain object from a ReqFriendApply message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendApply
* @static
* @param {tutorial.ReqFriendApply} message ReqFriendApply
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendApply.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFriendApply to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendApply
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendApply.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendApply
* @function getTypeUrl
* @memberof tutorial.ReqFriendApply
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendApply.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendApply";
};
return ReqFriendApply;
})();
tutorial.ResFriendApply = (function() {
/**
* Properties of a ResFriendApply.
* @memberof tutorial
* @interface IResFriendApply
* @property {Array.<tutorial.IResFriendApplyInfo>|null} [ApplyList] ResFriendApply ApplyList
*/
/**
* Constructs a new ResFriendApply.
* @memberof tutorial
* @classdesc Represents a ResFriendApply.
* @implements IResFriendApply
* @constructor
* @param {tutorial.IResFriendApply=} [properties] Properties to set
*/
function ResFriendApply(properties) {
this.ApplyList = [];
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]];
}
/**
* ResFriendApply ApplyList.
* @member {Array.<tutorial.IResFriendApplyInfo>} ApplyList
* @memberof tutorial.ResFriendApply
* @instance
*/
ResFriendApply.prototype.ApplyList = $util.emptyArray;
/**
* Creates a new ResFriendApply instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendApply
* @static
* @param {tutorial.IResFriendApply=} [properties] Properties to set
* @returns {tutorial.ResFriendApply} ResFriendApply instance
*/
ResFriendApply.create = function create(properties) {
return new ResFriendApply(properties);
};
/**
* Encodes the specified ResFriendApply message. Does not implicitly {@link tutorial.ResFriendApply.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendApply
* @static
* @param {tutorial.IResFriendApply} message ResFriendApply message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendApply.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ApplyList != null && message.ApplyList.length)
for (var i = 0; i < message.ApplyList.length; ++i)
$root.tutorial.ResFriendApplyInfo.encode(message.ApplyList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResFriendApply message, length delimited. Does not implicitly {@link tutorial.ResFriendApply.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendApply
* @static
* @param {tutorial.IResFriendApply} message ResFriendApply message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendApply.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendApply message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendApply
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendApply} ResFriendApply
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendApply.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.ResFriendApply();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.ApplyList && message.ApplyList.length))
message.ApplyList = [];
message.ApplyList.push($root.tutorial.ResFriendApplyInfo.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendApply message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendApply
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendApply} ResFriendApply
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendApply.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendApply message.
* @function verify
* @memberof tutorial.ResFriendApply
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendApply.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ApplyList != null && message.hasOwnProperty("ApplyList")) {
if (!Array.isArray(message.ApplyList))
return "ApplyList: array expected";
for (var i = 0; i < message.ApplyList.length; ++i) {
var error = $root.tutorial.ResFriendApplyInfo.verify(message.ApplyList[i]);
if (error)
return "ApplyList." + error;
}
}
return null;
};
/**
* Creates a ResFriendApply message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendApply
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendApply} ResFriendApply
*/
ResFriendApply.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendApply)
return object;
var message = new $root.tutorial.ResFriendApply();
if (object.ApplyList) {
if (!Array.isArray(object.ApplyList))
throw TypeError(".tutorial.ResFriendApply.ApplyList: array expected");
message.ApplyList = [];
for (var i = 0; i < object.ApplyList.length; ++i) {
if (typeof object.ApplyList[i] !== "object")
throw TypeError(".tutorial.ResFriendApply.ApplyList: object expected");
message.ApplyList[i] = $root.tutorial.ResFriendApplyInfo.fromObject(object.ApplyList[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResFriendApply message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendApply
* @static
* @param {tutorial.ResFriendApply} message ResFriendApply
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendApply.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.ApplyList = [];
if (message.ApplyList && message.ApplyList.length) {
object.ApplyList = [];
for (var j = 0; j < message.ApplyList.length; ++j)
object.ApplyList[j] = $root.tutorial.ResFriendApplyInfo.toObject(message.ApplyList[j], options);
}
return object;
};
/**
* Converts this ResFriendApply to JSON.
* @function toJSON
* @memberof tutorial.ResFriendApply
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendApply.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendApply
* @function getTypeUrl
* @memberof tutorial.ResFriendApply
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendApply.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendApply";
};
return ResFriendApply;
})();
tutorial.ResFriendApplyInfo = (function() {
/**
* Properties of a ResFriendApplyInfo.
* @memberof tutorial
* @interface IResFriendApplyInfo
* @property {tutorial.IResPlayerSimple|null} [Player] ResFriendApplyInfo Player
* @property {number|null} [Time] ResFriendApplyInfo Time
*/
/**
* Constructs a new ResFriendApplyInfo.
* @memberof tutorial
* @classdesc Represents a ResFriendApplyInfo.
* @implements IResFriendApplyInfo
* @constructor
* @param {tutorial.IResFriendApplyInfo=} [properties] Properties to set
*/
function ResFriendApplyInfo(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]];
}
/**
* ResFriendApplyInfo Player.
* @member {tutorial.IResPlayerSimple|null|undefined} Player
* @memberof tutorial.ResFriendApplyInfo
* @instance
*/
ResFriendApplyInfo.prototype.Player = null;
/**
* ResFriendApplyInfo Time.
* @member {number} Time
* @memberof tutorial.ResFriendApplyInfo
* @instance
*/
ResFriendApplyInfo.prototype.Time = 0;
/**
* Creates a new ResFriendApplyInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {tutorial.IResFriendApplyInfo=} [properties] Properties to set
* @returns {tutorial.ResFriendApplyInfo} ResFriendApplyInfo instance
*/
ResFriendApplyInfo.create = function create(properties) {
return new ResFriendApplyInfo(properties);
};
/**
* Encodes the specified ResFriendApplyInfo message. Does not implicitly {@link tutorial.ResFriendApplyInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {tutorial.IResFriendApplyInfo} message ResFriendApplyInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendApplyInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Player != null && Object.hasOwnProperty.call(message, "Player"))
$root.tutorial.ResPlayerSimple.encode(message.Player, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.Time != null && Object.hasOwnProperty.call(message, "Time"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Time);
return writer;
};
/**
* Encodes the specified ResFriendApplyInfo message, length delimited. Does not implicitly {@link tutorial.ResFriendApplyInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {tutorial.IResFriendApplyInfo} message ResFriendApplyInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendApplyInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendApplyInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendApplyInfo} ResFriendApplyInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendApplyInfo.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.ResFriendApplyInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Player = $root.tutorial.ResPlayerSimple.decode(reader, reader.uint32());
break;
}
case 2: {
message.Time = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendApplyInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendApplyInfo} ResFriendApplyInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendApplyInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendApplyInfo message.
* @function verify
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendApplyInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Player != null && message.hasOwnProperty("Player")) {
var error = $root.tutorial.ResPlayerSimple.verify(message.Player);
if (error)
return "Player." + error;
}
if (message.Time != null && message.hasOwnProperty("Time"))
if (!$util.isInteger(message.Time))
return "Time: integer expected";
return null;
};
/**
* Creates a ResFriendApplyInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendApplyInfo} ResFriendApplyInfo
*/
ResFriendApplyInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendApplyInfo)
return object;
var message = new $root.tutorial.ResFriendApplyInfo();
if (object.Player != null) {
if (typeof object.Player !== "object")
throw TypeError(".tutorial.ResFriendApplyInfo.Player: object expected");
message.Player = $root.tutorial.ResPlayerSimple.fromObject(object.Player);
}
if (object.Time != null)
message.Time = object.Time | 0;
return message;
};
/**
* Creates a plain object from a ResFriendApplyInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {tutorial.ResFriendApplyInfo} message ResFriendApplyInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendApplyInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Player = null;
object.Time = 0;
}
if (message.Player != null && message.hasOwnProperty("Player"))
object.Player = $root.tutorial.ResPlayerSimple.toObject(message.Player, options);
if (message.Time != null && message.hasOwnProperty("Time"))
object.Time = message.Time;
return object;
};
/**
* Converts this ResFriendApplyInfo to JSON.
* @function toJSON
* @memberof tutorial.ResFriendApplyInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendApplyInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendApplyInfo
* @function getTypeUrl
* @memberof tutorial.ResFriendApplyInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendApplyInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendApplyInfo";
};
return ResFriendApplyInfo;
})();
tutorial.ReqFriendCardMsg = (function() {
/**
* Properties of a ReqFriendCardMsg.
* @memberof tutorial
* @interface IReqFriendCardMsg
*/
/**
* Constructs a new ReqFriendCardMsg.
* @memberof tutorial
* @classdesc Represents a ReqFriendCardMsg.
* @implements IReqFriendCardMsg
* @constructor
* @param {tutorial.IReqFriendCardMsg=} [properties] Properties to set
*/
function ReqFriendCardMsg(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]];
}
/**
* Creates a new ReqFriendCardMsg instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {tutorial.IReqFriendCardMsg=} [properties] Properties to set
* @returns {tutorial.ReqFriendCardMsg} ReqFriendCardMsg instance
*/
ReqFriendCardMsg.create = function create(properties) {
return new ReqFriendCardMsg(properties);
};
/**
* Encodes the specified ReqFriendCardMsg message. Does not implicitly {@link tutorial.ReqFriendCardMsg.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {tutorial.IReqFriendCardMsg} message ReqFriendCardMsg message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendCardMsg.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFriendCardMsg message, length delimited. Does not implicitly {@link tutorial.ReqFriendCardMsg.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {tutorial.IReqFriendCardMsg} message ReqFriendCardMsg message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendCardMsg.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendCardMsg message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendCardMsg} ReqFriendCardMsg
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendCardMsg.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.ReqFriendCardMsg();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendCardMsg message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendCardMsg} ReqFriendCardMsg
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendCardMsg.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendCardMsg message.
* @function verify
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendCardMsg.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFriendCardMsg message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendCardMsg} ReqFriendCardMsg
*/
ReqFriendCardMsg.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendCardMsg)
return object;
return new $root.tutorial.ReqFriendCardMsg();
};
/**
* Creates a plain object from a ReqFriendCardMsg message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {tutorial.ReqFriendCardMsg} message ReqFriendCardMsg
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendCardMsg.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFriendCardMsg to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendCardMsg
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendCardMsg.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendCardMsg
* @function getTypeUrl
* @memberof tutorial.ReqFriendCardMsg
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendCardMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendCardMsg";
};
return ReqFriendCardMsg;
})();
tutorial.ResFriendCardMsg = (function() {
/**
* Properties of a ResFriendCardMsg.
* @memberof tutorial
* @interface IResFriendCardMsg
* @property {Array.<tutorial.IResFriendCard>|null} [MsgList] ResFriendCardMsg MsgList
*/
/**
* Constructs a new ResFriendCardMsg.
* @memberof tutorial
* @classdesc Represents a ResFriendCardMsg.
* @implements IResFriendCardMsg
* @constructor
* @param {tutorial.IResFriendCardMsg=} [properties] Properties to set
*/
function ResFriendCardMsg(properties) {
this.MsgList = [];
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]];
}
/**
* ResFriendCardMsg MsgList.
* @member {Array.<tutorial.IResFriendCard>} MsgList
* @memberof tutorial.ResFriendCardMsg
* @instance
*/
ResFriendCardMsg.prototype.MsgList = $util.emptyArray;
/**
* Creates a new ResFriendCardMsg instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {tutorial.IResFriendCardMsg=} [properties] Properties to set
* @returns {tutorial.ResFriendCardMsg} ResFriendCardMsg instance
*/
ResFriendCardMsg.create = function create(properties) {
return new ResFriendCardMsg(properties);
};
/**
* Encodes the specified ResFriendCardMsg message. Does not implicitly {@link tutorial.ResFriendCardMsg.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {tutorial.IResFriendCardMsg} message ResFriendCardMsg message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendCardMsg.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.MsgList != null && message.MsgList.length)
for (var i = 0; i < message.MsgList.length; ++i)
$root.tutorial.ResFriendCard.encode(message.MsgList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResFriendCardMsg message, length delimited. Does not implicitly {@link tutorial.ResFriendCardMsg.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {tutorial.IResFriendCardMsg} message ResFriendCardMsg message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendCardMsg.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendCardMsg message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendCardMsg} ResFriendCardMsg
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendCardMsg.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.ResFriendCardMsg();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.MsgList && message.MsgList.length))
message.MsgList = [];
message.MsgList.push($root.tutorial.ResFriendCard.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendCardMsg message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendCardMsg} ResFriendCardMsg
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendCardMsg.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendCardMsg message.
* @function verify
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendCardMsg.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.MsgList != null && message.hasOwnProperty("MsgList")) {
if (!Array.isArray(message.MsgList))
return "MsgList: array expected";
for (var i = 0; i < message.MsgList.length; ++i) {
var error = $root.tutorial.ResFriendCard.verify(message.MsgList[i]);
if (error)
return "MsgList." + error;
}
}
return null;
};
/**
* Creates a ResFriendCardMsg message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendCardMsg} ResFriendCardMsg
*/
ResFriendCardMsg.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendCardMsg)
return object;
var message = new $root.tutorial.ResFriendCardMsg();
if (object.MsgList) {
if (!Array.isArray(object.MsgList))
throw TypeError(".tutorial.ResFriendCardMsg.MsgList: array expected");
message.MsgList = [];
for (var i = 0; i < object.MsgList.length; ++i) {
if (typeof object.MsgList[i] !== "object")
throw TypeError(".tutorial.ResFriendCardMsg.MsgList: object expected");
message.MsgList[i] = $root.tutorial.ResFriendCard.fromObject(object.MsgList[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResFriendCardMsg message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {tutorial.ResFriendCardMsg} message ResFriendCardMsg
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendCardMsg.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.MsgList = [];
if (message.MsgList && message.MsgList.length) {
object.MsgList = [];
for (var j = 0; j < message.MsgList.length; ++j)
object.MsgList[j] = $root.tutorial.ResFriendCard.toObject(message.MsgList[j], options);
}
return object;
};
/**
* Converts this ResFriendCardMsg to JSON.
* @function toJSON
* @memberof tutorial.ResFriendCardMsg
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendCardMsg.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendCardMsg
* @function getTypeUrl
* @memberof tutorial.ResFriendCardMsg
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendCardMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendCardMsg";
};
return ResFriendCardMsg;
})();
tutorial.ReqFriendTimeLine = (function() {
/**
* Properties of a ReqFriendTimeLine.
* @memberof tutorial
* @interface IReqFriendTimeLine
*/
/**
* Constructs a new ReqFriendTimeLine.
* @memberof tutorial
* @classdesc Represents a ReqFriendTimeLine.
* @implements IReqFriendTimeLine
* @constructor
* @param {tutorial.IReqFriendTimeLine=} [properties] Properties to set
*/
function ReqFriendTimeLine(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]];
}
/**
* Creates a new ReqFriendTimeLine instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {tutorial.IReqFriendTimeLine=} [properties] Properties to set
* @returns {tutorial.ReqFriendTimeLine} ReqFriendTimeLine instance
*/
ReqFriendTimeLine.create = function create(properties) {
return new ReqFriendTimeLine(properties);
};
/**
* Encodes the specified ReqFriendTimeLine message. Does not implicitly {@link tutorial.ReqFriendTimeLine.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {tutorial.IReqFriendTimeLine} message ReqFriendTimeLine message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendTimeLine.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFriendTimeLine message, length delimited. Does not implicitly {@link tutorial.ReqFriendTimeLine.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {tutorial.IReqFriendTimeLine} message ReqFriendTimeLine message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendTimeLine.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendTimeLine message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendTimeLine} ReqFriendTimeLine
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendTimeLine.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.ReqFriendTimeLine();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendTimeLine message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendTimeLine} ReqFriendTimeLine
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendTimeLine.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendTimeLine message.
* @function verify
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendTimeLine.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFriendTimeLine message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendTimeLine} ReqFriendTimeLine
*/
ReqFriendTimeLine.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendTimeLine)
return object;
return new $root.tutorial.ReqFriendTimeLine();
};
/**
* Creates a plain object from a ReqFriendTimeLine message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {tutorial.ReqFriendTimeLine} message ReqFriendTimeLine
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendTimeLine.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFriendTimeLine to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendTimeLine
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendTimeLine.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendTimeLine
* @function getTypeUrl
* @memberof tutorial.ReqFriendTimeLine
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendTimeLine.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendTimeLine";
};
return ReqFriendTimeLine;
})();
tutorial.ResFriendTimeLine = (function() {
/**
* Properties of a ResFriendTimeLine.
* @memberof tutorial
* @interface IResFriendTimeLine
* @property {Array.<tutorial.IResFriendLog>|null} [Log] ResFriendTimeLine Log
*/
/**
* Constructs a new ResFriendTimeLine.
* @memberof tutorial
* @classdesc Represents a ResFriendTimeLine.
* @implements IResFriendTimeLine
* @constructor
* @param {tutorial.IResFriendTimeLine=} [properties] Properties to set
*/
function ResFriendTimeLine(properties) {
this.Log = [];
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]];
}
/**
* ResFriendTimeLine Log.
* @member {Array.<tutorial.IResFriendLog>} Log
* @memberof tutorial.ResFriendTimeLine
* @instance
*/
ResFriendTimeLine.prototype.Log = $util.emptyArray;
/**
* Creates a new ResFriendTimeLine instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {tutorial.IResFriendTimeLine=} [properties] Properties to set
* @returns {tutorial.ResFriendTimeLine} ResFriendTimeLine instance
*/
ResFriendTimeLine.create = function create(properties) {
return new ResFriendTimeLine(properties);
};
/**
* Encodes the specified ResFriendTimeLine message. Does not implicitly {@link tutorial.ResFriendTimeLine.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {tutorial.IResFriendTimeLine} message ResFriendTimeLine message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTimeLine.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Log != null && message.Log.length)
for (var i = 0; i < message.Log.length; ++i)
$root.tutorial.ResFriendLog.encode(message.Log[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResFriendTimeLine message, length delimited. Does not implicitly {@link tutorial.ResFriendTimeLine.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {tutorial.IResFriendTimeLine} message ResFriendTimeLine message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTimeLine.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendTimeLine message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendTimeLine} ResFriendTimeLine
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTimeLine.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.ResFriendTimeLine();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.Log && message.Log.length))
message.Log = [];
message.Log.push($root.tutorial.ResFriendLog.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendTimeLine message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendTimeLine} ResFriendTimeLine
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTimeLine.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendTimeLine message.
* @function verify
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendTimeLine.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Log != null && message.hasOwnProperty("Log")) {
if (!Array.isArray(message.Log))
return "Log: array expected";
for (var i = 0; i < message.Log.length; ++i) {
var error = $root.tutorial.ResFriendLog.verify(message.Log[i]);
if (error)
return "Log." + error;
}
}
return null;
};
/**
* Creates a ResFriendTimeLine message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendTimeLine} ResFriendTimeLine
*/
ResFriendTimeLine.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendTimeLine)
return object;
var message = new $root.tutorial.ResFriendTimeLine();
if (object.Log) {
if (!Array.isArray(object.Log))
throw TypeError(".tutorial.ResFriendTimeLine.Log: array expected");
message.Log = [];
for (var i = 0; i < object.Log.length; ++i) {
if (typeof object.Log[i] !== "object")
throw TypeError(".tutorial.ResFriendTimeLine.Log: object expected");
message.Log[i] = $root.tutorial.ResFriendLog.fromObject(object.Log[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResFriendTimeLine message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {tutorial.ResFriendTimeLine} message ResFriendTimeLine
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendTimeLine.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Log = [];
if (message.Log && message.Log.length) {
object.Log = [];
for (var j = 0; j < message.Log.length; ++j)
object.Log[j] = $root.tutorial.ResFriendLog.toObject(message.Log[j], options);
}
return object;
};
/**
* Converts this ResFriendTimeLine to JSON.
* @function toJSON
* @memberof tutorial.ResFriendTimeLine
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendTimeLine.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendTimeLine
* @function getTypeUrl
* @memberof tutorial.ResFriendTimeLine
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendTimeLine.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendTimeLine";
};
return ResFriendTimeLine;
})();
tutorial.ResFriendApplyNotify = (function() {
/**
* Properties of a ResFriendApplyNotify.
* @memberof tutorial
* @interface IResFriendApplyNotify
* @property {tutorial.IResPlayerSimple|null} [Player] ResFriendApplyNotify Player
* @property {number|null} [Type] ResFriendApplyNotify Type
* @property {number|null} [Time] ResFriendApplyNotify Time
*/
/**
* Constructs a new ResFriendApplyNotify.
* @memberof tutorial
* @classdesc Represents a ResFriendApplyNotify.
* @implements IResFriendApplyNotify
* @constructor
* @param {tutorial.IResFriendApplyNotify=} [properties] Properties to set
*/
function ResFriendApplyNotify(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]];
}
/**
* ResFriendApplyNotify Player.
* @member {tutorial.IResPlayerSimple|null|undefined} Player
* @memberof tutorial.ResFriendApplyNotify
* @instance
*/
ResFriendApplyNotify.prototype.Player = null;
/**
* ResFriendApplyNotify Type.
* @member {number} Type
* @memberof tutorial.ResFriendApplyNotify
* @instance
*/
ResFriendApplyNotify.prototype.Type = 0;
/**
* ResFriendApplyNotify Time.
* @member {number} Time
* @memberof tutorial.ResFriendApplyNotify
* @instance
*/
ResFriendApplyNotify.prototype.Time = 0;
/**
* Creates a new ResFriendApplyNotify instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {tutorial.IResFriendApplyNotify=} [properties] Properties to set
* @returns {tutorial.ResFriendApplyNotify} ResFriendApplyNotify instance
*/
ResFriendApplyNotify.create = function create(properties) {
return new ResFriendApplyNotify(properties);
};
/**
* Encodes the specified ResFriendApplyNotify message. Does not implicitly {@link tutorial.ResFriendApplyNotify.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {tutorial.IResFriendApplyNotify} message ResFriendApplyNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendApplyNotify.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Player != null && Object.hasOwnProperty.call(message, "Player"))
$root.tutorial.ResPlayerSimple.encode(message.Player, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Type);
if (message.Time != null && Object.hasOwnProperty.call(message, "Time"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Time);
return writer;
};
/**
* Encodes the specified ResFriendApplyNotify message, length delimited. Does not implicitly {@link tutorial.ResFriendApplyNotify.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {tutorial.IResFriendApplyNotify} message ResFriendApplyNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendApplyNotify.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendApplyNotify message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendApplyNotify} ResFriendApplyNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendApplyNotify.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.ResFriendApplyNotify();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Player = $root.tutorial.ResPlayerSimple.decode(reader, reader.uint32());
break;
}
case 2: {
message.Type = reader.int32();
break;
}
case 3: {
message.Time = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendApplyNotify message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendApplyNotify} ResFriendApplyNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendApplyNotify.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendApplyNotify message.
* @function verify
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendApplyNotify.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Player != null && message.hasOwnProperty("Player")) {
var error = $root.tutorial.ResPlayerSimple.verify(message.Player);
if (error)
return "Player." + error;
}
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Time != null && message.hasOwnProperty("Time"))
if (!$util.isInteger(message.Time))
return "Time: integer expected";
return null;
};
/**
* Creates a ResFriendApplyNotify message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendApplyNotify} ResFriendApplyNotify
*/
ResFriendApplyNotify.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendApplyNotify)
return object;
var message = new $root.tutorial.ResFriendApplyNotify();
if (object.Player != null) {
if (typeof object.Player !== "object")
throw TypeError(".tutorial.ResFriendApplyNotify.Player: object expected");
message.Player = $root.tutorial.ResPlayerSimple.fromObject(object.Player);
}
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Time != null)
message.Time = object.Time | 0;
return message;
};
/**
* Creates a plain object from a ResFriendApplyNotify message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {tutorial.ResFriendApplyNotify} message ResFriendApplyNotify
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendApplyNotify.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Player = null;
object.Type = 0;
object.Time = 0;
}
if (message.Player != null && message.hasOwnProperty("Player"))
object.Player = $root.tutorial.ResPlayerSimple.toObject(message.Player, options);
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.Time != null && message.hasOwnProperty("Time"))
object.Time = message.Time;
return object;
};
/**
* Converts this ResFriendApplyNotify to JSON.
* @function toJSON
* @memberof tutorial.ResFriendApplyNotify
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendApplyNotify.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendApplyNotify
* @function getTypeUrl
* @memberof tutorial.ResFriendApplyNotify
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendApplyNotify.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendApplyNotify";
};
return ResFriendApplyNotify;
})();
tutorial.ReqApplyFriend = (function() {
/**
* Properties of a ReqApplyFriend.
* @memberof tutorial
* @interface IReqApplyFriend
* @property {number|null} [Uid] ReqApplyFriend Uid
*/
/**
* Constructs a new ReqApplyFriend.
* @memberof tutorial
* @classdesc Represents a ReqApplyFriend.
* @implements IReqApplyFriend
* @constructor
* @param {tutorial.IReqApplyFriend=} [properties] Properties to set
*/
function ReqApplyFriend(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]];
}
/**
* ReqApplyFriend Uid.
* @member {number} Uid
* @memberof tutorial.ReqApplyFriend
* @instance
*/
ReqApplyFriend.prototype.Uid = 0;
/**
* Creates a new ReqApplyFriend instance using the specified properties.
* @function create
* @memberof tutorial.ReqApplyFriend
* @static
* @param {tutorial.IReqApplyFriend=} [properties] Properties to set
* @returns {tutorial.ReqApplyFriend} ReqApplyFriend instance
*/
ReqApplyFriend.create = function create(properties) {
return new ReqApplyFriend(properties);
};
/**
* Encodes the specified ReqApplyFriend message. Does not implicitly {@link tutorial.ReqApplyFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqApplyFriend
* @static
* @param {tutorial.IReqApplyFriend} message ReqApplyFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqApplyFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ReqApplyFriend message, length delimited. Does not implicitly {@link tutorial.ReqApplyFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqApplyFriend
* @static
* @param {tutorial.IReqApplyFriend} message ReqApplyFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqApplyFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqApplyFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqApplyFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqApplyFriend} ReqApplyFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqApplyFriend.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.ReqApplyFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqApplyFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqApplyFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqApplyFriend} ReqApplyFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqApplyFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqApplyFriend message.
* @function verify
* @memberof tutorial.ReqApplyFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqApplyFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ReqApplyFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqApplyFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqApplyFriend} ReqApplyFriend
*/
ReqApplyFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqApplyFriend)
return object;
var message = new $root.tutorial.ReqApplyFriend();
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ReqApplyFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqApplyFriend
* @static
* @param {tutorial.ReqApplyFriend} message ReqApplyFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqApplyFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Uid = 0;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ReqApplyFriend to JSON.
* @function toJSON
* @memberof tutorial.ReqApplyFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqApplyFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqApplyFriend
* @function getTypeUrl
* @memberof tutorial.ReqApplyFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqApplyFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqApplyFriend";
};
return ReqApplyFriend;
})();
tutorial.ResApplyFriend = (function() {
/**
* Properties of a ResApplyFriend.
* @memberof tutorial
* @interface IResApplyFriend
* @property {tutorial.RES_CODE|null} [Code] ResApplyFriend Code
* @property {string|null} [Msg] ResApplyFriend Msg
*/
/**
* Constructs a new ResApplyFriend.
* @memberof tutorial
* @classdesc Represents a ResApplyFriend.
* @implements IResApplyFriend
* @constructor
* @param {tutorial.IResApplyFriend=} [properties] Properties to set
*/
function ResApplyFriend(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]];
}
/**
* ResApplyFriend Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResApplyFriend
* @instance
*/
ResApplyFriend.prototype.Code = 0;
/**
* ResApplyFriend Msg.
* @member {string} Msg
* @memberof tutorial.ResApplyFriend
* @instance
*/
ResApplyFriend.prototype.Msg = "";
/**
* Creates a new ResApplyFriend instance using the specified properties.
* @function create
* @memberof tutorial.ResApplyFriend
* @static
* @param {tutorial.IResApplyFriend=} [properties] Properties to set
* @returns {tutorial.ResApplyFriend} ResApplyFriend instance
*/
ResApplyFriend.create = function create(properties) {
return new ResApplyFriend(properties);
};
/**
* Encodes the specified ResApplyFriend message. Does not implicitly {@link tutorial.ResApplyFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ResApplyFriend
* @static
* @param {tutorial.IResApplyFriend} message ResApplyFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResApplyFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResApplyFriend message, length delimited. Does not implicitly {@link tutorial.ResApplyFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResApplyFriend
* @static
* @param {tutorial.IResApplyFriend} message ResApplyFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResApplyFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResApplyFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResApplyFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResApplyFriend} ResApplyFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResApplyFriend.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.ResApplyFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResApplyFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResApplyFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResApplyFriend} ResApplyFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResApplyFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResApplyFriend message.
* @function verify
* @memberof tutorial.ResApplyFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResApplyFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResApplyFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResApplyFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResApplyFriend} ResApplyFriend
*/
ResApplyFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResApplyFriend)
return object;
var message = new $root.tutorial.ResApplyFriend();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResApplyFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResApplyFriend
* @static
* @param {tutorial.ResApplyFriend} message ResApplyFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResApplyFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResApplyFriend to JSON.
* @function toJSON
* @memberof tutorial.ResApplyFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResApplyFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResApplyFriend
* @function getTypeUrl
* @memberof tutorial.ResApplyFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResApplyFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResApplyFriend";
};
return ResApplyFriend;
})();
tutorial.ReqAgreeFriend = (function() {
/**
* Properties of a ReqAgreeFriend.
* @memberof tutorial
* @interface IReqAgreeFriend
* @property {number|null} [Uid] ReqAgreeFriend Uid
*/
/**
* Constructs a new ReqAgreeFriend.
* @memberof tutorial
* @classdesc Represents a ReqAgreeFriend.
* @implements IReqAgreeFriend
* @constructor
* @param {tutorial.IReqAgreeFriend=} [properties] Properties to set
*/
function ReqAgreeFriend(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]];
}
/**
* ReqAgreeFriend Uid.
* @member {number} Uid
* @memberof tutorial.ReqAgreeFriend
* @instance
*/
ReqAgreeFriend.prototype.Uid = 0;
/**
* Creates a new ReqAgreeFriend instance using the specified properties.
* @function create
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {tutorial.IReqAgreeFriend=} [properties] Properties to set
* @returns {tutorial.ReqAgreeFriend} ReqAgreeFriend instance
*/
ReqAgreeFriend.create = function create(properties) {
return new ReqAgreeFriend(properties);
};
/**
* Encodes the specified ReqAgreeFriend message. Does not implicitly {@link tutorial.ReqAgreeFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {tutorial.IReqAgreeFriend} message ReqAgreeFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAgreeFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ReqAgreeFriend message, length delimited. Does not implicitly {@link tutorial.ReqAgreeFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {tutorial.IReqAgreeFriend} message ReqAgreeFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAgreeFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqAgreeFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqAgreeFriend} ReqAgreeFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAgreeFriend.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.ReqAgreeFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqAgreeFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqAgreeFriend} ReqAgreeFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAgreeFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqAgreeFriend message.
* @function verify
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqAgreeFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ReqAgreeFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqAgreeFriend} ReqAgreeFriend
*/
ReqAgreeFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqAgreeFriend)
return object;
var message = new $root.tutorial.ReqAgreeFriend();
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ReqAgreeFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {tutorial.ReqAgreeFriend} message ReqAgreeFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqAgreeFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Uid = 0;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ReqAgreeFriend to JSON.
* @function toJSON
* @memberof tutorial.ReqAgreeFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqAgreeFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqAgreeFriend
* @function getTypeUrl
* @memberof tutorial.ReqAgreeFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqAgreeFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqAgreeFriend";
};
return ReqAgreeFriend;
})();
tutorial.ResAgreeFriend = (function() {
/**
* Properties of a ResAgreeFriend.
* @memberof tutorial
* @interface IResAgreeFriend
* @property {tutorial.RES_CODE|null} [Code] ResAgreeFriend Code
* @property {string|null} [Msg] ResAgreeFriend Msg
* @property {number|null} [Uid] ResAgreeFriend Uid
* @property {tutorial.IResPlayerSimple|null} [Player] ResAgreeFriend Player
*/
/**
* Constructs a new ResAgreeFriend.
* @memberof tutorial
* @classdesc Represents a ResAgreeFriend.
* @implements IResAgreeFriend
* @constructor
* @param {tutorial.IResAgreeFriend=} [properties] Properties to set
*/
function ResAgreeFriend(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]];
}
/**
* ResAgreeFriend Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResAgreeFriend
* @instance
*/
ResAgreeFriend.prototype.Code = 0;
/**
* ResAgreeFriend Msg.
* @member {string} Msg
* @memberof tutorial.ResAgreeFriend
* @instance
*/
ResAgreeFriend.prototype.Msg = "";
/**
* ResAgreeFriend Uid.
* @member {number} Uid
* @memberof tutorial.ResAgreeFriend
* @instance
*/
ResAgreeFriend.prototype.Uid = 0;
/**
* ResAgreeFriend Player.
* @member {tutorial.IResPlayerSimple|null|undefined} Player
* @memberof tutorial.ResAgreeFriend
* @instance
*/
ResAgreeFriend.prototype.Player = null;
/**
* Creates a new ResAgreeFriend instance using the specified properties.
* @function create
* @memberof tutorial.ResAgreeFriend
* @static
* @param {tutorial.IResAgreeFriend=} [properties] Properties to set
* @returns {tutorial.ResAgreeFriend} ResAgreeFriend instance
*/
ResAgreeFriend.create = function create(properties) {
return new ResAgreeFriend(properties);
};
/**
* Encodes the specified ResAgreeFriend message. Does not implicitly {@link tutorial.ResAgreeFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ResAgreeFriend
* @static
* @param {tutorial.IResAgreeFriend} message ResAgreeFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAgreeFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Uid);
if (message.Player != null && Object.hasOwnProperty.call(message, "Player"))
$root.tutorial.ResPlayerSimple.encode(message.Player, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResAgreeFriend message, length delimited. Does not implicitly {@link tutorial.ResAgreeFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResAgreeFriend
* @static
* @param {tutorial.IResAgreeFriend} message ResAgreeFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAgreeFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResAgreeFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResAgreeFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResAgreeFriend} ResAgreeFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAgreeFriend.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.ResAgreeFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Uid = reader.int32();
break;
}
case 4: {
message.Player = $root.tutorial.ResPlayerSimple.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResAgreeFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResAgreeFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResAgreeFriend} ResAgreeFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAgreeFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResAgreeFriend message.
* @function verify
* @memberof tutorial.ResAgreeFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResAgreeFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.Player != null && message.hasOwnProperty("Player")) {
var error = $root.tutorial.ResPlayerSimple.verify(message.Player);
if (error)
return "Player." + error;
}
return null;
};
/**
* Creates a ResAgreeFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResAgreeFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResAgreeFriend} ResAgreeFriend
*/
ResAgreeFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResAgreeFriend)
return object;
var message = new $root.tutorial.ResAgreeFriend();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.Player != null) {
if (typeof object.Player !== "object")
throw TypeError(".tutorial.ResAgreeFriend.Player: object expected");
message.Player = $root.tutorial.ResPlayerSimple.fromObject(object.Player);
}
return message;
};
/**
* Creates a plain object from a ResAgreeFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResAgreeFriend
* @static
* @param {tutorial.ResAgreeFriend} message ResAgreeFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResAgreeFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Uid = 0;
object.Player = null;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.Player != null && message.hasOwnProperty("Player"))
object.Player = $root.tutorial.ResPlayerSimple.toObject(message.Player, options);
return object;
};
/**
* Converts this ResAgreeFriend to JSON.
* @function toJSON
* @memberof tutorial.ResAgreeFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResAgreeFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResAgreeFriend
* @function getTypeUrl
* @memberof tutorial.ResAgreeFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResAgreeFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResAgreeFriend";
};
return ResAgreeFriend;
})();
tutorial.ReqRefuseFriend = (function() {
/**
* Properties of a ReqRefuseFriend.
* @memberof tutorial
* @interface IReqRefuseFriend
* @property {number|null} [Uid] ReqRefuseFriend Uid
*/
/**
* Constructs a new ReqRefuseFriend.
* @memberof tutorial
* @classdesc Represents a ReqRefuseFriend.
* @implements IReqRefuseFriend
* @constructor
* @param {tutorial.IReqRefuseFriend=} [properties] Properties to set
*/
function ReqRefuseFriend(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]];
}
/**
* ReqRefuseFriend Uid.
* @member {number} Uid
* @memberof tutorial.ReqRefuseFriend
* @instance
*/
ReqRefuseFriend.prototype.Uid = 0;
/**
* Creates a new ReqRefuseFriend instance using the specified properties.
* @function create
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {tutorial.IReqRefuseFriend=} [properties] Properties to set
* @returns {tutorial.ReqRefuseFriend} ReqRefuseFriend instance
*/
ReqRefuseFriend.create = function create(properties) {
return new ReqRefuseFriend(properties);
};
/**
* Encodes the specified ReqRefuseFriend message. Does not implicitly {@link tutorial.ReqRefuseFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {tutorial.IReqRefuseFriend} message ReqRefuseFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefuseFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ReqRefuseFriend message, length delimited. Does not implicitly {@link tutorial.ReqRefuseFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {tutorial.IReqRefuseFriend} message ReqRefuseFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefuseFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRefuseFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRefuseFriend} ReqRefuseFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefuseFriend.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.ReqRefuseFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRefuseFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRefuseFriend} ReqRefuseFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefuseFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRefuseFriend message.
* @function verify
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRefuseFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ReqRefuseFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRefuseFriend} ReqRefuseFriend
*/
ReqRefuseFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRefuseFriend)
return object;
var message = new $root.tutorial.ReqRefuseFriend();
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ReqRefuseFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {tutorial.ReqRefuseFriend} message ReqRefuseFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRefuseFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Uid = 0;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ReqRefuseFriend to JSON.
* @function toJSON
* @memberof tutorial.ReqRefuseFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRefuseFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRefuseFriend
* @function getTypeUrl
* @memberof tutorial.ReqRefuseFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRefuseFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRefuseFriend";
};
return ReqRefuseFriend;
})();
tutorial.ResRefuseFriend = (function() {
/**
* Properties of a ResRefuseFriend.
* @memberof tutorial
* @interface IResRefuseFriend
* @property {tutorial.RES_CODE|null} [Code] ResRefuseFriend Code
* @property {string|null} [Msg] ResRefuseFriend Msg
* @property {number|null} [Uid] ResRefuseFriend Uid
*/
/**
* Constructs a new ResRefuseFriend.
* @memberof tutorial
* @classdesc Represents a ResRefuseFriend.
* @implements IResRefuseFriend
* @constructor
* @param {tutorial.IResRefuseFriend=} [properties] Properties to set
*/
function ResRefuseFriend(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]];
}
/**
* ResRefuseFriend Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResRefuseFriend
* @instance
*/
ResRefuseFriend.prototype.Code = 0;
/**
* ResRefuseFriend Msg.
* @member {string} Msg
* @memberof tutorial.ResRefuseFriend
* @instance
*/
ResRefuseFriend.prototype.Msg = "";
/**
* ResRefuseFriend Uid.
* @member {number} Uid
* @memberof tutorial.ResRefuseFriend
* @instance
*/
ResRefuseFriend.prototype.Uid = 0;
/**
* Creates a new ResRefuseFriend instance using the specified properties.
* @function create
* @memberof tutorial.ResRefuseFriend
* @static
* @param {tutorial.IResRefuseFriend=} [properties] Properties to set
* @returns {tutorial.ResRefuseFriend} ResRefuseFriend instance
*/
ResRefuseFriend.create = function create(properties) {
return new ResRefuseFriend(properties);
};
/**
* Encodes the specified ResRefuseFriend message. Does not implicitly {@link tutorial.ResRefuseFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRefuseFriend
* @static
* @param {tutorial.IResRefuseFriend} message ResRefuseFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefuseFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ResRefuseFriend message, length delimited. Does not implicitly {@link tutorial.ResRefuseFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRefuseFriend
* @static
* @param {tutorial.IResRefuseFriend} message ResRefuseFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefuseFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRefuseFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRefuseFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRefuseFriend} ResRefuseFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefuseFriend.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.ResRefuseFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRefuseFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRefuseFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRefuseFriend} ResRefuseFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefuseFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRefuseFriend message.
* @function verify
* @memberof tutorial.ResRefuseFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRefuseFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ResRefuseFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRefuseFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRefuseFriend} ResRefuseFriend
*/
ResRefuseFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRefuseFriend)
return object;
var message = new $root.tutorial.ResRefuseFriend();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ResRefuseFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRefuseFriend
* @static
* @param {tutorial.ResRefuseFriend} message ResRefuseFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRefuseFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Uid = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ResRefuseFriend to JSON.
* @function toJSON
* @memberof tutorial.ResRefuseFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRefuseFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRefuseFriend
* @function getTypeUrl
* @memberof tutorial.ResRefuseFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRefuseFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRefuseFriend";
};
return ResRefuseFriend;
})();
tutorial.ReqDelFriend = (function() {
/**
* Properties of a ReqDelFriend.
* @memberof tutorial
* @interface IReqDelFriend
* @property {number|null} [Uid] ReqDelFriend Uid
*/
/**
* Constructs a new ReqDelFriend.
* @memberof tutorial
* @classdesc Represents a ReqDelFriend.
* @implements IReqDelFriend
* @constructor
* @param {tutorial.IReqDelFriend=} [properties] Properties to set
*/
function ReqDelFriend(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]];
}
/**
* ReqDelFriend Uid.
* @member {number} Uid
* @memberof tutorial.ReqDelFriend
* @instance
*/
ReqDelFriend.prototype.Uid = 0;
/**
* Creates a new ReqDelFriend instance using the specified properties.
* @function create
* @memberof tutorial.ReqDelFriend
* @static
* @param {tutorial.IReqDelFriend=} [properties] Properties to set
* @returns {tutorial.ReqDelFriend} ReqDelFriend instance
*/
ReqDelFriend.create = function create(properties) {
return new ReqDelFriend(properties);
};
/**
* Encodes the specified ReqDelFriend message. Does not implicitly {@link tutorial.ReqDelFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqDelFriend
* @static
* @param {tutorial.IReqDelFriend} message ReqDelFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDelFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ReqDelFriend message, length delimited. Does not implicitly {@link tutorial.ReqDelFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqDelFriend
* @static
* @param {tutorial.IReqDelFriend} message ReqDelFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDelFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqDelFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqDelFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqDelFriend} ReqDelFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDelFriend.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.ReqDelFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqDelFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqDelFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqDelFriend} ReqDelFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDelFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqDelFriend message.
* @function verify
* @memberof tutorial.ReqDelFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqDelFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ReqDelFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqDelFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqDelFriend} ReqDelFriend
*/
ReqDelFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqDelFriend)
return object;
var message = new $root.tutorial.ReqDelFriend();
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ReqDelFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqDelFriend
* @static
* @param {tutorial.ReqDelFriend} message ReqDelFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqDelFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Uid = 0;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ReqDelFriend to JSON.
* @function toJSON
* @memberof tutorial.ReqDelFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqDelFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqDelFriend
* @function getTypeUrl
* @memberof tutorial.ReqDelFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqDelFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqDelFriend";
};
return ReqDelFriend;
})();
tutorial.ResDelFriend = (function() {
/**
* Properties of a ResDelFriend.
* @memberof tutorial
* @interface IResDelFriend
* @property {tutorial.RES_CODE|null} [Code] ResDelFriend Code
* @property {string|null} [Msg] ResDelFriend Msg
* @property {number|null} [Uid] ResDelFriend Uid
*/
/**
* Constructs a new ResDelFriend.
* @memberof tutorial
* @classdesc Represents a ResDelFriend.
* @implements IResDelFriend
* @constructor
* @param {tutorial.IResDelFriend=} [properties] Properties to set
*/
function ResDelFriend(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]];
}
/**
* ResDelFriend Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResDelFriend
* @instance
*/
ResDelFriend.prototype.Code = 0;
/**
* ResDelFriend Msg.
* @member {string} Msg
* @memberof tutorial.ResDelFriend
* @instance
*/
ResDelFriend.prototype.Msg = "";
/**
* ResDelFriend Uid.
* @member {number} Uid
* @memberof tutorial.ResDelFriend
* @instance
*/
ResDelFriend.prototype.Uid = 0;
/**
* Creates a new ResDelFriend instance using the specified properties.
* @function create
* @memberof tutorial.ResDelFriend
* @static
* @param {tutorial.IResDelFriend=} [properties] Properties to set
* @returns {tutorial.ResDelFriend} ResDelFriend instance
*/
ResDelFriend.create = function create(properties) {
return new ResDelFriend(properties);
};
/**
* Encodes the specified ResDelFriend message. Does not implicitly {@link tutorial.ResDelFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ResDelFriend
* @static
* @param {tutorial.IResDelFriend} message ResDelFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDelFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ResDelFriend message, length delimited. Does not implicitly {@link tutorial.ResDelFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResDelFriend
* @static
* @param {tutorial.IResDelFriend} message ResDelFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDelFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResDelFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResDelFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResDelFriend} ResDelFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDelFriend.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.ResDelFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResDelFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResDelFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResDelFriend} ResDelFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDelFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResDelFriend message.
* @function verify
* @memberof tutorial.ResDelFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResDelFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ResDelFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResDelFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResDelFriend} ResDelFriend
*/
ResDelFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResDelFriend)
return object;
var message = new $root.tutorial.ResDelFriend();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ResDelFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResDelFriend
* @static
* @param {tutorial.ResDelFriend} message ResDelFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResDelFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Uid = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ResDelFriend to JSON.
* @function toJSON
* @memberof tutorial.ResDelFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResDelFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResDelFriend
* @function getTypeUrl
* @memberof tutorial.ResDelFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResDelFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResDelFriend";
};
return ResDelFriend;
})();
tutorial.ReqRank = (function() {
/**
* Properties of a ReqRank.
* @memberof tutorial
* @interface IReqRank
* @property {number|null} [Type] ReqRank Type
*/
/**
* Constructs a new ReqRank.
* @memberof tutorial
* @classdesc Represents a ReqRank.
* @implements IReqRank
* @constructor
* @param {tutorial.IReqRank=} [properties] Properties to set
*/
function ReqRank(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]];
}
/**
* ReqRank Type.
* @member {number} Type
* @memberof tutorial.ReqRank
* @instance
*/
ReqRank.prototype.Type = 0;
/**
* Creates a new ReqRank instance using the specified properties.
* @function create
* @memberof tutorial.ReqRank
* @static
* @param {tutorial.IReqRank=} [properties] Properties to set
* @returns {tutorial.ReqRank} ReqRank instance
*/
ReqRank.create = function create(properties) {
return new ReqRank(properties);
};
/**
* Encodes the specified ReqRank message. Does not implicitly {@link tutorial.ReqRank.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRank
* @static
* @param {tutorial.IReqRank} message ReqRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRank.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Type);
return writer;
};
/**
* Encodes the specified ReqRank message, length delimited. Does not implicitly {@link tutorial.ReqRank.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRank
* @static
* @param {tutorial.IReqRank} message ReqRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRank.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRank message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRank} ReqRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRank.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.ReqRank();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Type = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRank message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRank} ReqRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRank.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRank message.
* @function verify
* @memberof tutorial.ReqRank
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRank.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
return null;
};
/**
* Creates a ReqRank message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRank
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRank} ReqRank
*/
ReqRank.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRank)
return object;
var message = new $root.tutorial.ReqRank();
if (object.Type != null)
message.Type = object.Type | 0;
return message;
};
/**
* Creates a plain object from a ReqRank message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRank
* @static
* @param {tutorial.ReqRank} message ReqRank
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRank.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Type = 0;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
return object;
};
/**
* Converts this ReqRank to JSON.
* @function toJSON
* @memberof tutorial.ReqRank
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRank.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRank
* @function getTypeUrl
* @memberof tutorial.ReqRank
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRank.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRank";
};
return ReqRank;
})();
tutorial.ResRank = (function() {
/**
* Properties of a ResRank.
* @memberof tutorial
* @interface IResRank
* @property {number|null} [Type] ResRank Type
* @property {Object.<string,tutorial.IResPlayerSimple>|null} [RankList] ResRank RankList
* @property {number|null} [MyRank] ResRank MyRank
* @property {number|null} [MyScore] ResRank MyScore
*/
/**
* Constructs a new ResRank.
* @memberof tutorial
* @classdesc Represents a ResRank.
* @implements IResRank
* @constructor
* @param {tutorial.IResRank=} [properties] Properties to set
*/
function ResRank(properties) {
this.RankList = {};
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]];
}
/**
* ResRank Type.
* @member {number} Type
* @memberof tutorial.ResRank
* @instance
*/
ResRank.prototype.Type = 0;
/**
* ResRank RankList.
* @member {Object.<string,tutorial.IResPlayerSimple>} RankList
* @memberof tutorial.ResRank
* @instance
*/
ResRank.prototype.RankList = $util.emptyObject;
/**
* ResRank MyRank.
* @member {number} MyRank
* @memberof tutorial.ResRank
* @instance
*/
ResRank.prototype.MyRank = 0;
/**
* ResRank MyScore.
* @member {number} MyScore
* @memberof tutorial.ResRank
* @instance
*/
ResRank.prototype.MyScore = 0;
/**
* Creates a new ResRank instance using the specified properties.
* @function create
* @memberof tutorial.ResRank
* @static
* @param {tutorial.IResRank=} [properties] Properties to set
* @returns {tutorial.ResRank} ResRank instance
*/
ResRank.create = function create(properties) {
return new ResRank(properties);
};
/**
* Encodes the specified ResRank message. Does not implicitly {@link tutorial.ResRank.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRank
* @static
* @param {tutorial.IResRank} message ResRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRank.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Type);
if (message.RankList != null && Object.hasOwnProperty.call(message, "RankList"))
for (var keys = Object.keys(message.RankList), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.ResPlayerSimple.encode(message.RankList[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.MyRank != null && Object.hasOwnProperty.call(message, "MyRank"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.MyRank);
if (message.MyScore != null && Object.hasOwnProperty.call(message, "MyScore"))
writer.uint32(/* id 4, wireType 5 =*/37).float(message.MyScore);
return writer;
};
/**
* Encodes the specified ResRank message, length delimited. Does not implicitly {@link tutorial.ResRank.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRank
* @static
* @param {tutorial.IResRank} message ResRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRank.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRank message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRank} ResRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRank.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.ResRank(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Type = reader.int32();
break;
}
case 2: {
if (message.RankList === $util.emptyObject)
message.RankList = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.ResPlayerSimple.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.RankList[key] = value;
break;
}
case 3: {
message.MyRank = reader.int32();
break;
}
case 4: {
message.MyScore = reader.float();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRank message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRank} ResRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRank.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRank message.
* @function verify
* @memberof tutorial.ResRank
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRank.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.RankList != null && message.hasOwnProperty("RankList")) {
if (!$util.isObject(message.RankList))
return "RankList: object expected";
var key = Object.keys(message.RankList);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "RankList: integer key{k:int32} expected";
{
var error = $root.tutorial.ResPlayerSimple.verify(message.RankList[key[i]]);
if (error)
return "RankList." + error;
}
}
}
if (message.MyRank != null && message.hasOwnProperty("MyRank"))
if (!$util.isInteger(message.MyRank))
return "MyRank: integer expected";
if (message.MyScore != null && message.hasOwnProperty("MyScore"))
if (typeof message.MyScore !== "number")
return "MyScore: number expected";
return null;
};
/**
* Creates a ResRank message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRank
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRank} ResRank
*/
ResRank.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRank)
return object;
var message = new $root.tutorial.ResRank();
if (object.Type != null)
message.Type = object.Type | 0;
if (object.RankList) {
if (typeof object.RankList !== "object")
throw TypeError(".tutorial.ResRank.RankList: object expected");
message.RankList = {};
for (var keys = Object.keys(object.RankList), i = 0; i < keys.length; ++i) {
if (typeof object.RankList[keys[i]] !== "object")
throw TypeError(".tutorial.ResRank.RankList: object expected");
message.RankList[keys[i]] = $root.tutorial.ResPlayerSimple.fromObject(object.RankList[keys[i]]);
}
}
if (object.MyRank != null)
message.MyRank = object.MyRank | 0;
if (object.MyScore != null)
message.MyScore = Number(object.MyScore);
return message;
};
/**
* Creates a plain object from a ResRank message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRank
* @static
* @param {tutorial.ResRank} message ResRank
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRank.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.RankList = {};
if (options.defaults) {
object.Type = 0;
object.MyRank = 0;
object.MyScore = 0;
}
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
var keys2;
if (message.RankList && (keys2 = Object.keys(message.RankList)).length) {
object.RankList = {};
for (var j = 0; j < keys2.length; ++j)
object.RankList[keys2[j]] = $root.tutorial.ResPlayerSimple.toObject(message.RankList[keys2[j]], options);
}
if (message.MyRank != null && message.hasOwnProperty("MyRank"))
object.MyRank = message.MyRank;
if (message.MyScore != null && message.hasOwnProperty("MyScore"))
object.MyScore = options.json && !isFinite(message.MyScore) ? String(message.MyScore) : message.MyScore;
return object;
};
/**
* Converts this ResRank to JSON.
* @function toJSON
* @memberof tutorial.ResRank
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRank.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRank
* @function getTypeUrl
* @memberof tutorial.ResRank
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRank.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRank";
};
return ResRank;
})();
tutorial.ReqMailList = (function() {
/**
* Properties of a ReqMailList.
* @memberof tutorial
* @interface IReqMailList
*/
/**
* Constructs a new ReqMailList.
* @memberof tutorial
* @classdesc Represents a ReqMailList.
* @implements IReqMailList
* @constructor
* @param {tutorial.IReqMailList=} [properties] Properties to set
*/
function ReqMailList(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]];
}
/**
* Creates a new ReqMailList instance using the specified properties.
* @function create
* @memberof tutorial.ReqMailList
* @static
* @param {tutorial.IReqMailList=} [properties] Properties to set
* @returns {tutorial.ReqMailList} ReqMailList instance
*/
ReqMailList.create = function create(properties) {
return new ReqMailList(properties);
};
/**
* Encodes the specified ReqMailList message. Does not implicitly {@link tutorial.ReqMailList.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqMailList
* @static
* @param {tutorial.IReqMailList} message ReqMailList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMailList.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqMailList message, length delimited. Does not implicitly {@link tutorial.ReqMailList.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqMailList
* @static
* @param {tutorial.IReqMailList} message ReqMailList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMailList.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqMailList message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqMailList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqMailList} ReqMailList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMailList.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.ReqMailList();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqMailList message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqMailList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqMailList} ReqMailList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMailList.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqMailList message.
* @function verify
* @memberof tutorial.ReqMailList
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqMailList.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqMailList message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqMailList
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqMailList} ReqMailList
*/
ReqMailList.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqMailList)
return object;
return new $root.tutorial.ReqMailList();
};
/**
* Creates a plain object from a ReqMailList message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqMailList
* @static
* @param {tutorial.ReqMailList} message ReqMailList
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqMailList.toObject = function toObject() {
return {};
};
/**
* Converts this ReqMailList to JSON.
* @function toJSON
* @memberof tutorial.ReqMailList
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqMailList.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqMailList
* @function getTypeUrl
* @memberof tutorial.ReqMailList
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqMailList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqMailList";
};
return ReqMailList;
})();
tutorial.ResMailList = (function() {
/**
* Properties of a ResMailList.
* @memberof tutorial
* @interface IResMailList
* @property {Object.<string,tutorial.IMailInfo>|null} [MailList] ResMailList MailList
*/
/**
* Constructs a new ResMailList.
* @memberof tutorial
* @classdesc Represents a ResMailList.
* @implements IResMailList
* @constructor
* @param {tutorial.IResMailList=} [properties] Properties to set
*/
function ResMailList(properties) {
this.MailList = {};
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]];
}
/**
* ResMailList MailList.
* @member {Object.<string,tutorial.IMailInfo>} MailList
* @memberof tutorial.ResMailList
* @instance
*/
ResMailList.prototype.MailList = $util.emptyObject;
/**
* Creates a new ResMailList instance using the specified properties.
* @function create
* @memberof tutorial.ResMailList
* @static
* @param {tutorial.IResMailList=} [properties] Properties to set
* @returns {tutorial.ResMailList} ResMailList instance
*/
ResMailList.create = function create(properties) {
return new ResMailList(properties);
};
/**
* Encodes the specified ResMailList message. Does not implicitly {@link tutorial.ResMailList.verify|verify} messages.
* @function encode
* @memberof tutorial.ResMailList
* @static
* @param {tutorial.IResMailList} message ResMailList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMailList.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.MailList != null && Object.hasOwnProperty.call(message, "MailList"))
for (var keys = Object.keys(message.MailList), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.MailInfo.encode(message.MailList[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
return writer;
};
/**
* Encodes the specified ResMailList message, length delimited. Does not implicitly {@link tutorial.ResMailList.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResMailList
* @static
* @param {tutorial.IResMailList} message ResMailList message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMailList.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResMailList message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResMailList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResMailList} ResMailList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMailList.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.ResMailList(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.MailList === $util.emptyObject)
message.MailList = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.MailInfo.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.MailList[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResMailList message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResMailList
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResMailList} ResMailList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMailList.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResMailList message.
* @function verify
* @memberof tutorial.ResMailList
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResMailList.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.MailList != null && message.hasOwnProperty("MailList")) {
if (!$util.isObject(message.MailList))
return "MailList: object expected";
var key = Object.keys(message.MailList);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "MailList: integer key{k:int32} expected";
{
var error = $root.tutorial.MailInfo.verify(message.MailList[key[i]]);
if (error)
return "MailList." + error;
}
}
}
return null;
};
/**
* Creates a ResMailList message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResMailList
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResMailList} ResMailList
*/
ResMailList.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResMailList)
return object;
var message = new $root.tutorial.ResMailList();
if (object.MailList) {
if (typeof object.MailList !== "object")
throw TypeError(".tutorial.ResMailList.MailList: object expected");
message.MailList = {};
for (var keys = Object.keys(object.MailList), i = 0; i < keys.length; ++i) {
if (typeof object.MailList[keys[i]] !== "object")
throw TypeError(".tutorial.ResMailList.MailList: object expected");
message.MailList[keys[i]] = $root.tutorial.MailInfo.fromObject(object.MailList[keys[i]]);
}
}
return message;
};
/**
* Creates a plain object from a ResMailList message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResMailList
* @static
* @param {tutorial.ResMailList} message ResMailList
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResMailList.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.MailList = {};
var keys2;
if (message.MailList && (keys2 = Object.keys(message.MailList)).length) {
object.MailList = {};
for (var j = 0; j < keys2.length; ++j)
object.MailList[keys2[j]] = $root.tutorial.MailInfo.toObject(message.MailList[keys2[j]], options);
}
return object;
};
/**
* Converts this ResMailList to JSON.
* @function toJSON
* @memberof tutorial.ResMailList
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResMailList.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResMailList
* @function getTypeUrl
* @memberof tutorial.ResMailList
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResMailList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResMailList";
};
return ResMailList;
})();
tutorial.MailInfo = (function() {
/**
* Properties of a MailInfo.
* @memberof tutorial
* @interface IMailInfo
* @property {number|null} [Id] MailInfo Id
* @property {string|null} [Title] MailInfo Title
* @property {string|null} [Content] MailInfo Content
* @property {number|null} [Time] MailInfo Time
* @property {number|null} [Status] MailInfo Status
* @property {Array.<tutorial.IItemInfo>|null} [Items] MailInfo Items
*/
/**
* Constructs a new MailInfo.
* @memberof tutorial
* @classdesc Represents a MailInfo.
* @implements IMailInfo
* @constructor
* @param {tutorial.IMailInfo=} [properties] Properties to set
*/
function MailInfo(properties) {
this.Items = [];
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]];
}
/**
* MailInfo Id.
* @member {number} Id
* @memberof tutorial.MailInfo
* @instance
*/
MailInfo.prototype.Id = 0;
/**
* MailInfo Title.
* @member {string} Title
* @memberof tutorial.MailInfo
* @instance
*/
MailInfo.prototype.Title = "";
/**
* MailInfo Content.
* @member {string} Content
* @memberof tutorial.MailInfo
* @instance
*/
MailInfo.prototype.Content = "";
/**
* MailInfo Time.
* @member {number} Time
* @memberof tutorial.MailInfo
* @instance
*/
MailInfo.prototype.Time = 0;
/**
* MailInfo Status.
* @member {number} Status
* @memberof tutorial.MailInfo
* @instance
*/
MailInfo.prototype.Status = 0;
/**
* MailInfo Items.
* @member {Array.<tutorial.IItemInfo>} Items
* @memberof tutorial.MailInfo
* @instance
*/
MailInfo.prototype.Items = $util.emptyArray;
/**
* Creates a new MailInfo instance using the specified properties.
* @function create
* @memberof tutorial.MailInfo
* @static
* @param {tutorial.IMailInfo=} [properties] Properties to set
* @returns {tutorial.MailInfo} MailInfo instance
*/
MailInfo.create = function create(properties) {
return new MailInfo(properties);
};
/**
* Encodes the specified MailInfo message. Does not implicitly {@link tutorial.MailInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.MailInfo
* @static
* @param {tutorial.IMailInfo} message MailInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MailInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Title != null && Object.hasOwnProperty.call(message, "Title"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Title);
if (message.Content != null && Object.hasOwnProperty.call(message, "Content"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.Content);
if (message.Time != null && Object.hasOwnProperty.call(message, "Time"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Time);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Status);
if (message.Items != null && message.Items.length)
for (var i = 0; i < message.Items.length; ++i)
$root.tutorial.ItemInfo.encode(message.Items[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
return writer;
};
/**
* Encodes the specified MailInfo message, length delimited. Does not implicitly {@link tutorial.MailInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.MailInfo
* @static
* @param {tutorial.IMailInfo} message MailInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MailInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MailInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.MailInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.MailInfo} MailInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MailInfo.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.MailInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Title = reader.string();
break;
}
case 3: {
message.Content = reader.string();
break;
}
case 4: {
message.Time = reader.int32();
break;
}
case 5: {
message.Status = reader.int32();
break;
}
case 6: {
if (!(message.Items && message.Items.length))
message.Items = [];
message.Items.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MailInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.MailInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.MailInfo} MailInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MailInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MailInfo message.
* @function verify
* @memberof tutorial.MailInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MailInfo.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))
return "Id: integer expected";
if (message.Title != null && message.hasOwnProperty("Title"))
if (!$util.isString(message.Title))
return "Title: string expected";
if (message.Content != null && message.hasOwnProperty("Content"))
if (!$util.isString(message.Content))
return "Content: string expected";
if (message.Time != null && message.hasOwnProperty("Time"))
if (!$util.isInteger(message.Time))
return "Time: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!Array.isArray(message.Items))
return "Items: array expected";
for (var i = 0; i < message.Items.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Items[i]);
if (error)
return "Items." + error;
}
}
return null;
};
/**
* Creates a MailInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.MailInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.MailInfo} MailInfo
*/
MailInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.MailInfo)
return object;
var message = new $root.tutorial.MailInfo();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Title != null)
message.Title = String(object.Title);
if (object.Content != null)
message.Content = String(object.Content);
if (object.Time != null)
message.Time = object.Time | 0;
if (object.Status != null)
message.Status = object.Status | 0;
if (object.Items) {
if (!Array.isArray(object.Items))
throw TypeError(".tutorial.MailInfo.Items: array expected");
message.Items = [];
for (var i = 0; i < object.Items.length; ++i) {
if (typeof object.Items[i] !== "object")
throw TypeError(".tutorial.MailInfo.Items: object expected");
message.Items[i] = $root.tutorial.ItemInfo.fromObject(object.Items[i]);
}
}
return message;
};
/**
* Creates a plain object from a MailInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.MailInfo
* @static
* @param {tutorial.MailInfo} message MailInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
MailInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Items = [];
if (options.defaults) {
object.Id = 0;
object.Title = "";
object.Content = "";
object.Time = 0;
object.Status = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Title != null && message.hasOwnProperty("Title"))
object.Title = message.Title;
if (message.Content != null && message.hasOwnProperty("Content"))
object.Content = message.Content;
if (message.Time != null && message.hasOwnProperty("Time"))
object.Time = message.Time;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.Items && message.Items.length) {
object.Items = [];
for (var j = 0; j < message.Items.length; ++j)
object.Items[j] = $root.tutorial.ItemInfo.toObject(message.Items[j], options);
}
return object;
};
/**
* Converts this MailInfo to JSON.
* @function toJSON
* @memberof tutorial.MailInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
MailInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for MailInfo
* @function getTypeUrl
* @memberof tutorial.MailInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
MailInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.MailInfo";
};
return MailInfo;
})();
tutorial.MailNotify = (function() {
/**
* Properties of a MailNotify.
* @memberof tutorial
* @interface IMailNotify
* @property {tutorial.IMailInfo|null} [Info] MailNotify Info
*/
/**
* Constructs a new MailNotify.
* @memberof tutorial
* @classdesc Represents a MailNotify.
* @implements IMailNotify
* @constructor
* @param {tutorial.IMailNotify=} [properties] Properties to set
*/
function MailNotify(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]];
}
/**
* MailNotify Info.
* @member {tutorial.IMailInfo|null|undefined} Info
* @memberof tutorial.MailNotify
* @instance
*/
MailNotify.prototype.Info = null;
/**
* Creates a new MailNotify instance using the specified properties.
* @function create
* @memberof tutorial.MailNotify
* @static
* @param {tutorial.IMailNotify=} [properties] Properties to set
* @returns {tutorial.MailNotify} MailNotify instance
*/
MailNotify.create = function create(properties) {
return new MailNotify(properties);
};
/**
* Encodes the specified MailNotify message. Does not implicitly {@link tutorial.MailNotify.verify|verify} messages.
* @function encode
* @memberof tutorial.MailNotify
* @static
* @param {tutorial.IMailNotify} message MailNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MailNotify.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Info != null && Object.hasOwnProperty.call(message, "Info"))
$root.tutorial.MailInfo.encode(message.Info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified MailNotify message, length delimited. Does not implicitly {@link tutorial.MailNotify.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.MailNotify
* @static
* @param {tutorial.IMailNotify} message MailNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MailNotify.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MailNotify message from the specified reader or buffer.
* @function decode
* @memberof tutorial.MailNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.MailNotify} MailNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MailNotify.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.MailNotify();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Info = $root.tutorial.MailInfo.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MailNotify message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.MailNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.MailNotify} MailNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MailNotify.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MailNotify message.
* @function verify
* @memberof tutorial.MailNotify
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MailNotify.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Info != null && message.hasOwnProperty("Info")) {
var error = $root.tutorial.MailInfo.verify(message.Info);
if (error)
return "Info." + error;
}
return null;
};
/**
* Creates a MailNotify message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.MailNotify
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.MailNotify} MailNotify
*/
MailNotify.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.MailNotify)
return object;
var message = new $root.tutorial.MailNotify();
if (object.Info != null) {
if (typeof object.Info !== "object")
throw TypeError(".tutorial.MailNotify.Info: object expected");
message.Info = $root.tutorial.MailInfo.fromObject(object.Info);
}
return message;
};
/**
* Creates a plain object from a MailNotify message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.MailNotify
* @static
* @param {tutorial.MailNotify} message MailNotify
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
MailNotify.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Info = null;
if (message.Info != null && message.hasOwnProperty("Info"))
object.Info = $root.tutorial.MailInfo.toObject(message.Info, options);
return object;
};
/**
* Converts this MailNotify to JSON.
* @function toJSON
* @memberof tutorial.MailNotify
* @instance
* @returns {Object.<string,*>} JSON object
*/
MailNotify.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for MailNotify
* @function getTypeUrl
* @memberof tutorial.MailNotify
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
MailNotify.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.MailNotify";
};
return MailNotify;
})();
tutorial.ReqReadMail = (function() {
/**
* Properties of a ReqReadMail.
* @memberof tutorial
* @interface IReqReadMail
* @property {number|null} [Id] ReqReadMail Id
*/
/**
* Constructs a new ReqReadMail.
* @memberof tutorial
* @classdesc Represents a ReqReadMail.
* @implements IReqReadMail
* @constructor
* @param {tutorial.IReqReadMail=} [properties] Properties to set
*/
function ReqReadMail(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]];
}
/**
* ReqReadMail Id.
* @member {number} Id
* @memberof tutorial.ReqReadMail
* @instance
*/
ReqReadMail.prototype.Id = 0;
/**
* Creates a new ReqReadMail instance using the specified properties.
* @function create
* @memberof tutorial.ReqReadMail
* @static
* @param {tutorial.IReqReadMail=} [properties] Properties to set
* @returns {tutorial.ReqReadMail} ReqReadMail instance
*/
ReqReadMail.create = function create(properties) {
return new ReqReadMail(properties);
};
/**
* Encodes the specified ReqReadMail message. Does not implicitly {@link tutorial.ReqReadMail.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqReadMail
* @static
* @param {tutorial.IReqReadMail} message ReqReadMail message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqReadMail.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqReadMail message, length delimited. Does not implicitly {@link tutorial.ReqReadMail.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqReadMail
* @static
* @param {tutorial.IReqReadMail} message ReqReadMail message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqReadMail.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqReadMail message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqReadMail
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqReadMail} ReqReadMail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqReadMail.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.ReqReadMail();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqReadMail message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqReadMail
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqReadMail} ReqReadMail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqReadMail.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqReadMail message.
* @function verify
* @memberof tutorial.ReqReadMail
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqReadMail.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqReadMail message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqReadMail
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqReadMail} ReqReadMail
*/
ReqReadMail.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqReadMail)
return object;
var message = new $root.tutorial.ReqReadMail();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqReadMail message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqReadMail
* @static
* @param {tutorial.ReqReadMail} message ReqReadMail
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqReadMail.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqReadMail to JSON.
* @function toJSON
* @memberof tutorial.ReqReadMail
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqReadMail.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqReadMail
* @function getTypeUrl
* @memberof tutorial.ReqReadMail
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqReadMail.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqReadMail";
};
return ReqReadMail;
})();
tutorial.ResReadMail = (function() {
/**
* Properties of a ResReadMail.
* @memberof tutorial
* @interface IResReadMail
* @property {tutorial.RES_CODE|null} [Code] ResReadMail Code
* @property {string|null} [Msg] ResReadMail Msg
* @property {number|null} [Id] ResReadMail Id
*/
/**
* Constructs a new ResReadMail.
* @memberof tutorial
* @classdesc Represents a ResReadMail.
* @implements IResReadMail
* @constructor
* @param {tutorial.IResReadMail=} [properties] Properties to set
*/
function ResReadMail(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]];
}
/**
* ResReadMail Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResReadMail
* @instance
*/
ResReadMail.prototype.Code = 0;
/**
* ResReadMail Msg.
* @member {string} Msg
* @memberof tutorial.ResReadMail
* @instance
*/
ResReadMail.prototype.Msg = "";
/**
* ResReadMail Id.
* @member {number} Id
* @memberof tutorial.ResReadMail
* @instance
*/
ResReadMail.prototype.Id = 0;
/**
* Creates a new ResReadMail instance using the specified properties.
* @function create
* @memberof tutorial.ResReadMail
* @static
* @param {tutorial.IResReadMail=} [properties] Properties to set
* @returns {tutorial.ResReadMail} ResReadMail instance
*/
ResReadMail.create = function create(properties) {
return new ResReadMail(properties);
};
/**
* Encodes the specified ResReadMail message. Does not implicitly {@link tutorial.ResReadMail.verify|verify} messages.
* @function encode
* @memberof tutorial.ResReadMail
* @static
* @param {tutorial.IResReadMail} message ResReadMail message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResReadMail.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Id);
return writer;
};
/**
* Encodes the specified ResReadMail message, length delimited. Does not implicitly {@link tutorial.ResReadMail.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResReadMail
* @static
* @param {tutorial.IResReadMail} message ResReadMail message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResReadMail.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResReadMail message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResReadMail
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResReadMail} ResReadMail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResReadMail.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.ResReadMail();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResReadMail message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResReadMail
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResReadMail} ResReadMail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResReadMail.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResReadMail message.
* @function verify
* @memberof tutorial.ResReadMail
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResReadMail.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isInteger(message.Id))
return "Id: integer expected";
return null;
};
/**
* Creates a ResReadMail message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResReadMail
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResReadMail} ResReadMail
*/
ResReadMail.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResReadMail)
return object;
var message = new $root.tutorial.ResReadMail();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ResReadMail message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResReadMail
* @static
* @param {tutorial.ResReadMail} message ResReadMail
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResReadMail.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResReadMail to JSON.
* @function toJSON
* @memberof tutorial.ResReadMail
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResReadMail.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResReadMail
* @function getTypeUrl
* @memberof tutorial.ResReadMail
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResReadMail.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResReadMail";
};
return ResReadMail;
})();
tutorial.ReqGetMailReward = (function() {
/**
* Properties of a ReqGetMailReward.
* @memberof tutorial
* @interface IReqGetMailReward
* @property {number|null} [Id] ReqGetMailReward Id
*/
/**
* Constructs a new ReqGetMailReward.
* @memberof tutorial
* @classdesc Represents a ReqGetMailReward.
* @implements IReqGetMailReward
* @constructor
* @param {tutorial.IReqGetMailReward=} [properties] Properties to set
*/
function ReqGetMailReward(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]];
}
/**
* ReqGetMailReward Id.
* @member {number} Id
* @memberof tutorial.ReqGetMailReward
* @instance
*/
ReqGetMailReward.prototype.Id = 0;
/**
* Creates a new ReqGetMailReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetMailReward
* @static
* @param {tutorial.IReqGetMailReward=} [properties] Properties to set
* @returns {tutorial.ReqGetMailReward} ReqGetMailReward instance
*/
ReqGetMailReward.create = function create(properties) {
return new ReqGetMailReward(properties);
};
/**
* Encodes the specified ReqGetMailReward message. Does not implicitly {@link tutorial.ReqGetMailReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetMailReward
* @static
* @param {tutorial.IReqGetMailReward} message ReqGetMailReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetMailReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqGetMailReward message, length delimited. Does not implicitly {@link tutorial.ReqGetMailReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetMailReward
* @static
* @param {tutorial.IReqGetMailReward} message ReqGetMailReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetMailReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetMailReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetMailReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetMailReward} ReqGetMailReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetMailReward.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.ReqGetMailReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetMailReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetMailReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetMailReward} ReqGetMailReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetMailReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetMailReward message.
* @function verify
* @memberof tutorial.ReqGetMailReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetMailReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqGetMailReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetMailReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetMailReward} ReqGetMailReward
*/
ReqGetMailReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetMailReward)
return object;
var message = new $root.tutorial.ReqGetMailReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqGetMailReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetMailReward
* @static
* @param {tutorial.ReqGetMailReward} message ReqGetMailReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetMailReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqGetMailReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGetMailReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetMailReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetMailReward
* @function getTypeUrl
* @memberof tutorial.ReqGetMailReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetMailReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetMailReward";
};
return ReqGetMailReward;
})();
tutorial.ResGetMailReward = (function() {
/**
* Properties of a ResGetMailReward.
* @memberof tutorial
* @interface IResGetMailReward
* @property {tutorial.RES_CODE|null} [Code] ResGetMailReward Code
* @property {string|null} [Msg] ResGetMailReward Msg
* @property {number|null} [Id] ResGetMailReward Id
*/
/**
* Constructs a new ResGetMailReward.
* @memberof tutorial
* @classdesc Represents a ResGetMailReward.
* @implements IResGetMailReward
* @constructor
* @param {tutorial.IResGetMailReward=} [properties] Properties to set
*/
function ResGetMailReward(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]];
}
/**
* ResGetMailReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGetMailReward
* @instance
*/
ResGetMailReward.prototype.Code = 0;
/**
* ResGetMailReward Msg.
* @member {string} Msg
* @memberof tutorial.ResGetMailReward
* @instance
*/
ResGetMailReward.prototype.Msg = "";
/**
* ResGetMailReward Id.
* @member {number} Id
* @memberof tutorial.ResGetMailReward
* @instance
*/
ResGetMailReward.prototype.Id = 0;
/**
* Creates a new ResGetMailReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGetMailReward
* @static
* @param {tutorial.IResGetMailReward=} [properties] Properties to set
* @returns {tutorial.ResGetMailReward} ResGetMailReward instance
*/
ResGetMailReward.create = function create(properties) {
return new ResGetMailReward(properties);
};
/**
* Encodes the specified ResGetMailReward message. Does not implicitly {@link tutorial.ResGetMailReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetMailReward
* @static
* @param {tutorial.IResGetMailReward} message ResGetMailReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetMailReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Id);
return writer;
};
/**
* Encodes the specified ResGetMailReward message, length delimited. Does not implicitly {@link tutorial.ResGetMailReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetMailReward
* @static
* @param {tutorial.IResGetMailReward} message ResGetMailReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetMailReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetMailReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetMailReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetMailReward} ResGetMailReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetMailReward.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.ResGetMailReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetMailReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetMailReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetMailReward} ResGetMailReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetMailReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetMailReward message.
* @function verify
* @memberof tutorial.ResGetMailReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetMailReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isInteger(message.Id))
return "Id: integer expected";
return null;
};
/**
* Creates a ResGetMailReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetMailReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetMailReward} ResGetMailReward
*/
ResGetMailReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetMailReward)
return object;
var message = new $root.tutorial.ResGetMailReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ResGetMailReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetMailReward
* @static
* @param {tutorial.ResGetMailReward} message ResGetMailReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetMailReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResGetMailReward to JSON.
* @function toJSON
* @memberof tutorial.ResGetMailReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetMailReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetMailReward
* @function getTypeUrl
* @memberof tutorial.ResGetMailReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetMailReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetMailReward";
};
return ResGetMailReward;
})();
tutorial.ReqDeleteMail = (function() {
/**
* Properties of a ReqDeleteMail.
* @memberof tutorial
* @interface IReqDeleteMail
* @property {number|null} [Id] ReqDeleteMail Id
*/
/**
* Constructs a new ReqDeleteMail.
* @memberof tutorial
* @classdesc Represents a ReqDeleteMail.
* @implements IReqDeleteMail
* @constructor
* @param {tutorial.IReqDeleteMail=} [properties] Properties to set
*/
function ReqDeleteMail(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]];
}
/**
* ReqDeleteMail Id.
* @member {number} Id
* @memberof tutorial.ReqDeleteMail
* @instance
*/
ReqDeleteMail.prototype.Id = 0;
/**
* Creates a new ReqDeleteMail instance using the specified properties.
* @function create
* @memberof tutorial.ReqDeleteMail
* @static
* @param {tutorial.IReqDeleteMail=} [properties] Properties to set
* @returns {tutorial.ReqDeleteMail} ReqDeleteMail instance
*/
ReqDeleteMail.create = function create(properties) {
return new ReqDeleteMail(properties);
};
/**
* Encodes the specified ReqDeleteMail message. Does not implicitly {@link tutorial.ReqDeleteMail.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqDeleteMail
* @static
* @param {tutorial.IReqDeleteMail} message ReqDeleteMail message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDeleteMail.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqDeleteMail message, length delimited. Does not implicitly {@link tutorial.ReqDeleteMail.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqDeleteMail
* @static
* @param {tutorial.IReqDeleteMail} message ReqDeleteMail message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqDeleteMail.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqDeleteMail message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqDeleteMail
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqDeleteMail} ReqDeleteMail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDeleteMail.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.ReqDeleteMail();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqDeleteMail message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqDeleteMail
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqDeleteMail} ReqDeleteMail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqDeleteMail.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqDeleteMail message.
* @function verify
* @memberof tutorial.ReqDeleteMail
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqDeleteMail.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqDeleteMail message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqDeleteMail
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqDeleteMail} ReqDeleteMail
*/
ReqDeleteMail.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqDeleteMail)
return object;
var message = new $root.tutorial.ReqDeleteMail();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqDeleteMail message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqDeleteMail
* @static
* @param {tutorial.ReqDeleteMail} message ReqDeleteMail
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqDeleteMail.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqDeleteMail to JSON.
* @function toJSON
* @memberof tutorial.ReqDeleteMail
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqDeleteMail.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqDeleteMail
* @function getTypeUrl
* @memberof tutorial.ReqDeleteMail
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqDeleteMail.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqDeleteMail";
};
return ReqDeleteMail;
})();
tutorial.ResDeleteMail = (function() {
/**
* Properties of a ResDeleteMail.
* @memberof tutorial
* @interface IResDeleteMail
* @property {tutorial.RES_CODE|null} [Code] ResDeleteMail Code
* @property {string|null} [Msg] ResDeleteMail Msg
* @property {number|null} [Id] ResDeleteMail Id
*/
/**
* Constructs a new ResDeleteMail.
* @memberof tutorial
* @classdesc Represents a ResDeleteMail.
* @implements IResDeleteMail
* @constructor
* @param {tutorial.IResDeleteMail=} [properties] Properties to set
*/
function ResDeleteMail(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]];
}
/**
* ResDeleteMail Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResDeleteMail
* @instance
*/
ResDeleteMail.prototype.Code = 0;
/**
* ResDeleteMail Msg.
* @member {string} Msg
* @memberof tutorial.ResDeleteMail
* @instance
*/
ResDeleteMail.prototype.Msg = "";
/**
* ResDeleteMail Id.
* @member {number} Id
* @memberof tutorial.ResDeleteMail
* @instance
*/
ResDeleteMail.prototype.Id = 0;
/**
* Creates a new ResDeleteMail instance using the specified properties.
* @function create
* @memberof tutorial.ResDeleteMail
* @static
* @param {tutorial.IResDeleteMail=} [properties] Properties to set
* @returns {tutorial.ResDeleteMail} ResDeleteMail instance
*/
ResDeleteMail.create = function create(properties) {
return new ResDeleteMail(properties);
};
/**
* Encodes the specified ResDeleteMail message. Does not implicitly {@link tutorial.ResDeleteMail.verify|verify} messages.
* @function encode
* @memberof tutorial.ResDeleteMail
* @static
* @param {tutorial.IResDeleteMail} message ResDeleteMail message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDeleteMail.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Id);
return writer;
};
/**
* Encodes the specified ResDeleteMail message, length delimited. Does not implicitly {@link tutorial.ResDeleteMail.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResDeleteMail
* @static
* @param {tutorial.IResDeleteMail} message ResDeleteMail message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResDeleteMail.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResDeleteMail message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResDeleteMail
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResDeleteMail} ResDeleteMail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDeleteMail.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.ResDeleteMail();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResDeleteMail message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResDeleteMail
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResDeleteMail} ResDeleteMail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResDeleteMail.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResDeleteMail message.
* @function verify
* @memberof tutorial.ResDeleteMail
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResDeleteMail.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isInteger(message.Id))
return "Id: integer expected";
return null;
};
/**
* Creates a ResDeleteMail message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResDeleteMail
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResDeleteMail} ResDeleteMail
*/
ResDeleteMail.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResDeleteMail)
return object;
var message = new $root.tutorial.ResDeleteMail();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ResDeleteMail message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResDeleteMail
* @static
* @param {tutorial.ResDeleteMail} message ResDeleteMail
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResDeleteMail.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResDeleteMail to JSON.
* @function toJSON
* @memberof tutorial.ResDeleteMail
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResDeleteMail.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResDeleteMail
* @function getTypeUrl
* @memberof tutorial.ResDeleteMail
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResDeleteMail.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResDeleteMail";
};
return ResDeleteMail;
})();
tutorial.ResCharge = (function() {
/**
* Properties of a ResCharge.
* @memberof tutorial
* @interface IResCharge
* @property {number|null} [Charge] ResCharge Charge
* @property {number|null} [Total] ResCharge Total
* @property {Array.<number>|null} [First] ResCharge First
* @property {Object.<string,tutorial.IResSpecialShop>|null} [SpecialShop] ResCharge SpecialShop
* @property {number|null} [FreeShop] ResCharge FreeShop
* @property {Object.<string,tutorial.IResChessShop>|null} [ChessShop] ResCharge ChessShop
* @property {Object.<string,number>|null} [Gift] ResCharge Gift
* @property {boolean|null} [Ad] ResCharge Ad
*/
/**
* Constructs a new ResCharge.
* @memberof tutorial
* @classdesc Represents a ResCharge.
* @implements IResCharge
* @constructor
* @param {tutorial.IResCharge=} [properties] Properties to set
*/
function ResCharge(properties) {
this.First = [];
this.SpecialShop = {};
this.ChessShop = {};
this.Gift = {};
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]];
}
/**
* ResCharge Charge.
* @member {number} Charge
* @memberof tutorial.ResCharge
* @instance
*/
ResCharge.prototype.Charge = 0;
/**
* ResCharge Total.
* @member {number} Total
* @memberof tutorial.ResCharge
* @instance
*/
ResCharge.prototype.Total = 0;
/**
* ResCharge First.
* @member {Array.<number>} First
* @memberof tutorial.ResCharge
* @instance
*/
ResCharge.prototype.First = $util.emptyArray;
/**
* ResCharge SpecialShop.
* @member {Object.<string,tutorial.IResSpecialShop>} SpecialShop
* @memberof tutorial.ResCharge
* @instance
*/
ResCharge.prototype.SpecialShop = $util.emptyObject;
/**
* ResCharge FreeShop.
* @member {number} FreeShop
* @memberof tutorial.ResCharge
* @instance
*/
ResCharge.prototype.FreeShop = 0;
/**
* ResCharge ChessShop.
* @member {Object.<string,tutorial.IResChessShop>} ChessShop
* @memberof tutorial.ResCharge
* @instance
*/
ResCharge.prototype.ChessShop = $util.emptyObject;
/**
* ResCharge Gift.
* @member {Object.<string,number>} Gift
* @memberof tutorial.ResCharge
* @instance
*/
ResCharge.prototype.Gift = $util.emptyObject;
/**
* ResCharge Ad.
* @member {boolean} Ad
* @memberof tutorial.ResCharge
* @instance
*/
ResCharge.prototype.Ad = false;
/**
* Creates a new ResCharge instance using the specified properties.
* @function create
* @memberof tutorial.ResCharge
* @static
* @param {tutorial.IResCharge=} [properties] Properties to set
* @returns {tutorial.ResCharge} ResCharge instance
*/
ResCharge.create = function create(properties) {
return new ResCharge(properties);
};
/**
* Encodes the specified ResCharge message. Does not implicitly {@link tutorial.ResCharge.verify|verify} messages.
* @function encode
* @memberof tutorial.ResCharge
* @static
* @param {tutorial.IResCharge} message ResCharge message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCharge.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Charge != null && Object.hasOwnProperty.call(message, "Charge"))
writer.uint32(/* id 1, wireType 5 =*/13).float(message.Charge);
if (message.Total != null && Object.hasOwnProperty.call(message, "Total"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Total);
if (message.First != null && message.First.length) {
writer.uint32(/* id 3, wireType 2 =*/26).fork();
for (var i = 0; i < message.First.length; ++i)
writer.int32(message.First[i]);
writer.ldelim();
}
if (message.SpecialShop != null && Object.hasOwnProperty.call(message, "SpecialShop"))
for (var keys = Object.keys(message.SpecialShop), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.ResSpecialShop.encode(message.SpecialShop[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.FreeShop != null && Object.hasOwnProperty.call(message, "FreeShop"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.FreeShop);
if (message.ChessShop != null && Object.hasOwnProperty.call(message, "ChessShop"))
for (var keys = Object.keys(message.ChessShop), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.ResChessShop.encode(message.ChessShop[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.Gift != null && Object.hasOwnProperty.call(message, "Gift"))
for (var keys = Object.keys(message.Gift), i = 0; i < keys.length; ++i)
writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Gift[keys[i]]).ldelim();
if (message.Ad != null && Object.hasOwnProperty.call(message, "Ad"))
writer.uint32(/* id 8, wireType 0 =*/64).bool(message.Ad);
return writer;
};
/**
* Encodes the specified ResCharge message, length delimited. Does not implicitly {@link tutorial.ResCharge.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResCharge
* @static
* @param {tutorial.IResCharge} message ResCharge message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCharge.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResCharge message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResCharge
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResCharge} ResCharge
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCharge.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.ResCharge(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Charge = reader.float();
break;
}
case 2: {
message.Total = reader.int32();
break;
}
case 3: {
if (!(message.First && message.First.length))
message.First = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.First.push(reader.int32());
} else
message.First.push(reader.int32());
break;
}
case 4: {
if (message.SpecialShop === $util.emptyObject)
message.SpecialShop = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.ResSpecialShop.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.SpecialShop[key] = value;
break;
}
case 5: {
message.FreeShop = reader.int32();
break;
}
case 6: {
if (message.ChessShop === $util.emptyObject)
message.ChessShop = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.ResChessShop.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.ChessShop[key] = value;
break;
}
case 7: {
if (message.Gift === $util.emptyObject)
message.Gift = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Gift[key] = value;
break;
}
case 8: {
message.Ad = reader.bool();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResCharge message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResCharge
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResCharge} ResCharge
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCharge.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResCharge message.
* @function verify
* @memberof tutorial.ResCharge
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResCharge.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Charge != null && message.hasOwnProperty("Charge"))
if (typeof message.Charge !== "number")
return "Charge: number expected";
if (message.Total != null && message.hasOwnProperty("Total"))
if (!$util.isInteger(message.Total))
return "Total: integer expected";
if (message.First != null && message.hasOwnProperty("First")) {
if (!Array.isArray(message.First))
return "First: array expected";
for (var i = 0; i < message.First.length; ++i)
if (!$util.isInteger(message.First[i]))
return "First: integer[] expected";
}
if (message.SpecialShop != null && message.hasOwnProperty("SpecialShop")) {
if (!$util.isObject(message.SpecialShop))
return "SpecialShop: object expected";
var key = Object.keys(message.SpecialShop);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "SpecialShop: integer key{k:int32} expected";
{
var error = $root.tutorial.ResSpecialShop.verify(message.SpecialShop[key[i]]);
if (error)
return "SpecialShop." + error;
}
}
}
if (message.FreeShop != null && message.hasOwnProperty("FreeShop"))
if (!$util.isInteger(message.FreeShop))
return "FreeShop: integer expected";
if (message.ChessShop != null && message.hasOwnProperty("ChessShop")) {
if (!$util.isObject(message.ChessShop))
return "ChessShop: object expected";
var key = Object.keys(message.ChessShop);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "ChessShop: integer key{k:int32} expected";
{
var error = $root.tutorial.ResChessShop.verify(message.ChessShop[key[i]]);
if (error)
return "ChessShop." + error;
}
}
}
if (message.Gift != null && message.hasOwnProperty("Gift")) {
if (!$util.isObject(message.Gift))
return "Gift: object expected";
var key = Object.keys(message.Gift);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Gift: integer key{k:int32} expected";
if (!$util.isInteger(message.Gift[key[i]]))
return "Gift: integer{k:int32} expected";
}
}
if (message.Ad != null && message.hasOwnProperty("Ad"))
if (typeof message.Ad !== "boolean")
return "Ad: boolean expected";
return null;
};
/**
* Creates a ResCharge message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResCharge
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResCharge} ResCharge
*/
ResCharge.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResCharge)
return object;
var message = new $root.tutorial.ResCharge();
if (object.Charge != null)
message.Charge = Number(object.Charge);
if (object.Total != null)
message.Total = object.Total | 0;
if (object.First) {
if (!Array.isArray(object.First))
throw TypeError(".tutorial.ResCharge.First: array expected");
message.First = [];
for (var i = 0; i < object.First.length; ++i)
message.First[i] = object.First[i] | 0;
}
if (object.SpecialShop) {
if (typeof object.SpecialShop !== "object")
throw TypeError(".tutorial.ResCharge.SpecialShop: object expected");
message.SpecialShop = {};
for (var keys = Object.keys(object.SpecialShop), i = 0; i < keys.length; ++i) {
if (typeof object.SpecialShop[keys[i]] !== "object")
throw TypeError(".tutorial.ResCharge.SpecialShop: object expected");
message.SpecialShop[keys[i]] = $root.tutorial.ResSpecialShop.fromObject(object.SpecialShop[keys[i]]);
}
}
if (object.FreeShop != null)
message.FreeShop = object.FreeShop | 0;
if (object.ChessShop) {
if (typeof object.ChessShop !== "object")
throw TypeError(".tutorial.ResCharge.ChessShop: object expected");
message.ChessShop = {};
for (var keys = Object.keys(object.ChessShop), i = 0; i < keys.length; ++i) {
if (typeof object.ChessShop[keys[i]] !== "object")
throw TypeError(".tutorial.ResCharge.ChessShop: object expected");
message.ChessShop[keys[i]] = $root.tutorial.ResChessShop.fromObject(object.ChessShop[keys[i]]);
}
}
if (object.Gift) {
if (typeof object.Gift !== "object")
throw TypeError(".tutorial.ResCharge.Gift: object expected");
message.Gift = {};
for (var keys = Object.keys(object.Gift), i = 0; i < keys.length; ++i)
message.Gift[keys[i]] = object.Gift[keys[i]] | 0;
}
if (object.Ad != null)
message.Ad = Boolean(object.Ad);
return message;
};
/**
* Creates a plain object from a ResCharge message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResCharge
* @static
* @param {tutorial.ResCharge} message ResCharge
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResCharge.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.First = [];
if (options.objects || options.defaults) {
object.SpecialShop = {};
object.ChessShop = {};
object.Gift = {};
}
if (options.defaults) {
object.Charge = 0;
object.Total = 0;
object.FreeShop = 0;
object.Ad = false;
}
if (message.Charge != null && message.hasOwnProperty("Charge"))
object.Charge = options.json && !isFinite(message.Charge) ? String(message.Charge) : message.Charge;
if (message.Total != null && message.hasOwnProperty("Total"))
object.Total = message.Total;
if (message.First && message.First.length) {
object.First = [];
for (var j = 0; j < message.First.length; ++j)
object.First[j] = message.First[j];
}
var keys2;
if (message.SpecialShop && (keys2 = Object.keys(message.SpecialShop)).length) {
object.SpecialShop = {};
for (var j = 0; j < keys2.length; ++j)
object.SpecialShop[keys2[j]] = $root.tutorial.ResSpecialShop.toObject(message.SpecialShop[keys2[j]], options);
}
if (message.FreeShop != null && message.hasOwnProperty("FreeShop"))
object.FreeShop = message.FreeShop;
if (message.ChessShop && (keys2 = Object.keys(message.ChessShop)).length) {
object.ChessShop = {};
for (var j = 0; j < keys2.length; ++j)
object.ChessShop[keys2[j]] = $root.tutorial.ResChessShop.toObject(message.ChessShop[keys2[j]], options);
}
if (message.Gift && (keys2 = Object.keys(message.Gift)).length) {
object.Gift = {};
for (var j = 0; j < keys2.length; ++j)
object.Gift[keys2[j]] = message.Gift[keys2[j]];
}
if (message.Ad != null && message.hasOwnProperty("Ad"))
object.Ad = message.Ad;
return object;
};
/**
* Converts this ResCharge to JSON.
* @function toJSON
* @memberof tutorial.ResCharge
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResCharge.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResCharge
* @function getTypeUrl
* @memberof tutorial.ResCharge
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResCharge.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResCharge";
};
return ResCharge;
})();
tutorial.ResSpecialShop = (function() {
/**
* Properties of a ResSpecialShop.
* @memberof tutorial
* @interface IResSpecialShop
* @property {number|null} [Grade] ResSpecialShop Grade
* @property {number|null} [Count] ResSpecialShop Count
*/
/**
* Constructs a new ResSpecialShop.
* @memberof tutorial
* @classdesc Represents a ResSpecialShop.
* @implements IResSpecialShop
* @constructor
* @param {tutorial.IResSpecialShop=} [properties] Properties to set
*/
function ResSpecialShop(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]];
}
/**
* ResSpecialShop Grade.
* @member {number} Grade
* @memberof tutorial.ResSpecialShop
* @instance
*/
ResSpecialShop.prototype.Grade = 0;
/**
* ResSpecialShop Count.
* @member {number} Count
* @memberof tutorial.ResSpecialShop
* @instance
*/
ResSpecialShop.prototype.Count = 0;
/**
* Creates a new ResSpecialShop instance using the specified properties.
* @function create
* @memberof tutorial.ResSpecialShop
* @static
* @param {tutorial.IResSpecialShop=} [properties] Properties to set
* @returns {tutorial.ResSpecialShop} ResSpecialShop instance
*/
ResSpecialShop.create = function create(properties) {
return new ResSpecialShop(properties);
};
/**
* Encodes the specified ResSpecialShop message. Does not implicitly {@link tutorial.ResSpecialShop.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSpecialShop
* @static
* @param {tutorial.IResSpecialShop} message ResSpecialShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSpecialShop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Grade != null && Object.hasOwnProperty.call(message, "Grade"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Grade);
if (message.Count != null && Object.hasOwnProperty.call(message, "Count"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Count);
return writer;
};
/**
* Encodes the specified ResSpecialShop message, length delimited. Does not implicitly {@link tutorial.ResSpecialShop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSpecialShop
* @static
* @param {tutorial.IResSpecialShop} message ResSpecialShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSpecialShop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSpecialShop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSpecialShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSpecialShop} ResSpecialShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSpecialShop.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.ResSpecialShop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Grade = reader.int32();
break;
}
case 2: {
message.Count = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSpecialShop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSpecialShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSpecialShop} ResSpecialShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSpecialShop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSpecialShop message.
* @function verify
* @memberof tutorial.ResSpecialShop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSpecialShop.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Grade != null && message.hasOwnProperty("Grade"))
if (!$util.isInteger(message.Grade))
return "Grade: integer expected";
if (message.Count != null && message.hasOwnProperty("Count"))
if (!$util.isInteger(message.Count))
return "Count: integer expected";
return null;
};
/**
* Creates a ResSpecialShop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSpecialShop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSpecialShop} ResSpecialShop
*/
ResSpecialShop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSpecialShop)
return object;
var message = new $root.tutorial.ResSpecialShop();
if (object.Grade != null)
message.Grade = object.Grade | 0;
if (object.Count != null)
message.Count = object.Count | 0;
return message;
};
/**
* Creates a plain object from a ResSpecialShop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSpecialShop
* @static
* @param {tutorial.ResSpecialShop} message ResSpecialShop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSpecialShop.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Grade = 0;
object.Count = 0;
}
if (message.Grade != null && message.hasOwnProperty("Grade"))
object.Grade = message.Grade;
if (message.Count != null && message.hasOwnProperty("Count"))
object.Count = message.Count;
return object;
};
/**
* Converts this ResSpecialShop to JSON.
* @function toJSON
* @memberof tutorial.ResSpecialShop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSpecialShop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSpecialShop
* @function getTypeUrl
* @memberof tutorial.ResSpecialShop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSpecialShop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSpecialShop";
};
return ResSpecialShop;
})();
tutorial.ResChessShop = (function() {
/**
* Properties of a ResChessShop.
* @memberof tutorial
* @interface IResChessShop
* @property {number|null} [Diamond] ResChessShop Diamond
* @property {number|null} [Count] ResChessShop Count
* @property {number|null} [ChessId] ResChessShop ChessId
*/
/**
* Constructs a new ResChessShop.
* @memberof tutorial
* @classdesc Represents a ResChessShop.
* @implements IResChessShop
* @constructor
* @param {tutorial.IResChessShop=} [properties] Properties to set
*/
function ResChessShop(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]];
}
/**
* ResChessShop Diamond.
* @member {number} Diamond
* @memberof tutorial.ResChessShop
* @instance
*/
ResChessShop.prototype.Diamond = 0;
/**
* ResChessShop Count.
* @member {number} Count
* @memberof tutorial.ResChessShop
* @instance
*/
ResChessShop.prototype.Count = 0;
/**
* ResChessShop ChessId.
* @member {number} ChessId
* @memberof tutorial.ResChessShop
* @instance
*/
ResChessShop.prototype.ChessId = 0;
/**
* Creates a new ResChessShop instance using the specified properties.
* @function create
* @memberof tutorial.ResChessShop
* @static
* @param {tutorial.IResChessShop=} [properties] Properties to set
* @returns {tutorial.ResChessShop} ResChessShop instance
*/
ResChessShop.create = function create(properties) {
return new ResChessShop(properties);
};
/**
* Encodes the specified ResChessShop message. Does not implicitly {@link tutorial.ResChessShop.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChessShop
* @static
* @param {tutorial.IResChessShop} message ResChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChessShop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Diamond != null && Object.hasOwnProperty.call(message, "Diamond"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Diamond);
if (message.Count != null && Object.hasOwnProperty.call(message, "Count"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Count);
if (message.ChessId != null && Object.hasOwnProperty.call(message, "ChessId"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ChessId);
return writer;
};
/**
* Encodes the specified ResChessShop message, length delimited. Does not implicitly {@link tutorial.ResChessShop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChessShop
* @static
* @param {tutorial.IResChessShop} message ResChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChessShop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChessShop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChessShop} ResChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChessShop.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.ResChessShop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Diamond = reader.int32();
break;
}
case 2: {
message.Count = reader.int32();
break;
}
case 3: {
message.ChessId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChessShop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChessShop} ResChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChessShop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChessShop message.
* @function verify
* @memberof tutorial.ResChessShop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChessShop.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Diamond != null && message.hasOwnProperty("Diamond"))
if (!$util.isInteger(message.Diamond))
return "Diamond: integer expected";
if (message.Count != null && message.hasOwnProperty("Count"))
if (!$util.isInteger(message.Count))
return "Count: integer expected";
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
if (!$util.isInteger(message.ChessId))
return "ChessId: integer expected";
return null;
};
/**
* Creates a ResChessShop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChessShop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChessShop} ResChessShop
*/
ResChessShop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChessShop)
return object;
var message = new $root.tutorial.ResChessShop();
if (object.Diamond != null)
message.Diamond = object.Diamond | 0;
if (object.Count != null)
message.Count = object.Count | 0;
if (object.ChessId != null)
message.ChessId = object.ChessId | 0;
return message;
};
/**
* Creates a plain object from a ResChessShop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChessShop
* @static
* @param {tutorial.ResChessShop} message ResChessShop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChessShop.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Diamond = 0;
object.Count = 0;
object.ChessId = 0;
}
if (message.Diamond != null && message.hasOwnProperty("Diamond"))
object.Diamond = message.Diamond;
if (message.Count != null && message.hasOwnProperty("Count"))
object.Count = message.Count;
if (message.ChessId != null && message.hasOwnProperty("ChessId"))
object.ChessId = message.ChessId;
return object;
};
/**
* Converts this ResChessShop to JSON.
* @function toJSON
* @memberof tutorial.ResChessShop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChessShop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChessShop
* @function getTypeUrl
* @memberof tutorial.ResChessShop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChessShop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChessShop";
};
return ResChessShop;
})();
tutorial.ReqFreeShop = (function() {
/**
* Properties of a ReqFreeShop.
* @memberof tutorial
* @interface IReqFreeShop
*/
/**
* Constructs a new ReqFreeShop.
* @memberof tutorial
* @classdesc Represents a ReqFreeShop.
* @implements IReqFreeShop
* @constructor
* @param {tutorial.IReqFreeShop=} [properties] Properties to set
*/
function ReqFreeShop(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]];
}
/**
* Creates a new ReqFreeShop instance using the specified properties.
* @function create
* @memberof tutorial.ReqFreeShop
* @static
* @param {tutorial.IReqFreeShop=} [properties] Properties to set
* @returns {tutorial.ReqFreeShop} ReqFreeShop instance
*/
ReqFreeShop.create = function create(properties) {
return new ReqFreeShop(properties);
};
/**
* Encodes the specified ReqFreeShop message. Does not implicitly {@link tutorial.ReqFreeShop.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFreeShop
* @static
* @param {tutorial.IReqFreeShop} message ReqFreeShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFreeShop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFreeShop message, length delimited. Does not implicitly {@link tutorial.ReqFreeShop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFreeShop
* @static
* @param {tutorial.IReqFreeShop} message ReqFreeShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFreeShop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFreeShop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFreeShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFreeShop} ReqFreeShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFreeShop.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.ReqFreeShop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFreeShop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFreeShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFreeShop} ReqFreeShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFreeShop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFreeShop message.
* @function verify
* @memberof tutorial.ReqFreeShop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFreeShop.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFreeShop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFreeShop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFreeShop} ReqFreeShop
*/
ReqFreeShop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFreeShop)
return object;
return new $root.tutorial.ReqFreeShop();
};
/**
* Creates a plain object from a ReqFreeShop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFreeShop
* @static
* @param {tutorial.ReqFreeShop} message ReqFreeShop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFreeShop.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFreeShop to JSON.
* @function toJSON
* @memberof tutorial.ReqFreeShop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFreeShop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFreeShop
* @function getTypeUrl
* @memberof tutorial.ReqFreeShop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFreeShop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFreeShop";
};
return ReqFreeShop;
})();
tutorial.ResFreeShop = (function() {
/**
* Properties of a ResFreeShop.
* @memberof tutorial
* @interface IResFreeShop
* @property {tutorial.RES_CODE|null} [Code] ResFreeShop Code
* @property {string|null} [Msg] ResFreeShop Msg
*/
/**
* Constructs a new ResFreeShop.
* @memberof tutorial
* @classdesc Represents a ResFreeShop.
* @implements IResFreeShop
* @constructor
* @param {tutorial.IResFreeShop=} [properties] Properties to set
*/
function ResFreeShop(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]];
}
/**
* ResFreeShop Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResFreeShop
* @instance
*/
ResFreeShop.prototype.Code = 0;
/**
* ResFreeShop Msg.
* @member {string} Msg
* @memberof tutorial.ResFreeShop
* @instance
*/
ResFreeShop.prototype.Msg = "";
/**
* Creates a new ResFreeShop instance using the specified properties.
* @function create
* @memberof tutorial.ResFreeShop
* @static
* @param {tutorial.IResFreeShop=} [properties] Properties to set
* @returns {tutorial.ResFreeShop} ResFreeShop instance
*/
ResFreeShop.create = function create(properties) {
return new ResFreeShop(properties);
};
/**
* Encodes the specified ResFreeShop message. Does not implicitly {@link tutorial.ResFreeShop.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFreeShop
* @static
* @param {tutorial.IResFreeShop} message ResFreeShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFreeShop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResFreeShop message, length delimited. Does not implicitly {@link tutorial.ResFreeShop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFreeShop
* @static
* @param {tutorial.IResFreeShop} message ResFreeShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFreeShop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFreeShop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFreeShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFreeShop} ResFreeShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFreeShop.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.ResFreeShop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFreeShop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFreeShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFreeShop} ResFreeShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFreeShop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFreeShop message.
* @function verify
* @memberof tutorial.ResFreeShop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFreeShop.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResFreeShop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFreeShop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFreeShop} ResFreeShop
*/
ResFreeShop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFreeShop)
return object;
var message = new $root.tutorial.ResFreeShop();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResFreeShop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFreeShop
* @static
* @param {tutorial.ResFreeShop} message ResFreeShop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFreeShop.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResFreeShop to JSON.
* @function toJSON
* @memberof tutorial.ResFreeShop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFreeShop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFreeShop
* @function getTypeUrl
* @memberof tutorial.ResFreeShop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFreeShop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFreeShop";
};
return ResFreeShop;
})();
tutorial.ReqBuyChessShop = (function() {
/**
* Properties of a ReqBuyChessShop.
* @memberof tutorial
* @interface IReqBuyChessShop
* @property {number|null} [Id] ReqBuyChessShop Id
*/
/**
* Constructs a new ReqBuyChessShop.
* @memberof tutorial
* @classdesc Represents a ReqBuyChessShop.
* @implements IReqBuyChessShop
* @constructor
* @param {tutorial.IReqBuyChessShop=} [properties] Properties to set
*/
function ReqBuyChessShop(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]];
}
/**
* ReqBuyChessShop Id.
* @member {number} Id
* @memberof tutorial.ReqBuyChessShop
* @instance
*/
ReqBuyChessShop.prototype.Id = 0;
/**
* Creates a new ReqBuyChessShop instance using the specified properties.
* @function create
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {tutorial.IReqBuyChessShop=} [properties] Properties to set
* @returns {tutorial.ReqBuyChessShop} ReqBuyChessShop instance
*/
ReqBuyChessShop.create = function create(properties) {
return new ReqBuyChessShop(properties);
};
/**
* Encodes the specified ReqBuyChessShop message. Does not implicitly {@link tutorial.ReqBuyChessShop.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {tutorial.IReqBuyChessShop} message ReqBuyChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBuyChessShop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqBuyChessShop message, length delimited. Does not implicitly {@link tutorial.ReqBuyChessShop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {tutorial.IReqBuyChessShop} message ReqBuyChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBuyChessShop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqBuyChessShop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqBuyChessShop} ReqBuyChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBuyChessShop.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.ReqBuyChessShop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqBuyChessShop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqBuyChessShop} ReqBuyChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBuyChessShop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqBuyChessShop message.
* @function verify
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqBuyChessShop.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqBuyChessShop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqBuyChessShop} ReqBuyChessShop
*/
ReqBuyChessShop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqBuyChessShop)
return object;
var message = new $root.tutorial.ReqBuyChessShop();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqBuyChessShop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {tutorial.ReqBuyChessShop} message ReqBuyChessShop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqBuyChessShop.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqBuyChessShop to JSON.
* @function toJSON
* @memberof tutorial.ReqBuyChessShop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqBuyChessShop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqBuyChessShop
* @function getTypeUrl
* @memberof tutorial.ReqBuyChessShop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqBuyChessShop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqBuyChessShop";
};
return ReqBuyChessShop;
})();
tutorial.ResBuyChessShop = (function() {
/**
* Properties of a ResBuyChessShop.
* @memberof tutorial
* @interface IResBuyChessShop
* @property {tutorial.RES_CODE|null} [Code] ResBuyChessShop Code
* @property {string|null} [Msg] ResBuyChessShop Msg
*/
/**
* Constructs a new ResBuyChessShop.
* @memberof tutorial
* @classdesc Represents a ResBuyChessShop.
* @implements IResBuyChessShop
* @constructor
* @param {tutorial.IResBuyChessShop=} [properties] Properties to set
*/
function ResBuyChessShop(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]];
}
/**
* ResBuyChessShop Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResBuyChessShop
* @instance
*/
ResBuyChessShop.prototype.Code = 0;
/**
* ResBuyChessShop Msg.
* @member {string} Msg
* @memberof tutorial.ResBuyChessShop
* @instance
*/
ResBuyChessShop.prototype.Msg = "";
/**
* Creates a new ResBuyChessShop instance using the specified properties.
* @function create
* @memberof tutorial.ResBuyChessShop
* @static
* @param {tutorial.IResBuyChessShop=} [properties] Properties to set
* @returns {tutorial.ResBuyChessShop} ResBuyChessShop instance
*/
ResBuyChessShop.create = function create(properties) {
return new ResBuyChessShop(properties);
};
/**
* Encodes the specified ResBuyChessShop message. Does not implicitly {@link tutorial.ResBuyChessShop.verify|verify} messages.
* @function encode
* @memberof tutorial.ResBuyChessShop
* @static
* @param {tutorial.IResBuyChessShop} message ResBuyChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBuyChessShop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResBuyChessShop message, length delimited. Does not implicitly {@link tutorial.ResBuyChessShop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResBuyChessShop
* @static
* @param {tutorial.IResBuyChessShop} message ResBuyChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBuyChessShop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResBuyChessShop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResBuyChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResBuyChessShop} ResBuyChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBuyChessShop.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.ResBuyChessShop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResBuyChessShop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResBuyChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResBuyChessShop} ResBuyChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBuyChessShop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResBuyChessShop message.
* @function verify
* @memberof tutorial.ResBuyChessShop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResBuyChessShop.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResBuyChessShop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResBuyChessShop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResBuyChessShop} ResBuyChessShop
*/
ResBuyChessShop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResBuyChessShop)
return object;
var message = new $root.tutorial.ResBuyChessShop();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResBuyChessShop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResBuyChessShop
* @static
* @param {tutorial.ResBuyChessShop} message ResBuyChessShop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResBuyChessShop.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResBuyChessShop to JSON.
* @function toJSON
* @memberof tutorial.ResBuyChessShop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResBuyChessShop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResBuyChessShop
* @function getTypeUrl
* @memberof tutorial.ResBuyChessShop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResBuyChessShop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResBuyChessShop";
};
return ResBuyChessShop;
})();
tutorial.ReqBuyChessShop2 = (function() {
/**
* Properties of a ReqBuyChessShop2.
* @memberof tutorial
* @interface IReqBuyChessShop2
* @property {number|null} [Id] ReqBuyChessShop2 Id
* @property {Object.<string,number>|null} [mChessData] ReqBuyChessShop2 mChessData
*/
/**
* Constructs a new ReqBuyChessShop2.
* @memberof tutorial
* @classdesc Represents a ReqBuyChessShop2.
* @implements IReqBuyChessShop2
* @constructor
* @param {tutorial.IReqBuyChessShop2=} [properties] Properties to set
*/
function ReqBuyChessShop2(properties) {
this.mChessData = {};
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]];
}
/**
* ReqBuyChessShop2 Id.
* @member {number} Id
* @memberof tutorial.ReqBuyChessShop2
* @instance
*/
ReqBuyChessShop2.prototype.Id = 0;
/**
* ReqBuyChessShop2 mChessData.
* @member {Object.<string,number>} mChessData
* @memberof tutorial.ReqBuyChessShop2
* @instance
*/
ReqBuyChessShop2.prototype.mChessData = $util.emptyObject;
/**
* Creates a new ReqBuyChessShop2 instance using the specified properties.
* @function create
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {tutorial.IReqBuyChessShop2=} [properties] Properties to set
* @returns {tutorial.ReqBuyChessShop2} ReqBuyChessShop2 instance
*/
ReqBuyChessShop2.create = function create(properties) {
return new ReqBuyChessShop2(properties);
};
/**
* Encodes the specified ReqBuyChessShop2 message. Does not implicitly {@link tutorial.ReqBuyChessShop2.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {tutorial.IReqBuyChessShop2} message ReqBuyChessShop2 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBuyChessShop2.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.mChessData != null && Object.hasOwnProperty.call(message, "mChessData"))
for (var keys = Object.keys(message.mChessData), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mChessData[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqBuyChessShop2 message, length delimited. Does not implicitly {@link tutorial.ReqBuyChessShop2.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {tutorial.IReqBuyChessShop2} message ReqBuyChessShop2 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqBuyChessShop2.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqBuyChessShop2 message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqBuyChessShop2} ReqBuyChessShop2
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBuyChessShop2.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.ReqBuyChessShop2(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
if (message.mChessData === $util.emptyObject)
message.mChessData = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.mChessData[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqBuyChessShop2 message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqBuyChessShop2} ReqBuyChessShop2
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqBuyChessShop2.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqBuyChessShop2 message.
* @function verify
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqBuyChessShop2.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))
return "Id: integer expected";
if (message.mChessData != null && message.hasOwnProperty("mChessData")) {
if (!$util.isObject(message.mChessData))
return "mChessData: object expected";
var key = Object.keys(message.mChessData);
for (var i = 0; i < key.length; ++i)
if (!$util.isInteger(message.mChessData[key[i]]))
return "mChessData: integer{k:string} expected";
}
return null;
};
/**
* Creates a ReqBuyChessShop2 message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqBuyChessShop2} ReqBuyChessShop2
*/
ReqBuyChessShop2.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqBuyChessShop2)
return object;
var message = new $root.tutorial.ReqBuyChessShop2();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.mChessData) {
if (typeof object.mChessData !== "object")
throw TypeError(".tutorial.ReqBuyChessShop2.mChessData: object expected");
message.mChessData = {};
for (var keys = Object.keys(object.mChessData), i = 0; i < keys.length; ++i)
message.mChessData[keys[i]] = object.mChessData[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqBuyChessShop2 message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {tutorial.ReqBuyChessShop2} message ReqBuyChessShop2
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqBuyChessShop2.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.mChessData = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
var keys2;
if (message.mChessData && (keys2 = Object.keys(message.mChessData)).length) {
object.mChessData = {};
for (var j = 0; j < keys2.length; ++j)
object.mChessData[keys2[j]] = message.mChessData[keys2[j]];
}
return object;
};
/**
* Converts this ReqBuyChessShop2 to JSON.
* @function toJSON
* @memberof tutorial.ReqBuyChessShop2
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqBuyChessShop2.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqBuyChessShop2
* @function getTypeUrl
* @memberof tutorial.ReqBuyChessShop2
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqBuyChessShop2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqBuyChessShop2";
};
return ReqBuyChessShop2;
})();
tutorial.ResBuyChessShop2 = (function() {
/**
* Properties of a ResBuyChessShop2.
* @memberof tutorial
* @interface IResBuyChessShop2
* @property {tutorial.RES_CODE|null} [Code] ResBuyChessShop2 Code
* @property {string|null} [Msg] ResBuyChessShop2 Msg
*/
/**
* Constructs a new ResBuyChessShop2.
* @memberof tutorial
* @classdesc Represents a ResBuyChessShop2.
* @implements IResBuyChessShop2
* @constructor
* @param {tutorial.IResBuyChessShop2=} [properties] Properties to set
*/
function ResBuyChessShop2(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]];
}
/**
* ResBuyChessShop2 Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResBuyChessShop2
* @instance
*/
ResBuyChessShop2.prototype.Code = 0;
/**
* ResBuyChessShop2 Msg.
* @member {string} Msg
* @memberof tutorial.ResBuyChessShop2
* @instance
*/
ResBuyChessShop2.prototype.Msg = "";
/**
* Creates a new ResBuyChessShop2 instance using the specified properties.
* @function create
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {tutorial.IResBuyChessShop2=} [properties] Properties to set
* @returns {tutorial.ResBuyChessShop2} ResBuyChessShop2 instance
*/
ResBuyChessShop2.create = function create(properties) {
return new ResBuyChessShop2(properties);
};
/**
* Encodes the specified ResBuyChessShop2 message. Does not implicitly {@link tutorial.ResBuyChessShop2.verify|verify} messages.
* @function encode
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {tutorial.IResBuyChessShop2} message ResBuyChessShop2 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBuyChessShop2.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResBuyChessShop2 message, length delimited. Does not implicitly {@link tutorial.ResBuyChessShop2.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {tutorial.IResBuyChessShop2} message ResBuyChessShop2 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResBuyChessShop2.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResBuyChessShop2 message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResBuyChessShop2} ResBuyChessShop2
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBuyChessShop2.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.ResBuyChessShop2();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResBuyChessShop2 message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResBuyChessShop2} ResBuyChessShop2
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResBuyChessShop2.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResBuyChessShop2 message.
* @function verify
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResBuyChessShop2.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResBuyChessShop2 message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResBuyChessShop2} ResBuyChessShop2
*/
ResBuyChessShop2.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResBuyChessShop2)
return object;
var message = new $root.tutorial.ResBuyChessShop2();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResBuyChessShop2 message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {tutorial.ResBuyChessShop2} message ResBuyChessShop2
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResBuyChessShop2.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResBuyChessShop2 to JSON.
* @function toJSON
* @memberof tutorial.ResBuyChessShop2
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResBuyChessShop2.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResBuyChessShop2
* @function getTypeUrl
* @memberof tutorial.ResBuyChessShop2
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResBuyChessShop2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResBuyChessShop2";
};
return ResBuyChessShop2;
})();
tutorial.ReqRefreshChessShop = (function() {
/**
* Properties of a ReqRefreshChessShop.
* @memberof tutorial
* @interface IReqRefreshChessShop
*/
/**
* Constructs a new ReqRefreshChessShop.
* @memberof tutorial
* @classdesc Represents a ReqRefreshChessShop.
* @implements IReqRefreshChessShop
* @constructor
* @param {tutorial.IReqRefreshChessShop=} [properties] Properties to set
*/
function ReqRefreshChessShop(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]];
}
/**
* Creates a new ReqRefreshChessShop instance using the specified properties.
* @function create
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {tutorial.IReqRefreshChessShop=} [properties] Properties to set
* @returns {tutorial.ReqRefreshChessShop} ReqRefreshChessShop instance
*/
ReqRefreshChessShop.create = function create(properties) {
return new ReqRefreshChessShop(properties);
};
/**
* Encodes the specified ReqRefreshChessShop message. Does not implicitly {@link tutorial.ReqRefreshChessShop.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {tutorial.IReqRefreshChessShop} message ReqRefreshChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefreshChessShop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqRefreshChessShop message, length delimited. Does not implicitly {@link tutorial.ReqRefreshChessShop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {tutorial.IReqRefreshChessShop} message ReqRefreshChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRefreshChessShop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRefreshChessShop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRefreshChessShop} ReqRefreshChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefreshChessShop.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.ReqRefreshChessShop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRefreshChessShop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRefreshChessShop} ReqRefreshChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRefreshChessShop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRefreshChessShop message.
* @function verify
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRefreshChessShop.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqRefreshChessShop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRefreshChessShop} ReqRefreshChessShop
*/
ReqRefreshChessShop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRefreshChessShop)
return object;
return new $root.tutorial.ReqRefreshChessShop();
};
/**
* Creates a plain object from a ReqRefreshChessShop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {tutorial.ReqRefreshChessShop} message ReqRefreshChessShop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRefreshChessShop.toObject = function toObject() {
return {};
};
/**
* Converts this ReqRefreshChessShop to JSON.
* @function toJSON
* @memberof tutorial.ReqRefreshChessShop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRefreshChessShop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRefreshChessShop
* @function getTypeUrl
* @memberof tutorial.ReqRefreshChessShop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRefreshChessShop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRefreshChessShop";
};
return ReqRefreshChessShop;
})();
tutorial.ResRefreshChessShop = (function() {
/**
* Properties of a ResRefreshChessShop.
* @memberof tutorial
* @interface IResRefreshChessShop
* @property {tutorial.RES_CODE|null} [Code] ResRefreshChessShop Code
* @property {string|null} [Msg] ResRefreshChessShop Msg
*/
/**
* Constructs a new ResRefreshChessShop.
* @memberof tutorial
* @classdesc Represents a ResRefreshChessShop.
* @implements IResRefreshChessShop
* @constructor
* @param {tutorial.IResRefreshChessShop=} [properties] Properties to set
*/
function ResRefreshChessShop(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]];
}
/**
* ResRefreshChessShop Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResRefreshChessShop
* @instance
*/
ResRefreshChessShop.prototype.Code = 0;
/**
* ResRefreshChessShop Msg.
* @member {string} Msg
* @memberof tutorial.ResRefreshChessShop
* @instance
*/
ResRefreshChessShop.prototype.Msg = "";
/**
* Creates a new ResRefreshChessShop instance using the specified properties.
* @function create
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {tutorial.IResRefreshChessShop=} [properties] Properties to set
* @returns {tutorial.ResRefreshChessShop} ResRefreshChessShop instance
*/
ResRefreshChessShop.create = function create(properties) {
return new ResRefreshChessShop(properties);
};
/**
* Encodes the specified ResRefreshChessShop message. Does not implicitly {@link tutorial.ResRefreshChessShop.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {tutorial.IResRefreshChessShop} message ResRefreshChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefreshChessShop.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResRefreshChessShop message, length delimited. Does not implicitly {@link tutorial.ResRefreshChessShop.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {tutorial.IResRefreshChessShop} message ResRefreshChessShop message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRefreshChessShop.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRefreshChessShop message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRefreshChessShop} ResRefreshChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefreshChessShop.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.ResRefreshChessShop();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRefreshChessShop message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRefreshChessShop} ResRefreshChessShop
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRefreshChessShop.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRefreshChessShop message.
* @function verify
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRefreshChessShop.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResRefreshChessShop message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRefreshChessShop} ResRefreshChessShop
*/
ResRefreshChessShop.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRefreshChessShop)
return object;
var message = new $root.tutorial.ResRefreshChessShop();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResRefreshChessShop message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {tutorial.ResRefreshChessShop} message ResRefreshChessShop
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRefreshChessShop.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResRefreshChessShop to JSON.
* @function toJSON
* @memberof tutorial.ResRefreshChessShop
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRefreshChessShop.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRefreshChessShop
* @function getTypeUrl
* @memberof tutorial.ResRefreshChessShop
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRefreshChessShop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRefreshChessShop";
};
return ResRefreshChessShop;
})();
tutorial.ReqEndless = (function() {
/**
* Properties of a ReqEndless.
* @memberof tutorial
* @interface IReqEndless
*/
/**
* Constructs a new ReqEndless.
* @memberof tutorial
* @classdesc Represents a ReqEndless.
* @implements IReqEndless
* @constructor
* @param {tutorial.IReqEndless=} [properties] Properties to set
*/
function ReqEndless(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]];
}
/**
* Creates a new ReqEndless instance using the specified properties.
* @function create
* @memberof tutorial.ReqEndless
* @static
* @param {tutorial.IReqEndless=} [properties] Properties to set
* @returns {tutorial.ReqEndless} ReqEndless instance
*/
ReqEndless.create = function create(properties) {
return new ReqEndless(properties);
};
/**
* Encodes the specified ReqEndless message. Does not implicitly {@link tutorial.ReqEndless.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqEndless
* @static
* @param {tutorial.IReqEndless} message ReqEndless message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqEndless.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqEndless message, length delimited. Does not implicitly {@link tutorial.ReqEndless.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqEndless
* @static
* @param {tutorial.IReqEndless} message ReqEndless message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqEndless.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqEndless message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqEndless
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqEndless} ReqEndless
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqEndless.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.ReqEndless();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqEndless message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqEndless
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqEndless} ReqEndless
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqEndless.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqEndless message.
* @function verify
* @memberof tutorial.ReqEndless
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqEndless.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqEndless message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqEndless
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqEndless} ReqEndless
*/
ReqEndless.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqEndless)
return object;
return new $root.tutorial.ReqEndless();
};
/**
* Creates a plain object from a ReqEndless message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqEndless
* @static
* @param {tutorial.ReqEndless} message ReqEndless
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqEndless.toObject = function toObject() {
return {};
};
/**
* Converts this ReqEndless to JSON.
* @function toJSON
* @memberof tutorial.ReqEndless
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqEndless.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqEndless
* @function getTypeUrl
* @memberof tutorial.ReqEndless
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqEndless.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqEndless";
};
return ReqEndless;
})();
tutorial.ResEndless = (function() {
/**
* Properties of a ResEndless.
* @memberof tutorial
* @interface IResEndless
* @property {number|null} [Id] ResEndless Id
* @property {Object.<string,tutorial.IResEndlessInfo>|null} [EndlessList] ResEndless EndlessList
*/
/**
* Constructs a new ResEndless.
* @memberof tutorial
* @classdesc Represents a ResEndless.
* @implements IResEndless
* @constructor
* @param {tutorial.IResEndless=} [properties] Properties to set
*/
function ResEndless(properties) {
this.EndlessList = {};
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]];
}
/**
* ResEndless Id.
* @member {number} Id
* @memberof tutorial.ResEndless
* @instance
*/
ResEndless.prototype.Id = 0;
/**
* ResEndless EndlessList.
* @member {Object.<string,tutorial.IResEndlessInfo>} EndlessList
* @memberof tutorial.ResEndless
* @instance
*/
ResEndless.prototype.EndlessList = $util.emptyObject;
/**
* Creates a new ResEndless instance using the specified properties.
* @function create
* @memberof tutorial.ResEndless
* @static
* @param {tutorial.IResEndless=} [properties] Properties to set
* @returns {tutorial.ResEndless} ResEndless instance
*/
ResEndless.create = function create(properties) {
return new ResEndless(properties);
};
/**
* Encodes the specified ResEndless message. Does not implicitly {@link tutorial.ResEndless.verify|verify} messages.
* @function encode
* @memberof tutorial.ResEndless
* @static
* @param {tutorial.IResEndless} message ResEndless message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResEndless.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.EndlessList != null && Object.hasOwnProperty.call(message, "EndlessList"))
for (var keys = Object.keys(message.EndlessList), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.ResEndlessInfo.encode(message.EndlessList[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
return writer;
};
/**
* Encodes the specified ResEndless message, length delimited. Does not implicitly {@link tutorial.ResEndless.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResEndless
* @static
* @param {tutorial.IResEndless} message ResEndless message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResEndless.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResEndless message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResEndless
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResEndless} ResEndless
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResEndless.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.ResEndless(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
if (message.EndlessList === $util.emptyObject)
message.EndlessList = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.ResEndlessInfo.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.EndlessList[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResEndless message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResEndless
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResEndless} ResEndless
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResEndless.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResEndless message.
* @function verify
* @memberof tutorial.ResEndless
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResEndless.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))
return "Id: integer expected";
if (message.EndlessList != null && message.hasOwnProperty("EndlessList")) {
if (!$util.isObject(message.EndlessList))
return "EndlessList: object expected";
var key = Object.keys(message.EndlessList);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "EndlessList: integer key{k:int32} expected";
{
var error = $root.tutorial.ResEndlessInfo.verify(message.EndlessList[key[i]]);
if (error)
return "EndlessList." + error;
}
}
}
return null;
};
/**
* Creates a ResEndless message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResEndless
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResEndless} ResEndless
*/
ResEndless.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResEndless)
return object;
var message = new $root.tutorial.ResEndless();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.EndlessList) {
if (typeof object.EndlessList !== "object")
throw TypeError(".tutorial.ResEndless.EndlessList: object expected");
message.EndlessList = {};
for (var keys = Object.keys(object.EndlessList), i = 0; i < keys.length; ++i) {
if (typeof object.EndlessList[keys[i]] !== "object")
throw TypeError(".tutorial.ResEndless.EndlessList: object expected");
message.EndlessList[keys[i]] = $root.tutorial.ResEndlessInfo.fromObject(object.EndlessList[keys[i]]);
}
}
return message;
};
/**
* Creates a plain object from a ResEndless message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResEndless
* @static
* @param {tutorial.ResEndless} message ResEndless
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResEndless.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.EndlessList = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
var keys2;
if (message.EndlessList && (keys2 = Object.keys(message.EndlessList)).length) {
object.EndlessList = {};
for (var j = 0; j < keys2.length; ++j)
object.EndlessList[keys2[j]] = $root.tutorial.ResEndlessInfo.toObject(message.EndlessList[keys2[j]], options);
}
return object;
};
/**
* Converts this ResEndless to JSON.
* @function toJSON
* @memberof tutorial.ResEndless
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResEndless.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResEndless
* @function getTypeUrl
* @memberof tutorial.ResEndless
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResEndless.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResEndless";
};
return ResEndless;
})();
tutorial.ResEndlessInfo = (function() {
/**
* Properties of a ResEndlessInfo.
* @memberof tutorial
* @interface IResEndlessInfo
* @property {number|null} [ChargeId] ResEndlessInfo ChargeId
* @property {number|null} [Type] ResEndlessInfo Type
* @property {Array.<tutorial.IItemInfo>|null} [Items] ResEndlessInfo Items
*/
/**
* Constructs a new ResEndlessInfo.
* @memberof tutorial
* @classdesc Represents a ResEndlessInfo.
* @implements IResEndlessInfo
* @constructor
* @param {tutorial.IResEndlessInfo=} [properties] Properties to set
*/
function ResEndlessInfo(properties) {
this.Items = [];
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]];
}
/**
* ResEndlessInfo ChargeId.
* @member {number} ChargeId
* @memberof tutorial.ResEndlessInfo
* @instance
*/
ResEndlessInfo.prototype.ChargeId = 0;
/**
* ResEndlessInfo Type.
* @member {number} Type
* @memberof tutorial.ResEndlessInfo
* @instance
*/
ResEndlessInfo.prototype.Type = 0;
/**
* ResEndlessInfo Items.
* @member {Array.<tutorial.IItemInfo>} Items
* @memberof tutorial.ResEndlessInfo
* @instance
*/
ResEndlessInfo.prototype.Items = $util.emptyArray;
/**
* Creates a new ResEndlessInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResEndlessInfo
* @static
* @param {tutorial.IResEndlessInfo=} [properties] Properties to set
* @returns {tutorial.ResEndlessInfo} ResEndlessInfo instance
*/
ResEndlessInfo.create = function create(properties) {
return new ResEndlessInfo(properties);
};
/**
* Encodes the specified ResEndlessInfo message. Does not implicitly {@link tutorial.ResEndlessInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResEndlessInfo
* @static
* @param {tutorial.IResEndlessInfo} message ResEndlessInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResEndlessInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ChargeId != null && Object.hasOwnProperty.call(message, "ChargeId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ChargeId);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Type);
if (message.Items != null && message.Items.length)
for (var i = 0; i < message.Items.length; ++i)
$root.tutorial.ItemInfo.encode(message.Items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResEndlessInfo message, length delimited. Does not implicitly {@link tutorial.ResEndlessInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResEndlessInfo
* @static
* @param {tutorial.IResEndlessInfo} message ResEndlessInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResEndlessInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResEndlessInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResEndlessInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResEndlessInfo} ResEndlessInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResEndlessInfo.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.ResEndlessInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ChargeId = reader.int32();
break;
}
case 2: {
message.Type = reader.int32();
break;
}
case 3: {
if (!(message.Items && message.Items.length))
message.Items = [];
message.Items.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResEndlessInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResEndlessInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResEndlessInfo} ResEndlessInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResEndlessInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResEndlessInfo message.
* @function verify
* @memberof tutorial.ResEndlessInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResEndlessInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ChargeId != null && message.hasOwnProperty("ChargeId"))
if (!$util.isInteger(message.ChargeId))
return "ChargeId: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!Array.isArray(message.Items))
return "Items: array expected";
for (var i = 0; i < message.Items.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Items[i]);
if (error)
return "Items." + error;
}
}
return null;
};
/**
* Creates a ResEndlessInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResEndlessInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResEndlessInfo} ResEndlessInfo
*/
ResEndlessInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResEndlessInfo)
return object;
var message = new $root.tutorial.ResEndlessInfo();
if (object.ChargeId != null)
message.ChargeId = object.ChargeId | 0;
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Items) {
if (!Array.isArray(object.Items))
throw TypeError(".tutorial.ResEndlessInfo.Items: array expected");
message.Items = [];
for (var i = 0; i < object.Items.length; ++i) {
if (typeof object.Items[i] !== "object")
throw TypeError(".tutorial.ResEndlessInfo.Items: object expected");
message.Items[i] = $root.tutorial.ItemInfo.fromObject(object.Items[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResEndlessInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResEndlessInfo
* @static
* @param {tutorial.ResEndlessInfo} message ResEndlessInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResEndlessInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Items = [];
if (options.defaults) {
object.ChargeId = 0;
object.Type = 0;
}
if (message.ChargeId != null && message.hasOwnProperty("ChargeId"))
object.ChargeId = message.ChargeId;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.Items && message.Items.length) {
object.Items = [];
for (var j = 0; j < message.Items.length; ++j)
object.Items[j] = $root.tutorial.ItemInfo.toObject(message.Items[j], options);
}
return object;
};
/**
* Converts this ResEndlessInfo to JSON.
* @function toJSON
* @memberof tutorial.ResEndlessInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResEndlessInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResEndlessInfo
* @function getTypeUrl
* @memberof tutorial.ResEndlessInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResEndlessInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResEndlessInfo";
};
return ResEndlessInfo;
})();
tutorial.ReqEndlessReward = (function() {
/**
* Properties of a ReqEndlessReward.
* @memberof tutorial
* @interface IReqEndlessReward
*/
/**
* Constructs a new ReqEndlessReward.
* @memberof tutorial
* @classdesc Represents a ReqEndlessReward.
* @implements IReqEndlessReward
* @constructor
* @param {tutorial.IReqEndlessReward=} [properties] Properties to set
*/
function ReqEndlessReward(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]];
}
/**
* Creates a new ReqEndlessReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqEndlessReward
* @static
* @param {tutorial.IReqEndlessReward=} [properties] Properties to set
* @returns {tutorial.ReqEndlessReward} ReqEndlessReward instance
*/
ReqEndlessReward.create = function create(properties) {
return new ReqEndlessReward(properties);
};
/**
* Encodes the specified ReqEndlessReward message. Does not implicitly {@link tutorial.ReqEndlessReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqEndlessReward
* @static
* @param {tutorial.IReqEndlessReward} message ReqEndlessReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqEndlessReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqEndlessReward message, length delimited. Does not implicitly {@link tutorial.ReqEndlessReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqEndlessReward
* @static
* @param {tutorial.IReqEndlessReward} message ReqEndlessReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqEndlessReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqEndlessReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqEndlessReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqEndlessReward} ReqEndlessReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqEndlessReward.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.ReqEndlessReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqEndlessReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqEndlessReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqEndlessReward} ReqEndlessReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqEndlessReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqEndlessReward message.
* @function verify
* @memberof tutorial.ReqEndlessReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqEndlessReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqEndlessReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqEndlessReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqEndlessReward} ReqEndlessReward
*/
ReqEndlessReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqEndlessReward)
return object;
return new $root.tutorial.ReqEndlessReward();
};
/**
* Creates a plain object from a ReqEndlessReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqEndlessReward
* @static
* @param {tutorial.ReqEndlessReward} message ReqEndlessReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqEndlessReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqEndlessReward to JSON.
* @function toJSON
* @memberof tutorial.ReqEndlessReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqEndlessReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqEndlessReward
* @function getTypeUrl
* @memberof tutorial.ReqEndlessReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqEndlessReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqEndlessReward";
};
return ReqEndlessReward;
})();
tutorial.ResEndlessReward = (function() {
/**
* Properties of a ResEndlessReward.
* @memberof tutorial
* @interface IResEndlessReward
* @property {tutorial.RES_CODE|null} [Code] ResEndlessReward Code
* @property {string|null} [Msg] ResEndlessReward Msg
*/
/**
* Constructs a new ResEndlessReward.
* @memberof tutorial
* @classdesc Represents a ResEndlessReward.
* @implements IResEndlessReward
* @constructor
* @param {tutorial.IResEndlessReward=} [properties] Properties to set
*/
function ResEndlessReward(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]];
}
/**
* ResEndlessReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResEndlessReward
* @instance
*/
ResEndlessReward.prototype.Code = 0;
/**
* ResEndlessReward Msg.
* @member {string} Msg
* @memberof tutorial.ResEndlessReward
* @instance
*/
ResEndlessReward.prototype.Msg = "";
/**
* Creates a new ResEndlessReward instance using the specified properties.
* @function create
* @memberof tutorial.ResEndlessReward
* @static
* @param {tutorial.IResEndlessReward=} [properties] Properties to set
* @returns {tutorial.ResEndlessReward} ResEndlessReward instance
*/
ResEndlessReward.create = function create(properties) {
return new ResEndlessReward(properties);
};
/**
* Encodes the specified ResEndlessReward message. Does not implicitly {@link tutorial.ResEndlessReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResEndlessReward
* @static
* @param {tutorial.IResEndlessReward} message ResEndlessReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResEndlessReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResEndlessReward message, length delimited. Does not implicitly {@link tutorial.ResEndlessReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResEndlessReward
* @static
* @param {tutorial.IResEndlessReward} message ResEndlessReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResEndlessReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResEndlessReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResEndlessReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResEndlessReward} ResEndlessReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResEndlessReward.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.ResEndlessReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResEndlessReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResEndlessReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResEndlessReward} ResEndlessReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResEndlessReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResEndlessReward message.
* @function verify
* @memberof tutorial.ResEndlessReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResEndlessReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResEndlessReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResEndlessReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResEndlessReward} ResEndlessReward
*/
ResEndlessReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResEndlessReward)
return object;
var message = new $root.tutorial.ResEndlessReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResEndlessReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResEndlessReward
* @static
* @param {tutorial.ResEndlessReward} message ResEndlessReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResEndlessReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResEndlessReward to JSON.
* @function toJSON
* @memberof tutorial.ResEndlessReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResEndlessReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResEndlessReward
* @function getTypeUrl
* @memberof tutorial.ResEndlessReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResEndlessReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResEndlessReward";
};
return ResEndlessReward;
})();
tutorial.ResPiggyBank = (function() {
/**
* Properties of a ResPiggyBank.
* @memberof tutorial
* @interface IResPiggyBank
* @property {number|null} [Type] ResPiggyBank Type
* @property {number|null} [Diamond] ResPiggyBank Diamond
* @property {number|null} [Count] ResPiggyBank Count
* @property {number|null} [EndTime] ResPiggyBank EndTime
*/
/**
* Constructs a new ResPiggyBank.
* @memberof tutorial
* @classdesc Represents a ResPiggyBank.
* @implements IResPiggyBank
* @constructor
* @param {tutorial.IResPiggyBank=} [properties] Properties to set
*/
function ResPiggyBank(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]];
}
/**
* ResPiggyBank Type.
* @member {number} Type
* @memberof tutorial.ResPiggyBank
* @instance
*/
ResPiggyBank.prototype.Type = 0;
/**
* ResPiggyBank Diamond.
* @member {number} Diamond
* @memberof tutorial.ResPiggyBank
* @instance
*/
ResPiggyBank.prototype.Diamond = 0;
/**
* ResPiggyBank Count.
* @member {number} Count
* @memberof tutorial.ResPiggyBank
* @instance
*/
ResPiggyBank.prototype.Count = 0;
/**
* ResPiggyBank EndTime.
* @member {number} EndTime
* @memberof tutorial.ResPiggyBank
* @instance
*/
ResPiggyBank.prototype.EndTime = 0;
/**
* Creates a new ResPiggyBank instance using the specified properties.
* @function create
* @memberof tutorial.ResPiggyBank
* @static
* @param {tutorial.IResPiggyBank=} [properties] Properties to set
* @returns {tutorial.ResPiggyBank} ResPiggyBank instance
*/
ResPiggyBank.create = function create(properties) {
return new ResPiggyBank(properties);
};
/**
* Encodes the specified ResPiggyBank message. Does not implicitly {@link tutorial.ResPiggyBank.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPiggyBank
* @static
* @param {tutorial.IResPiggyBank} message ResPiggyBank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPiggyBank.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Type);
if (message.Diamond != null && Object.hasOwnProperty.call(message, "Diamond"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Diamond);
if (message.Count != null && Object.hasOwnProperty.call(message, "Count"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Count);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.EndTime);
return writer;
};
/**
* Encodes the specified ResPiggyBank message, length delimited. Does not implicitly {@link tutorial.ResPiggyBank.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPiggyBank
* @static
* @param {tutorial.IResPiggyBank} message ResPiggyBank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPiggyBank.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPiggyBank message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPiggyBank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPiggyBank} ResPiggyBank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPiggyBank.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.ResPiggyBank();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Type = reader.int32();
break;
}
case 2: {
message.Diamond = reader.int32();
break;
}
case 3: {
message.Count = reader.int32();
break;
}
case 4: {
message.EndTime = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPiggyBank message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPiggyBank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPiggyBank} ResPiggyBank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPiggyBank.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPiggyBank message.
* @function verify
* @memberof tutorial.ResPiggyBank
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPiggyBank.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Diamond != null && message.hasOwnProperty("Diamond"))
if (!$util.isInteger(message.Diamond))
return "Diamond: integer expected";
if (message.Count != null && message.hasOwnProperty("Count"))
if (!$util.isInteger(message.Count))
return "Count: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
return null;
};
/**
* Creates a ResPiggyBank message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPiggyBank
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPiggyBank} ResPiggyBank
*/
ResPiggyBank.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPiggyBank)
return object;
var message = new $root.tutorial.ResPiggyBank();
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Diamond != null)
message.Diamond = object.Diamond | 0;
if (object.Count != null)
message.Count = object.Count | 0;
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
return message;
};
/**
* Creates a plain object from a ResPiggyBank message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPiggyBank
* @static
* @param {tutorial.ResPiggyBank} message ResPiggyBank
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPiggyBank.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Type = 0;
object.Diamond = 0;
object.Count = 0;
object.EndTime = 0;
}
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.Diamond != null && message.hasOwnProperty("Diamond"))
object.Diamond = message.Diamond;
if (message.Count != null && message.hasOwnProperty("Count"))
object.Count = message.Count;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
return object;
};
/**
* Converts this ResPiggyBank to JSON.
* @function toJSON
* @memberof tutorial.ResPiggyBank
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPiggyBank.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPiggyBank
* @function getTypeUrl
* @memberof tutorial.ResPiggyBank
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPiggyBank.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPiggyBank";
};
return ResPiggyBank;
})();
tutorial.ReqPiggyBankReward = (function() {
/**
* Properties of a ReqPiggyBankReward.
* @memberof tutorial
* @interface IReqPiggyBankReward
*/
/**
* Constructs a new ReqPiggyBankReward.
* @memberof tutorial
* @classdesc Represents a ReqPiggyBankReward.
* @implements IReqPiggyBankReward
* @constructor
* @param {tutorial.IReqPiggyBankReward=} [properties] Properties to set
*/
function ReqPiggyBankReward(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]];
}
/**
* Creates a new ReqPiggyBankReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {tutorial.IReqPiggyBankReward=} [properties] Properties to set
* @returns {tutorial.ReqPiggyBankReward} ReqPiggyBankReward instance
*/
ReqPiggyBankReward.create = function create(properties) {
return new ReqPiggyBankReward(properties);
};
/**
* Encodes the specified ReqPiggyBankReward message. Does not implicitly {@link tutorial.ReqPiggyBankReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {tutorial.IReqPiggyBankReward} message ReqPiggyBankReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPiggyBankReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqPiggyBankReward message, length delimited. Does not implicitly {@link tutorial.ReqPiggyBankReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {tutorial.IReqPiggyBankReward} message ReqPiggyBankReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPiggyBankReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPiggyBankReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPiggyBankReward} ReqPiggyBankReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPiggyBankReward.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.ReqPiggyBankReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPiggyBankReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPiggyBankReward} ReqPiggyBankReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPiggyBankReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPiggyBankReward message.
* @function verify
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPiggyBankReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqPiggyBankReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPiggyBankReward} ReqPiggyBankReward
*/
ReqPiggyBankReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPiggyBankReward)
return object;
return new $root.tutorial.ReqPiggyBankReward();
};
/**
* Creates a plain object from a ReqPiggyBankReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {tutorial.ReqPiggyBankReward} message ReqPiggyBankReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPiggyBankReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqPiggyBankReward to JSON.
* @function toJSON
* @memberof tutorial.ReqPiggyBankReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPiggyBankReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPiggyBankReward
* @function getTypeUrl
* @memberof tutorial.ReqPiggyBankReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPiggyBankReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPiggyBankReward";
};
return ReqPiggyBankReward;
})();
tutorial.ResPiggyBankReward = (function() {
/**
* Properties of a ResPiggyBankReward.
* @memberof tutorial
* @interface IResPiggyBankReward
* @property {tutorial.RES_CODE|null} [Code] ResPiggyBankReward Code
* @property {string|null} [Msg] ResPiggyBankReward Msg
*/
/**
* Constructs a new ResPiggyBankReward.
* @memberof tutorial
* @classdesc Represents a ResPiggyBankReward.
* @implements IResPiggyBankReward
* @constructor
* @param {tutorial.IResPiggyBankReward=} [properties] Properties to set
*/
function ResPiggyBankReward(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]];
}
/**
* ResPiggyBankReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPiggyBankReward
* @instance
*/
ResPiggyBankReward.prototype.Code = 0;
/**
* ResPiggyBankReward Msg.
* @member {string} Msg
* @memberof tutorial.ResPiggyBankReward
* @instance
*/
ResPiggyBankReward.prototype.Msg = "";
/**
* Creates a new ResPiggyBankReward instance using the specified properties.
* @function create
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {tutorial.IResPiggyBankReward=} [properties] Properties to set
* @returns {tutorial.ResPiggyBankReward} ResPiggyBankReward instance
*/
ResPiggyBankReward.create = function create(properties) {
return new ResPiggyBankReward(properties);
};
/**
* Encodes the specified ResPiggyBankReward message. Does not implicitly {@link tutorial.ResPiggyBankReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {tutorial.IResPiggyBankReward} message ResPiggyBankReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPiggyBankReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPiggyBankReward message, length delimited. Does not implicitly {@link tutorial.ResPiggyBankReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {tutorial.IResPiggyBankReward} message ResPiggyBankReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPiggyBankReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPiggyBankReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPiggyBankReward} ResPiggyBankReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPiggyBankReward.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.ResPiggyBankReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPiggyBankReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPiggyBankReward} ResPiggyBankReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPiggyBankReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPiggyBankReward message.
* @function verify
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPiggyBankReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPiggyBankReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPiggyBankReward} ResPiggyBankReward
*/
ResPiggyBankReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPiggyBankReward)
return object;
var message = new $root.tutorial.ResPiggyBankReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPiggyBankReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {tutorial.ResPiggyBankReward} message ResPiggyBankReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPiggyBankReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPiggyBankReward to JSON.
* @function toJSON
* @memberof tutorial.ResPiggyBankReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPiggyBankReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPiggyBankReward
* @function getTypeUrl
* @memberof tutorial.ResPiggyBankReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPiggyBankReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPiggyBankReward";
};
return ResPiggyBankReward;
})();
tutorial.ReqCreateOrderSn = (function() {
/**
* Properties of a ReqCreateOrderSn.
* @memberof tutorial
* @interface IReqCreateOrderSn
* @property {number|null} [ChargeId] ReqCreateOrderSn ChargeId
* @property {string|null} [PlatForm] ReqCreateOrderSn PlatForm
* @property {string|null} [channel] ReqCreateOrderSn channel
*/
/**
* Constructs a new ReqCreateOrderSn.
* @memberof tutorial
* @classdesc Represents a ReqCreateOrderSn.
* @implements IReqCreateOrderSn
* @constructor
* @param {tutorial.IReqCreateOrderSn=} [properties] Properties to set
*/
function ReqCreateOrderSn(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]];
}
/**
* ReqCreateOrderSn ChargeId.
* @member {number} ChargeId
* @memberof tutorial.ReqCreateOrderSn
* @instance
*/
ReqCreateOrderSn.prototype.ChargeId = 0;
/**
* ReqCreateOrderSn PlatForm.
* @member {string} PlatForm
* @memberof tutorial.ReqCreateOrderSn
* @instance
*/
ReqCreateOrderSn.prototype.PlatForm = "";
/**
* ReqCreateOrderSn channel.
* @member {string} channel
* @memberof tutorial.ReqCreateOrderSn
* @instance
*/
ReqCreateOrderSn.prototype.channel = "";
/**
* Creates a new ReqCreateOrderSn instance using the specified properties.
* @function create
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {tutorial.IReqCreateOrderSn=} [properties] Properties to set
* @returns {tutorial.ReqCreateOrderSn} ReqCreateOrderSn instance
*/
ReqCreateOrderSn.create = function create(properties) {
return new ReqCreateOrderSn(properties);
};
/**
* Encodes the specified ReqCreateOrderSn message. Does not implicitly {@link tutorial.ReqCreateOrderSn.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {tutorial.IReqCreateOrderSn} message ReqCreateOrderSn message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCreateOrderSn.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ChargeId != null && Object.hasOwnProperty.call(message, "ChargeId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ChargeId);
if (message.PlatForm != null && Object.hasOwnProperty.call(message, "PlatForm"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.PlatForm);
if (message.channel != null && Object.hasOwnProperty.call(message, "channel"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.channel);
return writer;
};
/**
* Encodes the specified ReqCreateOrderSn message, length delimited. Does not implicitly {@link tutorial.ReqCreateOrderSn.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {tutorial.IReqCreateOrderSn} message ReqCreateOrderSn message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqCreateOrderSn.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqCreateOrderSn message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqCreateOrderSn} ReqCreateOrderSn
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCreateOrderSn.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.ReqCreateOrderSn();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ChargeId = reader.int32();
break;
}
case 2: {
message.PlatForm = reader.string();
break;
}
case 3: {
message.channel = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqCreateOrderSn message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqCreateOrderSn} ReqCreateOrderSn
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqCreateOrderSn.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqCreateOrderSn message.
* @function verify
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqCreateOrderSn.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ChargeId != null && message.hasOwnProperty("ChargeId"))
if (!$util.isInteger(message.ChargeId))
return "ChargeId: integer expected";
if (message.PlatForm != null && message.hasOwnProperty("PlatForm"))
if (!$util.isString(message.PlatForm))
return "PlatForm: string expected";
if (message.channel != null && message.hasOwnProperty("channel"))
if (!$util.isString(message.channel))
return "channel: string expected";
return null;
};
/**
* Creates a ReqCreateOrderSn message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqCreateOrderSn} ReqCreateOrderSn
*/
ReqCreateOrderSn.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqCreateOrderSn)
return object;
var message = new $root.tutorial.ReqCreateOrderSn();
if (object.ChargeId != null)
message.ChargeId = object.ChargeId | 0;
if (object.PlatForm != null)
message.PlatForm = String(object.PlatForm);
if (object.channel != null)
message.channel = String(object.channel);
return message;
};
/**
* Creates a plain object from a ReqCreateOrderSn message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {tutorial.ReqCreateOrderSn} message ReqCreateOrderSn
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqCreateOrderSn.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.ChargeId = 0;
object.PlatForm = "";
object.channel = "";
}
if (message.ChargeId != null && message.hasOwnProperty("ChargeId"))
object.ChargeId = message.ChargeId;
if (message.PlatForm != null && message.hasOwnProperty("PlatForm"))
object.PlatForm = message.PlatForm;
if (message.channel != null && message.hasOwnProperty("channel"))
object.channel = message.channel;
return object;
};
/**
* Converts this ReqCreateOrderSn to JSON.
* @function toJSON
* @memberof tutorial.ReqCreateOrderSn
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqCreateOrderSn.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqCreateOrderSn
* @function getTypeUrl
* @memberof tutorial.ReqCreateOrderSn
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqCreateOrderSn.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqCreateOrderSn";
};
return ReqCreateOrderSn;
})();
tutorial.ResCreateOrderSn = (function() {
/**
* Properties of a ResCreateOrderSn.
* @memberof tutorial
* @interface IResCreateOrderSn
* @property {string|null} [OrderSn] ResCreateOrderSn OrderSn
*/
/**
* Constructs a new ResCreateOrderSn.
* @memberof tutorial
* @classdesc Represents a ResCreateOrderSn.
* @implements IResCreateOrderSn
* @constructor
* @param {tutorial.IResCreateOrderSn=} [properties] Properties to set
*/
function ResCreateOrderSn(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]];
}
/**
* ResCreateOrderSn OrderSn.
* @member {string} OrderSn
* @memberof tutorial.ResCreateOrderSn
* @instance
*/
ResCreateOrderSn.prototype.OrderSn = "";
/**
* Creates a new ResCreateOrderSn instance using the specified properties.
* @function create
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {tutorial.IResCreateOrderSn=} [properties] Properties to set
* @returns {tutorial.ResCreateOrderSn} ResCreateOrderSn instance
*/
ResCreateOrderSn.create = function create(properties) {
return new ResCreateOrderSn(properties);
};
/**
* Encodes the specified ResCreateOrderSn message. Does not implicitly {@link tutorial.ResCreateOrderSn.verify|verify} messages.
* @function encode
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {tutorial.IResCreateOrderSn} message ResCreateOrderSn message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCreateOrderSn.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.OrderSn != null && Object.hasOwnProperty.call(message, "OrderSn"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.OrderSn);
return writer;
};
/**
* Encodes the specified ResCreateOrderSn message, length delimited. Does not implicitly {@link tutorial.ResCreateOrderSn.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {tutorial.IResCreateOrderSn} message ResCreateOrderSn message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResCreateOrderSn.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResCreateOrderSn message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResCreateOrderSn} ResCreateOrderSn
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCreateOrderSn.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.ResCreateOrderSn();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.OrderSn = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResCreateOrderSn message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResCreateOrderSn} ResCreateOrderSn
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResCreateOrderSn.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResCreateOrderSn message.
* @function verify
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResCreateOrderSn.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.OrderSn != null && message.hasOwnProperty("OrderSn"))
if (!$util.isString(message.OrderSn))
return "OrderSn: string expected";
return null;
};
/**
* Creates a ResCreateOrderSn message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResCreateOrderSn} ResCreateOrderSn
*/
ResCreateOrderSn.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResCreateOrderSn)
return object;
var message = new $root.tutorial.ResCreateOrderSn();
if (object.OrderSn != null)
message.OrderSn = String(object.OrderSn);
return message;
};
/**
* Creates a plain object from a ResCreateOrderSn message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {tutorial.ResCreateOrderSn} message ResCreateOrderSn
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResCreateOrderSn.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.OrderSn = "";
if (message.OrderSn != null && message.hasOwnProperty("OrderSn"))
object.OrderSn = message.OrderSn;
return object;
};
/**
* Converts this ResCreateOrderSn to JSON.
* @function toJSON
* @memberof tutorial.ResCreateOrderSn
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResCreateOrderSn.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResCreateOrderSn
* @function getTypeUrl
* @memberof tutorial.ResCreateOrderSn
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResCreateOrderSn.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResCreateOrderSn";
};
return ResCreateOrderSn;
})();
tutorial.ReqShippingOrder = (function() {
/**
* Properties of a ReqShippingOrder.
* @memberof tutorial
* @interface IReqShippingOrder
* @property {string|null} [OrderSn] ReqShippingOrder OrderSn
* @property {string|null} [PayOrderSn] ReqShippingOrder PayOrderSn
* @property {number|null} [Status] ReqShippingOrder Status
*/
/**
* Constructs a new ReqShippingOrder.
* @memberof tutorial
* @classdesc Represents a ReqShippingOrder.
* @implements IReqShippingOrder
* @constructor
* @param {tutorial.IReqShippingOrder=} [properties] Properties to set
*/
function ReqShippingOrder(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]];
}
/**
* ReqShippingOrder OrderSn.
* @member {string} OrderSn
* @memberof tutorial.ReqShippingOrder
* @instance
*/
ReqShippingOrder.prototype.OrderSn = "";
/**
* ReqShippingOrder PayOrderSn.
* @member {string} PayOrderSn
* @memberof tutorial.ReqShippingOrder
* @instance
*/
ReqShippingOrder.prototype.PayOrderSn = "";
/**
* ReqShippingOrder Status.
* @member {number} Status
* @memberof tutorial.ReqShippingOrder
* @instance
*/
ReqShippingOrder.prototype.Status = 0;
/**
* Creates a new ReqShippingOrder instance using the specified properties.
* @function create
* @memberof tutorial.ReqShippingOrder
* @static
* @param {tutorial.IReqShippingOrder=} [properties] Properties to set
* @returns {tutorial.ReqShippingOrder} ReqShippingOrder instance
*/
ReqShippingOrder.create = function create(properties) {
return new ReqShippingOrder(properties);
};
/**
* Encodes the specified ReqShippingOrder message. Does not implicitly {@link tutorial.ReqShippingOrder.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqShippingOrder
* @static
* @param {tutorial.IReqShippingOrder} message ReqShippingOrder message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqShippingOrder.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.OrderSn != null && Object.hasOwnProperty.call(message, "OrderSn"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.OrderSn);
if (message.PayOrderSn != null && Object.hasOwnProperty.call(message, "PayOrderSn"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.PayOrderSn);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Status);
return writer;
};
/**
* Encodes the specified ReqShippingOrder message, length delimited. Does not implicitly {@link tutorial.ReqShippingOrder.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqShippingOrder
* @static
* @param {tutorial.IReqShippingOrder} message ReqShippingOrder message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqShippingOrder.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqShippingOrder message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqShippingOrder
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqShippingOrder} ReqShippingOrder
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqShippingOrder.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.ReqShippingOrder();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.OrderSn = reader.string();
break;
}
case 2: {
message.PayOrderSn = reader.string();
break;
}
case 3: {
message.Status = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqShippingOrder message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqShippingOrder
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqShippingOrder} ReqShippingOrder
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqShippingOrder.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqShippingOrder message.
* @function verify
* @memberof tutorial.ReqShippingOrder
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqShippingOrder.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.OrderSn != null && message.hasOwnProperty("OrderSn"))
if (!$util.isString(message.OrderSn))
return "OrderSn: string expected";
if (message.PayOrderSn != null && message.hasOwnProperty("PayOrderSn"))
if (!$util.isString(message.PayOrderSn))
return "PayOrderSn: string expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
return null;
};
/**
* Creates a ReqShippingOrder message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqShippingOrder
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqShippingOrder} ReqShippingOrder
*/
ReqShippingOrder.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqShippingOrder)
return object;
var message = new $root.tutorial.ReqShippingOrder();
if (object.OrderSn != null)
message.OrderSn = String(object.OrderSn);
if (object.PayOrderSn != null)
message.PayOrderSn = String(object.PayOrderSn);
if (object.Status != null)
message.Status = object.Status | 0;
return message;
};
/**
* Creates a plain object from a ReqShippingOrder message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqShippingOrder
* @static
* @param {tutorial.ReqShippingOrder} message ReqShippingOrder
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqShippingOrder.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.OrderSn = "";
object.PayOrderSn = "";
object.Status = 0;
}
if (message.OrderSn != null && message.hasOwnProperty("OrderSn"))
object.OrderSn = message.OrderSn;
if (message.PayOrderSn != null && message.hasOwnProperty("PayOrderSn"))
object.PayOrderSn = message.PayOrderSn;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
return object;
};
/**
* Converts this ReqShippingOrder to JSON.
* @function toJSON
* @memberof tutorial.ReqShippingOrder
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqShippingOrder.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqShippingOrder
* @function getTypeUrl
* @memberof tutorial.ReqShippingOrder
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqShippingOrder.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqShippingOrder";
};
return ReqShippingOrder;
})();
tutorial.ResShippingOrder = (function() {
/**
* Properties of a ResShippingOrder.
* @memberof tutorial
* @interface IResShippingOrder
* @property {tutorial.RES_CODE|null} [Code] ResShippingOrder Code
* @property {string|null} [Msg] ResShippingOrder Msg
*/
/**
* Constructs a new ResShippingOrder.
* @memberof tutorial
* @classdesc Represents a ResShippingOrder.
* @implements IResShippingOrder
* @constructor
* @param {tutorial.IResShippingOrder=} [properties] Properties to set
*/
function ResShippingOrder(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]];
}
/**
* ResShippingOrder Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResShippingOrder
* @instance
*/
ResShippingOrder.prototype.Code = 0;
/**
* ResShippingOrder Msg.
* @member {string} Msg
* @memberof tutorial.ResShippingOrder
* @instance
*/
ResShippingOrder.prototype.Msg = "";
/**
* Creates a new ResShippingOrder instance using the specified properties.
* @function create
* @memberof tutorial.ResShippingOrder
* @static
* @param {tutorial.IResShippingOrder=} [properties] Properties to set
* @returns {tutorial.ResShippingOrder} ResShippingOrder instance
*/
ResShippingOrder.create = function create(properties) {
return new ResShippingOrder(properties);
};
/**
* Encodes the specified ResShippingOrder message. Does not implicitly {@link tutorial.ResShippingOrder.verify|verify} messages.
* @function encode
* @memberof tutorial.ResShippingOrder
* @static
* @param {tutorial.IResShippingOrder} message ResShippingOrder message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResShippingOrder.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResShippingOrder message, length delimited. Does not implicitly {@link tutorial.ResShippingOrder.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResShippingOrder
* @static
* @param {tutorial.IResShippingOrder} message ResShippingOrder message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResShippingOrder.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResShippingOrder message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResShippingOrder
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResShippingOrder} ResShippingOrder
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResShippingOrder.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.ResShippingOrder();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResShippingOrder message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResShippingOrder
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResShippingOrder} ResShippingOrder
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResShippingOrder.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResShippingOrder message.
* @function verify
* @memberof tutorial.ResShippingOrder
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResShippingOrder.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResShippingOrder message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResShippingOrder
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResShippingOrder} ResShippingOrder
*/
ResShippingOrder.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResShippingOrder)
return object;
var message = new $root.tutorial.ResShippingOrder();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResShippingOrder message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResShippingOrder
* @static
* @param {tutorial.ResShippingOrder} message ResShippingOrder
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResShippingOrder.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResShippingOrder to JSON.
* @function toJSON
* @memberof tutorial.ResShippingOrder
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResShippingOrder.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResShippingOrder
* @function getTypeUrl
* @memberof tutorial.ResShippingOrder
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResShippingOrder.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResShippingOrder";
};
return ResShippingOrder;
})();
tutorial.ReqChampship = (function() {
/**
* Properties of a ReqChampship.
* @memberof tutorial
* @interface IReqChampship
*/
/**
* Constructs a new ReqChampship.
* @memberof tutorial
* @classdesc Represents a ReqChampship.
* @implements IReqChampship
* @constructor
* @param {tutorial.IReqChampship=} [properties] Properties to set
*/
function ReqChampship(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]];
}
/**
* Creates a new ReqChampship instance using the specified properties.
* @function create
* @memberof tutorial.ReqChampship
* @static
* @param {tutorial.IReqChampship=} [properties] Properties to set
* @returns {tutorial.ReqChampship} ReqChampship instance
*/
ReqChampship.create = function create(properties) {
return new ReqChampship(properties);
};
/**
* Encodes the specified ReqChampship message. Does not implicitly {@link tutorial.ReqChampship.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqChampship
* @static
* @param {tutorial.IReqChampship} message ReqChampship message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampship.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqChampship message, length delimited. Does not implicitly {@link tutorial.ReqChampship.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqChampship
* @static
* @param {tutorial.IReqChampship} message ReqChampship message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampship.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqChampship message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqChampship
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqChampship} ReqChampship
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampship.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.ReqChampship();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqChampship message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqChampship
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqChampship} ReqChampship
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampship.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqChampship message.
* @function verify
* @memberof tutorial.ReqChampship
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqChampship.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqChampship message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqChampship
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqChampship} ReqChampship
*/
ReqChampship.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqChampship)
return object;
return new $root.tutorial.ReqChampship();
};
/**
* Creates a plain object from a ReqChampship message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqChampship
* @static
* @param {tutorial.ReqChampship} message ReqChampship
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqChampship.toObject = function toObject() {
return {};
};
/**
* Converts this ReqChampship to JSON.
* @function toJSON
* @memberof tutorial.ReqChampship
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqChampship.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqChampship
* @function getTypeUrl
* @memberof tutorial.ReqChampship
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqChampship.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqChampship";
};
return ReqChampship;
})();
tutorial.ResChampship = (function() {
/**
* Properties of a ResChampship.
* @memberof tutorial
* @interface IResChampship
* @property {number|null} [Score] ResChampship Score
* @property {number|null} [Reward] ResChampship Reward
* @property {number|null} [EndTime] ResChampship EndTime
* @property {number|null} [Period] ResChampship Period
* @property {number|null} [Rank] ResChampship Rank
* @property {number|null} [RankReward] ResChampship RankReward
* @property {number|null} [Status] ResChampship Status
*/
/**
* Constructs a new ResChampship.
* @memberof tutorial
* @classdesc Represents a ResChampship.
* @implements IResChampship
* @constructor
* @param {tutorial.IResChampship=} [properties] Properties to set
*/
function ResChampship(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]];
}
/**
* ResChampship Score.
* @member {number} Score
* @memberof tutorial.ResChampship
* @instance
*/
ResChampship.prototype.Score = 0;
/**
* ResChampship Reward.
* @member {number} Reward
* @memberof tutorial.ResChampship
* @instance
*/
ResChampship.prototype.Reward = 0;
/**
* ResChampship EndTime.
* @member {number} EndTime
* @memberof tutorial.ResChampship
* @instance
*/
ResChampship.prototype.EndTime = 0;
/**
* ResChampship Period.
* @member {number} Period
* @memberof tutorial.ResChampship
* @instance
*/
ResChampship.prototype.Period = 0;
/**
* ResChampship Rank.
* @member {number} Rank
* @memberof tutorial.ResChampship
* @instance
*/
ResChampship.prototype.Rank = 0;
/**
* ResChampship RankReward.
* @member {number} RankReward
* @memberof tutorial.ResChampship
* @instance
*/
ResChampship.prototype.RankReward = 0;
/**
* ResChampship Status.
* @member {number} Status
* @memberof tutorial.ResChampship
* @instance
*/
ResChampship.prototype.Status = 0;
/**
* Creates a new ResChampship instance using the specified properties.
* @function create
* @memberof tutorial.ResChampship
* @static
* @param {tutorial.IResChampship=} [properties] Properties to set
* @returns {tutorial.ResChampship} ResChampship instance
*/
ResChampship.create = function create(properties) {
return new ResChampship(properties);
};
/**
* Encodes the specified ResChampship message. Does not implicitly {@link tutorial.ResChampship.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChampship
* @static
* @param {tutorial.IResChampship} message ResChampship message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampship.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Score != null && Object.hasOwnProperty.call(message, "Score"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Score);
if (message.Reward != null && Object.hasOwnProperty.call(message, "Reward"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Reward);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.EndTime);
if (message.Period != null && Object.hasOwnProperty.call(message, "Period"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Period);
if (message.Rank != null && Object.hasOwnProperty.call(message, "Rank"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Rank);
if (message.RankReward != null && Object.hasOwnProperty.call(message, "RankReward"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.RankReward);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.Status);
return writer;
};
/**
* Encodes the specified ResChampship message, length delimited. Does not implicitly {@link tutorial.ResChampship.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChampship
* @static
* @param {tutorial.IResChampship} message ResChampship message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampship.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChampship message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChampship
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChampship} ResChampship
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampship.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.ResChampship();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Score = reader.int32();
break;
}
case 2: {
message.Reward = reader.int32();
break;
}
case 3: {
message.EndTime = reader.int32();
break;
}
case 4: {
message.Period = reader.int32();
break;
}
case 5: {
message.Rank = reader.int32();
break;
}
case 6: {
message.RankReward = reader.int32();
break;
}
case 7: {
message.Status = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChampship message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChampship
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChampship} ResChampship
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampship.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChampship message.
* @function verify
* @memberof tutorial.ResChampship
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChampship.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Score != null && message.hasOwnProperty("Score"))
if (!$util.isInteger(message.Score))
return "Score: integer expected";
if (message.Reward != null && message.hasOwnProperty("Reward"))
if (!$util.isInteger(message.Reward))
return "Reward: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
if (message.Period != null && message.hasOwnProperty("Period"))
if (!$util.isInteger(message.Period))
return "Period: integer expected";
if (message.Rank != null && message.hasOwnProperty("Rank"))
if (!$util.isInteger(message.Rank))
return "Rank: integer expected";
if (message.RankReward != null && message.hasOwnProperty("RankReward"))
if (!$util.isInteger(message.RankReward))
return "RankReward: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
return null;
};
/**
* Creates a ResChampship message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChampship
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChampship} ResChampship
*/
ResChampship.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChampship)
return object;
var message = new $root.tutorial.ResChampship();
if (object.Score != null)
message.Score = object.Score | 0;
if (object.Reward != null)
message.Reward = object.Reward | 0;
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
if (object.Period != null)
message.Period = object.Period | 0;
if (object.Rank != null)
message.Rank = object.Rank | 0;
if (object.RankReward != null)
message.RankReward = object.RankReward | 0;
if (object.Status != null)
message.Status = object.Status | 0;
return message;
};
/**
* Creates a plain object from a ResChampship message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChampship
* @static
* @param {tutorial.ResChampship} message ResChampship
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChampship.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Score = 0;
object.Reward = 0;
object.EndTime = 0;
object.Period = 0;
object.Rank = 0;
object.RankReward = 0;
object.Status = 0;
}
if (message.Score != null && message.hasOwnProperty("Score"))
object.Score = message.Score;
if (message.Reward != null && message.hasOwnProperty("Reward"))
object.Reward = message.Reward;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
if (message.Period != null && message.hasOwnProperty("Period"))
object.Period = message.Period;
if (message.Rank != null && message.hasOwnProperty("Rank"))
object.Rank = message.Rank;
if (message.RankReward != null && message.hasOwnProperty("RankReward"))
object.RankReward = message.RankReward;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
return object;
};
/**
* Converts this ResChampship to JSON.
* @function toJSON
* @memberof tutorial.ResChampship
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChampship.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChampship
* @function getTypeUrl
* @memberof tutorial.ResChampship
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChampship.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChampship";
};
return ResChampship;
})();
tutorial.ReqChampshipReward = (function() {
/**
* Properties of a ReqChampshipReward.
* @memberof tutorial
* @interface IReqChampshipReward
*/
/**
* Constructs a new ReqChampshipReward.
* @memberof tutorial
* @classdesc Represents a ReqChampshipReward.
* @implements IReqChampshipReward
* @constructor
* @param {tutorial.IReqChampshipReward=} [properties] Properties to set
*/
function ReqChampshipReward(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]];
}
/**
* Creates a new ReqChampshipReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqChampshipReward
* @static
* @param {tutorial.IReqChampshipReward=} [properties] Properties to set
* @returns {tutorial.ReqChampshipReward} ReqChampshipReward instance
*/
ReqChampshipReward.create = function create(properties) {
return new ReqChampshipReward(properties);
};
/**
* Encodes the specified ReqChampshipReward message. Does not implicitly {@link tutorial.ReqChampshipReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqChampshipReward
* @static
* @param {tutorial.IReqChampshipReward} message ReqChampshipReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampshipReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqChampshipReward message, length delimited. Does not implicitly {@link tutorial.ReqChampshipReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqChampshipReward
* @static
* @param {tutorial.IReqChampshipReward} message ReqChampshipReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampshipReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqChampshipReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqChampshipReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqChampshipReward} ReqChampshipReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampshipReward.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.ReqChampshipReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqChampshipReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqChampshipReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqChampshipReward} ReqChampshipReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampshipReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqChampshipReward message.
* @function verify
* @memberof tutorial.ReqChampshipReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqChampshipReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqChampshipReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqChampshipReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqChampshipReward} ReqChampshipReward
*/
ReqChampshipReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqChampshipReward)
return object;
return new $root.tutorial.ReqChampshipReward();
};
/**
* Creates a plain object from a ReqChampshipReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqChampshipReward
* @static
* @param {tutorial.ReqChampshipReward} message ReqChampshipReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqChampshipReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqChampshipReward to JSON.
* @function toJSON
* @memberof tutorial.ReqChampshipReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqChampshipReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqChampshipReward
* @function getTypeUrl
* @memberof tutorial.ReqChampshipReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqChampshipReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqChampshipReward";
};
return ReqChampshipReward;
})();
tutorial.ResChampshipReward = (function() {
/**
* Properties of a ResChampshipReward.
* @memberof tutorial
* @interface IResChampshipReward
* @property {tutorial.RES_CODE|null} [Code] ResChampshipReward Code
* @property {string|null} [Msg] ResChampshipReward Msg
*/
/**
* Constructs a new ResChampshipReward.
* @memberof tutorial
* @classdesc Represents a ResChampshipReward.
* @implements IResChampshipReward
* @constructor
* @param {tutorial.IResChampshipReward=} [properties] Properties to set
*/
function ResChampshipReward(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]];
}
/**
* ResChampshipReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResChampshipReward
* @instance
*/
ResChampshipReward.prototype.Code = 0;
/**
* ResChampshipReward Msg.
* @member {string} Msg
* @memberof tutorial.ResChampshipReward
* @instance
*/
ResChampshipReward.prototype.Msg = "";
/**
* Creates a new ResChampshipReward instance using the specified properties.
* @function create
* @memberof tutorial.ResChampshipReward
* @static
* @param {tutorial.IResChampshipReward=} [properties] Properties to set
* @returns {tutorial.ResChampshipReward} ResChampshipReward instance
*/
ResChampshipReward.create = function create(properties) {
return new ResChampshipReward(properties);
};
/**
* Encodes the specified ResChampshipReward message. Does not implicitly {@link tutorial.ResChampshipReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChampshipReward
* @static
* @param {tutorial.IResChampshipReward} message ResChampshipReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampshipReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResChampshipReward message, length delimited. Does not implicitly {@link tutorial.ResChampshipReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChampshipReward
* @static
* @param {tutorial.IResChampshipReward} message ResChampshipReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampshipReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChampshipReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChampshipReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChampshipReward} ResChampshipReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampshipReward.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.ResChampshipReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChampshipReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChampshipReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChampshipReward} ResChampshipReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampshipReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChampshipReward message.
* @function verify
* @memberof tutorial.ResChampshipReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChampshipReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResChampshipReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChampshipReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChampshipReward} ResChampshipReward
*/
ResChampshipReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChampshipReward)
return object;
var message = new $root.tutorial.ResChampshipReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResChampshipReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChampshipReward
* @static
* @param {tutorial.ResChampshipReward} message ResChampshipReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChampshipReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResChampshipReward to JSON.
* @function toJSON
* @memberof tutorial.ResChampshipReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChampshipReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChampshipReward
* @function getTypeUrl
* @memberof tutorial.ResChampshipReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChampshipReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChampshipReward";
};
return ResChampshipReward;
})();
tutorial.ReqChampshipRankReward = (function() {
/**
* Properties of a ReqChampshipRankReward.
* @memberof tutorial
* @interface IReqChampshipRankReward
*/
/**
* Constructs a new ReqChampshipRankReward.
* @memberof tutorial
* @classdesc Represents a ReqChampshipRankReward.
* @implements IReqChampshipRankReward
* @constructor
* @param {tutorial.IReqChampshipRankReward=} [properties] Properties to set
*/
function ReqChampshipRankReward(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]];
}
/**
* Creates a new ReqChampshipRankReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {tutorial.IReqChampshipRankReward=} [properties] Properties to set
* @returns {tutorial.ReqChampshipRankReward} ReqChampshipRankReward instance
*/
ReqChampshipRankReward.create = function create(properties) {
return new ReqChampshipRankReward(properties);
};
/**
* Encodes the specified ReqChampshipRankReward message. Does not implicitly {@link tutorial.ReqChampshipRankReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {tutorial.IReqChampshipRankReward} message ReqChampshipRankReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampshipRankReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqChampshipRankReward message, length delimited. Does not implicitly {@link tutorial.ReqChampshipRankReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {tutorial.IReqChampshipRankReward} message ReqChampshipRankReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampshipRankReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqChampshipRankReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqChampshipRankReward} ReqChampshipRankReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampshipRankReward.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.ReqChampshipRankReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqChampshipRankReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqChampshipRankReward} ReqChampshipRankReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampshipRankReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqChampshipRankReward message.
* @function verify
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqChampshipRankReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqChampshipRankReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqChampshipRankReward} ReqChampshipRankReward
*/
ReqChampshipRankReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqChampshipRankReward)
return object;
return new $root.tutorial.ReqChampshipRankReward();
};
/**
* Creates a plain object from a ReqChampshipRankReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {tutorial.ReqChampshipRankReward} message ReqChampshipRankReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqChampshipRankReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqChampshipRankReward to JSON.
* @function toJSON
* @memberof tutorial.ReqChampshipRankReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqChampshipRankReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqChampshipRankReward
* @function getTypeUrl
* @memberof tutorial.ReqChampshipRankReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqChampshipRankReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqChampshipRankReward";
};
return ReqChampshipRankReward;
})();
tutorial.ResChampshipRankReward = (function() {
/**
* Properties of a ResChampshipRankReward.
* @memberof tutorial
* @interface IResChampshipRankReward
* @property {tutorial.RES_CODE|null} [Code] ResChampshipRankReward Code
* @property {string|null} [Msg] ResChampshipRankReward Msg
*/
/**
* Constructs a new ResChampshipRankReward.
* @memberof tutorial
* @classdesc Represents a ResChampshipRankReward.
* @implements IResChampshipRankReward
* @constructor
* @param {tutorial.IResChampshipRankReward=} [properties] Properties to set
*/
function ResChampshipRankReward(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]];
}
/**
* ResChampshipRankReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResChampshipRankReward
* @instance
*/
ResChampshipRankReward.prototype.Code = 0;
/**
* ResChampshipRankReward Msg.
* @member {string} Msg
* @memberof tutorial.ResChampshipRankReward
* @instance
*/
ResChampshipRankReward.prototype.Msg = "";
/**
* Creates a new ResChampshipRankReward instance using the specified properties.
* @function create
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {tutorial.IResChampshipRankReward=} [properties] Properties to set
* @returns {tutorial.ResChampshipRankReward} ResChampshipRankReward instance
*/
ResChampshipRankReward.create = function create(properties) {
return new ResChampshipRankReward(properties);
};
/**
* Encodes the specified ResChampshipRankReward message. Does not implicitly {@link tutorial.ResChampshipRankReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {tutorial.IResChampshipRankReward} message ResChampshipRankReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampshipRankReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResChampshipRankReward message, length delimited. Does not implicitly {@link tutorial.ResChampshipRankReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {tutorial.IResChampshipRankReward} message ResChampshipRankReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampshipRankReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChampshipRankReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChampshipRankReward} ResChampshipRankReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampshipRankReward.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.ResChampshipRankReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChampshipRankReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChampshipRankReward} ResChampshipRankReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampshipRankReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChampshipRankReward message.
* @function verify
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChampshipRankReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResChampshipRankReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChampshipRankReward} ResChampshipRankReward
*/
ResChampshipRankReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChampshipRankReward)
return object;
var message = new $root.tutorial.ResChampshipRankReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResChampshipRankReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {tutorial.ResChampshipRankReward} message ResChampshipRankReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChampshipRankReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResChampshipRankReward to JSON.
* @function toJSON
* @memberof tutorial.ResChampshipRankReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChampshipRankReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChampshipRankReward
* @function getTypeUrl
* @memberof tutorial.ResChampshipRankReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChampshipRankReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChampshipRankReward";
};
return ResChampshipRankReward;
})();
tutorial.ReqChampshipRank = (function() {
/**
* Properties of a ReqChampshipRank.
* @memberof tutorial
* @interface IReqChampshipRank
*/
/**
* Constructs a new ReqChampshipRank.
* @memberof tutorial
* @classdesc Represents a ReqChampshipRank.
* @implements IReqChampshipRank
* @constructor
* @param {tutorial.IReqChampshipRank=} [properties] Properties to set
*/
function ReqChampshipRank(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]];
}
/**
* Creates a new ReqChampshipRank instance using the specified properties.
* @function create
* @memberof tutorial.ReqChampshipRank
* @static
* @param {tutorial.IReqChampshipRank=} [properties] Properties to set
* @returns {tutorial.ReqChampshipRank} ReqChampshipRank instance
*/
ReqChampshipRank.create = function create(properties) {
return new ReqChampshipRank(properties);
};
/**
* Encodes the specified ReqChampshipRank message. Does not implicitly {@link tutorial.ReqChampshipRank.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqChampshipRank
* @static
* @param {tutorial.IReqChampshipRank} message ReqChampshipRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampshipRank.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqChampshipRank message, length delimited. Does not implicitly {@link tutorial.ReqChampshipRank.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqChampshipRank
* @static
* @param {tutorial.IReqChampshipRank} message ReqChampshipRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampshipRank.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqChampshipRank message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqChampshipRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqChampshipRank} ReqChampshipRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampshipRank.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.ReqChampshipRank();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqChampshipRank message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqChampshipRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqChampshipRank} ReqChampshipRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampshipRank.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqChampshipRank message.
* @function verify
* @memberof tutorial.ReqChampshipRank
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqChampshipRank.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqChampshipRank message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqChampshipRank
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqChampshipRank} ReqChampshipRank
*/
ReqChampshipRank.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqChampshipRank)
return object;
return new $root.tutorial.ReqChampshipRank();
};
/**
* Creates a plain object from a ReqChampshipRank message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqChampshipRank
* @static
* @param {tutorial.ReqChampshipRank} message ReqChampshipRank
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqChampshipRank.toObject = function toObject() {
return {};
};
/**
* Converts this ReqChampshipRank to JSON.
* @function toJSON
* @memberof tutorial.ReqChampshipRank
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqChampshipRank.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqChampshipRank
* @function getTypeUrl
* @memberof tutorial.ReqChampshipRank
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqChampshipRank.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqChampshipRank";
};
return ReqChampshipRank;
})();
tutorial.ResChampshipRank = (function() {
/**
* Properties of a ResChampshipRank.
* @memberof tutorial
* @interface IResChampshipRank
* @property {Object.<string,tutorial.IResPlayerRank>|null} [RankList] ResChampshipRank RankList
* @property {number|null} [MyRank] ResChampshipRank MyRank
* @property {number|null} [MyScore] ResChampshipRank MyScore
*/
/**
* Constructs a new ResChampshipRank.
* @memberof tutorial
* @classdesc Represents a ResChampshipRank.
* @implements IResChampshipRank
* @constructor
* @param {tutorial.IResChampshipRank=} [properties] Properties to set
*/
function ResChampshipRank(properties) {
this.RankList = {};
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]];
}
/**
* ResChampshipRank RankList.
* @member {Object.<string,tutorial.IResPlayerRank>} RankList
* @memberof tutorial.ResChampshipRank
* @instance
*/
ResChampshipRank.prototype.RankList = $util.emptyObject;
/**
* ResChampshipRank MyRank.
* @member {number} MyRank
* @memberof tutorial.ResChampshipRank
* @instance
*/
ResChampshipRank.prototype.MyRank = 0;
/**
* ResChampshipRank MyScore.
* @member {number} MyScore
* @memberof tutorial.ResChampshipRank
* @instance
*/
ResChampshipRank.prototype.MyScore = 0;
/**
* Creates a new ResChampshipRank instance using the specified properties.
* @function create
* @memberof tutorial.ResChampshipRank
* @static
* @param {tutorial.IResChampshipRank=} [properties] Properties to set
* @returns {tutorial.ResChampshipRank} ResChampshipRank instance
*/
ResChampshipRank.create = function create(properties) {
return new ResChampshipRank(properties);
};
/**
* Encodes the specified ResChampshipRank message. Does not implicitly {@link tutorial.ResChampshipRank.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChampshipRank
* @static
* @param {tutorial.IResChampshipRank} message ResChampshipRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampshipRank.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.RankList != null && Object.hasOwnProperty.call(message, "RankList"))
for (var keys = Object.keys(message.RankList), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.ResPlayerRank.encode(message.RankList[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.MyRank != null && Object.hasOwnProperty.call(message, "MyRank"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.MyRank);
if (message.MyScore != null && Object.hasOwnProperty.call(message, "MyScore"))
writer.uint32(/* id 3, wireType 5 =*/29).float(message.MyScore);
return writer;
};
/**
* Encodes the specified ResChampshipRank message, length delimited. Does not implicitly {@link tutorial.ResChampshipRank.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChampshipRank
* @static
* @param {tutorial.IResChampshipRank} message ResChampshipRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampshipRank.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChampshipRank message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChampshipRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChampshipRank} ResChampshipRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampshipRank.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.ResChampshipRank(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.RankList === $util.emptyObject)
message.RankList = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.ResPlayerRank.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.RankList[key] = value;
break;
}
case 2: {
message.MyRank = reader.int32();
break;
}
case 3: {
message.MyScore = reader.float();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChampshipRank message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChampshipRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChampshipRank} ResChampshipRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampshipRank.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChampshipRank message.
* @function verify
* @memberof tutorial.ResChampshipRank
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChampshipRank.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.RankList != null && message.hasOwnProperty("RankList")) {
if (!$util.isObject(message.RankList))
return "RankList: object expected";
var key = Object.keys(message.RankList);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "RankList: integer key{k:int32} expected";
{
var error = $root.tutorial.ResPlayerRank.verify(message.RankList[key[i]]);
if (error)
return "RankList." + error;
}
}
}
if (message.MyRank != null && message.hasOwnProperty("MyRank"))
if (!$util.isInteger(message.MyRank))
return "MyRank: integer expected";
if (message.MyScore != null && message.hasOwnProperty("MyScore"))
if (typeof message.MyScore !== "number")
return "MyScore: number expected";
return null;
};
/**
* Creates a ResChampshipRank message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChampshipRank
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChampshipRank} ResChampshipRank
*/
ResChampshipRank.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChampshipRank)
return object;
var message = new $root.tutorial.ResChampshipRank();
if (object.RankList) {
if (typeof object.RankList !== "object")
throw TypeError(".tutorial.ResChampshipRank.RankList: object expected");
message.RankList = {};
for (var keys = Object.keys(object.RankList), i = 0; i < keys.length; ++i) {
if (typeof object.RankList[keys[i]] !== "object")
throw TypeError(".tutorial.ResChampshipRank.RankList: object expected");
message.RankList[keys[i]] = $root.tutorial.ResPlayerRank.fromObject(object.RankList[keys[i]]);
}
}
if (object.MyRank != null)
message.MyRank = object.MyRank | 0;
if (object.MyScore != null)
message.MyScore = Number(object.MyScore);
return message;
};
/**
* Creates a plain object from a ResChampshipRank message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChampshipRank
* @static
* @param {tutorial.ResChampshipRank} message ResChampshipRank
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChampshipRank.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.RankList = {};
if (options.defaults) {
object.MyRank = 0;
object.MyScore = 0;
}
var keys2;
if (message.RankList && (keys2 = Object.keys(message.RankList)).length) {
object.RankList = {};
for (var j = 0; j < keys2.length; ++j)
object.RankList[keys2[j]] = $root.tutorial.ResPlayerRank.toObject(message.RankList[keys2[j]], options);
}
if (message.MyRank != null && message.hasOwnProperty("MyRank"))
object.MyRank = message.MyRank;
if (message.MyScore != null && message.hasOwnProperty("MyScore"))
object.MyScore = options.json && !isFinite(message.MyScore) ? String(message.MyScore) : message.MyScore;
return object;
};
/**
* Converts this ResChampshipRank to JSON.
* @function toJSON
* @memberof tutorial.ResChampshipRank
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChampshipRank.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChampshipRank
* @function getTypeUrl
* @memberof tutorial.ResChampshipRank
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChampshipRank.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChampshipRank";
};
return ResChampshipRank;
})();
tutorial.ReqChampshipPreRank = (function() {
/**
* Properties of a ReqChampshipPreRank.
* @memberof tutorial
* @interface IReqChampshipPreRank
*/
/**
* Constructs a new ReqChampshipPreRank.
* @memberof tutorial
* @classdesc Represents a ReqChampshipPreRank.
* @implements IReqChampshipPreRank
* @constructor
* @param {tutorial.IReqChampshipPreRank=} [properties] Properties to set
*/
function ReqChampshipPreRank(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]];
}
/**
* Creates a new ReqChampshipPreRank instance using the specified properties.
* @function create
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {tutorial.IReqChampshipPreRank=} [properties] Properties to set
* @returns {tutorial.ReqChampshipPreRank} ReqChampshipPreRank instance
*/
ReqChampshipPreRank.create = function create(properties) {
return new ReqChampshipPreRank(properties);
};
/**
* Encodes the specified ReqChampshipPreRank message. Does not implicitly {@link tutorial.ReqChampshipPreRank.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {tutorial.IReqChampshipPreRank} message ReqChampshipPreRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampshipPreRank.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqChampshipPreRank message, length delimited. Does not implicitly {@link tutorial.ReqChampshipPreRank.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {tutorial.IReqChampshipPreRank} message ReqChampshipPreRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqChampshipPreRank.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqChampshipPreRank message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqChampshipPreRank} ReqChampshipPreRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampshipPreRank.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.ReqChampshipPreRank();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqChampshipPreRank message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqChampshipPreRank} ReqChampshipPreRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqChampshipPreRank.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqChampshipPreRank message.
* @function verify
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqChampshipPreRank.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqChampshipPreRank message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqChampshipPreRank} ReqChampshipPreRank
*/
ReqChampshipPreRank.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqChampshipPreRank)
return object;
return new $root.tutorial.ReqChampshipPreRank();
};
/**
* Creates a plain object from a ReqChampshipPreRank message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {tutorial.ReqChampshipPreRank} message ReqChampshipPreRank
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqChampshipPreRank.toObject = function toObject() {
return {};
};
/**
* Converts this ReqChampshipPreRank to JSON.
* @function toJSON
* @memberof tutorial.ReqChampshipPreRank
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqChampshipPreRank.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqChampshipPreRank
* @function getTypeUrl
* @memberof tutorial.ReqChampshipPreRank
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqChampshipPreRank.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqChampshipPreRank";
};
return ReqChampshipPreRank;
})();
tutorial.ResChampshipPreRank = (function() {
/**
* Properties of a ResChampshipPreRank.
* @memberof tutorial
* @interface IResChampshipPreRank
* @property {Object.<string,tutorial.IResPlayerRank>|null} [RankList] ResChampshipPreRank RankList
* @property {number|null} [MyRank] ResChampshipPreRank MyRank
* @property {number|null} [MyScore] ResChampshipPreRank MyScore
*/
/**
* Constructs a new ResChampshipPreRank.
* @memberof tutorial
* @classdesc Represents a ResChampshipPreRank.
* @implements IResChampshipPreRank
* @constructor
* @param {tutorial.IResChampshipPreRank=} [properties] Properties to set
*/
function ResChampshipPreRank(properties) {
this.RankList = {};
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]];
}
/**
* ResChampshipPreRank RankList.
* @member {Object.<string,tutorial.IResPlayerRank>} RankList
* @memberof tutorial.ResChampshipPreRank
* @instance
*/
ResChampshipPreRank.prototype.RankList = $util.emptyObject;
/**
* ResChampshipPreRank MyRank.
* @member {number} MyRank
* @memberof tutorial.ResChampshipPreRank
* @instance
*/
ResChampshipPreRank.prototype.MyRank = 0;
/**
* ResChampshipPreRank MyScore.
* @member {number} MyScore
* @memberof tutorial.ResChampshipPreRank
* @instance
*/
ResChampshipPreRank.prototype.MyScore = 0;
/**
* Creates a new ResChampshipPreRank instance using the specified properties.
* @function create
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {tutorial.IResChampshipPreRank=} [properties] Properties to set
* @returns {tutorial.ResChampshipPreRank} ResChampshipPreRank instance
*/
ResChampshipPreRank.create = function create(properties) {
return new ResChampshipPreRank(properties);
};
/**
* Encodes the specified ResChampshipPreRank message. Does not implicitly {@link tutorial.ResChampshipPreRank.verify|verify} messages.
* @function encode
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {tutorial.IResChampshipPreRank} message ResChampshipPreRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampshipPreRank.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.RankList != null && Object.hasOwnProperty.call(message, "RankList"))
for (var keys = Object.keys(message.RankList), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.ResPlayerRank.encode(message.RankList[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.MyRank != null && Object.hasOwnProperty.call(message, "MyRank"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.MyRank);
if (message.MyScore != null && Object.hasOwnProperty.call(message, "MyScore"))
writer.uint32(/* id 3, wireType 5 =*/29).float(message.MyScore);
return writer;
};
/**
* Encodes the specified ResChampshipPreRank message, length delimited. Does not implicitly {@link tutorial.ResChampshipPreRank.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {tutorial.IResChampshipPreRank} message ResChampshipPreRank message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResChampshipPreRank.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResChampshipPreRank message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResChampshipPreRank} ResChampshipPreRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampshipPreRank.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.ResChampshipPreRank(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.RankList === $util.emptyObject)
message.RankList = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.ResPlayerRank.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.RankList[key] = value;
break;
}
case 2: {
message.MyRank = reader.int32();
break;
}
case 3: {
message.MyScore = reader.float();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResChampshipPreRank message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResChampshipPreRank} ResChampshipPreRank
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResChampshipPreRank.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResChampshipPreRank message.
* @function verify
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResChampshipPreRank.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.RankList != null && message.hasOwnProperty("RankList")) {
if (!$util.isObject(message.RankList))
return "RankList: object expected";
var key = Object.keys(message.RankList);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "RankList: integer key{k:int32} expected";
{
var error = $root.tutorial.ResPlayerRank.verify(message.RankList[key[i]]);
if (error)
return "RankList." + error;
}
}
}
if (message.MyRank != null && message.hasOwnProperty("MyRank"))
if (!$util.isInteger(message.MyRank))
return "MyRank: integer expected";
if (message.MyScore != null && message.hasOwnProperty("MyScore"))
if (typeof message.MyScore !== "number")
return "MyScore: number expected";
return null;
};
/**
* Creates a ResChampshipPreRank message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResChampshipPreRank} ResChampshipPreRank
*/
ResChampshipPreRank.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResChampshipPreRank)
return object;
var message = new $root.tutorial.ResChampshipPreRank();
if (object.RankList) {
if (typeof object.RankList !== "object")
throw TypeError(".tutorial.ResChampshipPreRank.RankList: object expected");
message.RankList = {};
for (var keys = Object.keys(object.RankList), i = 0; i < keys.length; ++i) {
if (typeof object.RankList[keys[i]] !== "object")
throw TypeError(".tutorial.ResChampshipPreRank.RankList: object expected");
message.RankList[keys[i]] = $root.tutorial.ResPlayerRank.fromObject(object.RankList[keys[i]]);
}
}
if (object.MyRank != null)
message.MyRank = object.MyRank | 0;
if (object.MyScore != null)
message.MyScore = Number(object.MyScore);
return message;
};
/**
* Creates a plain object from a ResChampshipPreRank message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {tutorial.ResChampshipPreRank} message ResChampshipPreRank
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResChampshipPreRank.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.RankList = {};
if (options.defaults) {
object.MyRank = 0;
object.MyScore = 0;
}
var keys2;
if (message.RankList && (keys2 = Object.keys(message.RankList)).length) {
object.RankList = {};
for (var j = 0; j < keys2.length; ++j)
object.RankList[keys2[j]] = $root.tutorial.ResPlayerRank.toObject(message.RankList[keys2[j]], options);
}
if (message.MyRank != null && message.hasOwnProperty("MyRank"))
object.MyRank = message.MyRank;
if (message.MyScore != null && message.hasOwnProperty("MyScore"))
object.MyScore = options.json && !isFinite(message.MyScore) ? String(message.MyScore) : message.MyScore;
return object;
};
/**
* Converts this ResChampshipPreRank to JSON.
* @function toJSON
* @memberof tutorial.ResChampshipPreRank
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResChampshipPreRank.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResChampshipPreRank
* @function getTypeUrl
* @memberof tutorial.ResChampshipPreRank
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResChampshipPreRank.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResChampshipPreRank";
};
return ResChampshipPreRank;
})();
tutorial.ResNotifyCard = (function() {
/**
* Properties of a ResNotifyCard.
* @memberof tutorial
* @interface IResNotifyCard
* @property {Object.<string,number>|null} [Card] ResNotifyCard Card
* @property {Object.<string,number>|null} [Master] ResNotifyCard Master
* @property {number|null} [ExStar] ResNotifyCard ExStar
*/
/**
* Constructs a new ResNotifyCard.
* @memberof tutorial
* @classdesc Represents a ResNotifyCard.
* @implements IResNotifyCard
* @constructor
* @param {tutorial.IResNotifyCard=} [properties] Properties to set
*/
function ResNotifyCard(properties) {
this.Card = {};
this.Master = {};
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]];
}
/**
* ResNotifyCard Card.
* @member {Object.<string,number>} Card
* @memberof tutorial.ResNotifyCard
* @instance
*/
ResNotifyCard.prototype.Card = $util.emptyObject;
/**
* ResNotifyCard Master.
* @member {Object.<string,number>} Master
* @memberof tutorial.ResNotifyCard
* @instance
*/
ResNotifyCard.prototype.Master = $util.emptyObject;
/**
* ResNotifyCard ExStar.
* @member {number} ExStar
* @memberof tutorial.ResNotifyCard
* @instance
*/
ResNotifyCard.prototype.ExStar = 0;
/**
* Creates a new ResNotifyCard instance using the specified properties.
* @function create
* @memberof tutorial.ResNotifyCard
* @static
* @param {tutorial.IResNotifyCard=} [properties] Properties to set
* @returns {tutorial.ResNotifyCard} ResNotifyCard instance
*/
ResNotifyCard.create = function create(properties) {
return new ResNotifyCard(properties);
};
/**
* Encodes the specified ResNotifyCard message. Does not implicitly {@link tutorial.ResNotifyCard.verify|verify} messages.
* @function encode
* @memberof tutorial.ResNotifyCard
* @static
* @param {tutorial.IResNotifyCard} message ResNotifyCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResNotifyCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Card != null && Object.hasOwnProperty.call(message, "Card"))
for (var keys = Object.keys(message.Card), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Card[keys[i]]).ldelim();
if (message.Master != null && Object.hasOwnProperty.call(message, "Master"))
for (var keys = Object.keys(message.Master), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Master[keys[i]]).ldelim();
if (message.ExStar != null && Object.hasOwnProperty.call(message, "ExStar"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ExStar);
return writer;
};
/**
* Encodes the specified ResNotifyCard message, length delimited. Does not implicitly {@link tutorial.ResNotifyCard.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResNotifyCard
* @static
* @param {tutorial.IResNotifyCard} message ResNotifyCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResNotifyCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResNotifyCard message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResNotifyCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResNotifyCard} ResNotifyCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResNotifyCard.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.ResNotifyCard(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Card === $util.emptyObject)
message.Card = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Card[key] = value;
break;
}
case 2: {
if (message.Master === $util.emptyObject)
message.Master = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Master[key] = value;
break;
}
case 3: {
message.ExStar = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResNotifyCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResNotifyCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResNotifyCard} ResNotifyCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResNotifyCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResNotifyCard message.
* @function verify
* @memberof tutorial.ResNotifyCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResNotifyCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Card != null && message.hasOwnProperty("Card")) {
if (!$util.isObject(message.Card))
return "Card: object expected";
var key = Object.keys(message.Card);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Card: integer key{k:int32} expected";
if (!$util.isInteger(message.Card[key[i]]))
return "Card: integer{k:int32} expected";
}
}
if (message.Master != null && message.hasOwnProperty("Master")) {
if (!$util.isObject(message.Master))
return "Master: object expected";
var key = Object.keys(message.Master);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Master: integer key{k:int32} expected";
if (!$util.isInteger(message.Master[key[i]]))
return "Master: integer{k:int32} expected";
}
}
if (message.ExStar != null && message.hasOwnProperty("ExStar"))
if (!$util.isInteger(message.ExStar))
return "ExStar: integer expected";
return null;
};
/**
* Creates a ResNotifyCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResNotifyCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResNotifyCard} ResNotifyCard
*/
ResNotifyCard.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResNotifyCard)
return object;
var message = new $root.tutorial.ResNotifyCard();
if (object.Card) {
if (typeof object.Card !== "object")
throw TypeError(".tutorial.ResNotifyCard.Card: object expected");
message.Card = {};
for (var keys = Object.keys(object.Card), i = 0; i < keys.length; ++i)
message.Card[keys[i]] = object.Card[keys[i]] | 0;
}
if (object.Master) {
if (typeof object.Master !== "object")
throw TypeError(".tutorial.ResNotifyCard.Master: object expected");
message.Master = {};
for (var keys = Object.keys(object.Master), i = 0; i < keys.length; ++i)
message.Master[keys[i]] = object.Master[keys[i]] | 0;
}
if (object.ExStar != null)
message.ExStar = object.ExStar | 0;
return message;
};
/**
* Creates a plain object from a ResNotifyCard message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResNotifyCard
* @static
* @param {tutorial.ResNotifyCard} message ResNotifyCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResNotifyCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults) {
object.Card = {};
object.Master = {};
}
if (options.defaults)
object.ExStar = 0;
var keys2;
if (message.Card && (keys2 = Object.keys(message.Card)).length) {
object.Card = {};
for (var j = 0; j < keys2.length; ++j)
object.Card[keys2[j]] = message.Card[keys2[j]];
}
if (message.Master && (keys2 = Object.keys(message.Master)).length) {
object.Master = {};
for (var j = 0; j < keys2.length; ++j)
object.Master[keys2[j]] = message.Master[keys2[j]];
}
if (message.ExStar != null && message.hasOwnProperty("ExStar"))
object.ExStar = message.ExStar;
return object;
};
/**
* Converts this ResNotifyCard to JSON.
* @function toJSON
* @memberof tutorial.ResNotifyCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResNotifyCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResNotifyCard
* @function getTypeUrl
* @memberof tutorial.ResNotifyCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResNotifyCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResNotifyCard";
};
return ResNotifyCard;
})();
tutorial.ReqSetFacebookUrl = (function() {
/**
* Properties of a ReqSetFacebookUrl.
* @memberof tutorial
* @interface IReqSetFacebookUrl
* @property {string|null} [Url] ReqSetFacebookUrl Url
*/
/**
* Constructs a new ReqSetFacebookUrl.
* @memberof tutorial
* @classdesc Represents a ReqSetFacebookUrl.
* @implements IReqSetFacebookUrl
* @constructor
* @param {tutorial.IReqSetFacebookUrl=} [properties] Properties to set
*/
function ReqSetFacebookUrl(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]];
}
/**
* ReqSetFacebookUrl Url.
* @member {string} Url
* @memberof tutorial.ReqSetFacebookUrl
* @instance
*/
ReqSetFacebookUrl.prototype.Url = "";
/**
* Creates a new ReqSetFacebookUrl instance using the specified properties.
* @function create
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {tutorial.IReqSetFacebookUrl=} [properties] Properties to set
* @returns {tutorial.ReqSetFacebookUrl} ReqSetFacebookUrl instance
*/
ReqSetFacebookUrl.create = function create(properties) {
return new ReqSetFacebookUrl(properties);
};
/**
* Encodes the specified ReqSetFacebookUrl message. Does not implicitly {@link tutorial.ReqSetFacebookUrl.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {tutorial.IReqSetFacebookUrl} message ReqSetFacebookUrl message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetFacebookUrl.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Url != null && Object.hasOwnProperty.call(message, "Url"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Url);
return writer;
};
/**
* Encodes the specified ReqSetFacebookUrl message, length delimited. Does not implicitly {@link tutorial.ReqSetFacebookUrl.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {tutorial.IReqSetFacebookUrl} message ReqSetFacebookUrl message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSetFacebookUrl.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSetFacebookUrl message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSetFacebookUrl} ReqSetFacebookUrl
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetFacebookUrl.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.ReqSetFacebookUrl();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Url = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSetFacebookUrl message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSetFacebookUrl} ReqSetFacebookUrl
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSetFacebookUrl.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSetFacebookUrl message.
* @function verify
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSetFacebookUrl.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Url != null && message.hasOwnProperty("Url"))
if (!$util.isString(message.Url))
return "Url: string expected";
return null;
};
/**
* Creates a ReqSetFacebookUrl message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSetFacebookUrl} ReqSetFacebookUrl
*/
ReqSetFacebookUrl.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSetFacebookUrl)
return object;
var message = new $root.tutorial.ReqSetFacebookUrl();
if (object.Url != null)
message.Url = String(object.Url);
return message;
};
/**
* Creates a plain object from a ReqSetFacebookUrl message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {tutorial.ReqSetFacebookUrl} message ReqSetFacebookUrl
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSetFacebookUrl.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Url = "";
if (message.Url != null && message.hasOwnProperty("Url"))
object.Url = message.Url;
return object;
};
/**
* Converts this ReqSetFacebookUrl to JSON.
* @function toJSON
* @memberof tutorial.ReqSetFacebookUrl
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSetFacebookUrl.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSetFacebookUrl
* @function getTypeUrl
* @memberof tutorial.ReqSetFacebookUrl
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSetFacebookUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSetFacebookUrl";
};
return ReqSetFacebookUrl;
})();
tutorial.ResSetFacebookUrl = (function() {
/**
* Properties of a ResSetFacebookUrl.
* @memberof tutorial
* @interface IResSetFacebookUrl
* @property {tutorial.RES_CODE|null} [Code] ResSetFacebookUrl Code
* @property {string|null} [Msg] ResSetFacebookUrl Msg
*/
/**
* Constructs a new ResSetFacebookUrl.
* @memberof tutorial
* @classdesc Represents a ResSetFacebookUrl.
* @implements IResSetFacebookUrl
* @constructor
* @param {tutorial.IResSetFacebookUrl=} [properties] Properties to set
*/
function ResSetFacebookUrl(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]];
}
/**
* ResSetFacebookUrl Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResSetFacebookUrl
* @instance
*/
ResSetFacebookUrl.prototype.Code = 0;
/**
* ResSetFacebookUrl Msg.
* @member {string} Msg
* @memberof tutorial.ResSetFacebookUrl
* @instance
*/
ResSetFacebookUrl.prototype.Msg = "";
/**
* Creates a new ResSetFacebookUrl instance using the specified properties.
* @function create
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {tutorial.IResSetFacebookUrl=} [properties] Properties to set
* @returns {tutorial.ResSetFacebookUrl} ResSetFacebookUrl instance
*/
ResSetFacebookUrl.create = function create(properties) {
return new ResSetFacebookUrl(properties);
};
/**
* Encodes the specified ResSetFacebookUrl message. Does not implicitly {@link tutorial.ResSetFacebookUrl.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {tutorial.IResSetFacebookUrl} message ResSetFacebookUrl message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetFacebookUrl.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResSetFacebookUrl message, length delimited. Does not implicitly {@link tutorial.ResSetFacebookUrl.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {tutorial.IResSetFacebookUrl} message ResSetFacebookUrl message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSetFacebookUrl.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSetFacebookUrl message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSetFacebookUrl} ResSetFacebookUrl
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetFacebookUrl.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.ResSetFacebookUrl();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSetFacebookUrl message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSetFacebookUrl} ResSetFacebookUrl
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSetFacebookUrl.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSetFacebookUrl message.
* @function verify
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSetFacebookUrl.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResSetFacebookUrl message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSetFacebookUrl} ResSetFacebookUrl
*/
ResSetFacebookUrl.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSetFacebookUrl)
return object;
var message = new $root.tutorial.ResSetFacebookUrl();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResSetFacebookUrl message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {tutorial.ResSetFacebookUrl} message ResSetFacebookUrl
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSetFacebookUrl.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResSetFacebookUrl to JSON.
* @function toJSON
* @memberof tutorial.ResSetFacebookUrl
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSetFacebookUrl.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSetFacebookUrl
* @function getTypeUrl
* @memberof tutorial.ResSetFacebookUrl
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSetFacebookUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSetFacebookUrl";
};
return ResSetFacebookUrl;
})();
tutorial.ReqInviteFriendData = (function() {
/**
* Properties of a ReqInviteFriendData.
* @memberof tutorial
* @interface IReqInviteFriendData
* @property {number|null} [dwUin] ReqInviteFriendData dwUin
*/
/**
* Constructs a new ReqInviteFriendData.
* @memberof tutorial
* @classdesc Represents a ReqInviteFriendData.
* @implements IReqInviteFriendData
* @constructor
* @param {tutorial.IReqInviteFriendData=} [properties] Properties to set
*/
function ReqInviteFriendData(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]];
}
/**
* ReqInviteFriendData dwUin.
* @member {number} dwUin
* @memberof tutorial.ReqInviteFriendData
* @instance
*/
ReqInviteFriendData.prototype.dwUin = 0;
/**
* Creates a new ReqInviteFriendData instance using the specified properties.
* @function create
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {tutorial.IReqInviteFriendData=} [properties] Properties to set
* @returns {tutorial.ReqInviteFriendData} ReqInviteFriendData instance
*/
ReqInviteFriendData.create = function create(properties) {
return new ReqInviteFriendData(properties);
};
/**
* Encodes the specified ReqInviteFriendData message. Does not implicitly {@link tutorial.ReqInviteFriendData.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {tutorial.IReqInviteFriendData} message ReqInviteFriendData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqInviteFriendData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.dwUin != null && Object.hasOwnProperty.call(message, "dwUin"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dwUin);
return writer;
};
/**
* Encodes the specified ReqInviteFriendData message, length delimited. Does not implicitly {@link tutorial.ReqInviteFriendData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {tutorial.IReqInviteFriendData} message ReqInviteFriendData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqInviteFriendData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqInviteFriendData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqInviteFriendData} ReqInviteFriendData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqInviteFriendData.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.ReqInviteFriendData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.dwUin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqInviteFriendData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqInviteFriendData} ReqInviteFriendData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqInviteFriendData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqInviteFriendData message.
* @function verify
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqInviteFriendData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
if (!$util.isInteger(message.dwUin))
return "dwUin: integer expected";
return null;
};
/**
* Creates a ReqInviteFriendData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqInviteFriendData} ReqInviteFriendData
*/
ReqInviteFriendData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqInviteFriendData)
return object;
var message = new $root.tutorial.ReqInviteFriendData();
if (object.dwUin != null)
message.dwUin = object.dwUin | 0;
return message;
};
/**
* Creates a plain object from a ReqInviteFriendData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {tutorial.ReqInviteFriendData} message ReqInviteFriendData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqInviteFriendData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.dwUin = 0;
if (message.dwUin != null && message.hasOwnProperty("dwUin"))
object.dwUin = message.dwUin;
return object;
};
/**
* Converts this ReqInviteFriendData to JSON.
* @function toJSON
* @memberof tutorial.ReqInviteFriendData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqInviteFriendData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqInviteFriendData
* @function getTypeUrl
* @memberof tutorial.ReqInviteFriendData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqInviteFriendData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqInviteFriendData";
};
return ReqInviteFriendData;
})();
tutorial.ResInviteFriendData = (function() {
/**
* Properties of a ResInviteFriendData.
* @memberof tutorial
* @interface IResInviteFriendData
* @property {Array.<number>|null} [IdLists] ResInviteFriendData IdLists
* @property {number|null} [GetIndex] ResInviteFriendData GetIndex
*/
/**
* Constructs a new ResInviteFriendData.
* @memberof tutorial
* @classdesc Represents a ResInviteFriendData.
* @implements IResInviteFriendData
* @constructor
* @param {tutorial.IResInviteFriendData=} [properties] Properties to set
*/
function ResInviteFriendData(properties) {
this.IdLists = [];
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]];
}
/**
* ResInviteFriendData IdLists.
* @member {Array.<number>} IdLists
* @memberof tutorial.ResInviteFriendData
* @instance
*/
ResInviteFriendData.prototype.IdLists = $util.emptyArray;
/**
* ResInviteFriendData GetIndex.
* @member {number} GetIndex
* @memberof tutorial.ResInviteFriendData
* @instance
*/
ResInviteFriendData.prototype.GetIndex = 0;
/**
* Creates a new ResInviteFriendData instance using the specified properties.
* @function create
* @memberof tutorial.ResInviteFriendData
* @static
* @param {tutorial.IResInviteFriendData=} [properties] Properties to set
* @returns {tutorial.ResInviteFriendData} ResInviteFriendData instance
*/
ResInviteFriendData.create = function create(properties) {
return new ResInviteFriendData(properties);
};
/**
* Encodes the specified ResInviteFriendData message. Does not implicitly {@link tutorial.ResInviteFriendData.verify|verify} messages.
* @function encode
* @memberof tutorial.ResInviteFriendData
* @static
* @param {tutorial.IResInviteFriendData} message ResInviteFriendData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResInviteFriendData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.IdLists != null && message.IdLists.length) {
writer.uint32(/* id 1, wireType 2 =*/10).fork();
for (var i = 0; i < message.IdLists.length; ++i)
writer.int32(message.IdLists[i]);
writer.ldelim();
}
if (message.GetIndex != null && Object.hasOwnProperty.call(message, "GetIndex"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.GetIndex);
return writer;
};
/**
* Encodes the specified ResInviteFriendData message, length delimited. Does not implicitly {@link tutorial.ResInviteFriendData.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResInviteFriendData
* @static
* @param {tutorial.IResInviteFriendData} message ResInviteFriendData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResInviteFriendData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResInviteFriendData message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResInviteFriendData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResInviteFriendData} ResInviteFriendData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResInviteFriendData.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.ResInviteFriendData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.IdLists && message.IdLists.length))
message.IdLists = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.IdLists.push(reader.int32());
} else
message.IdLists.push(reader.int32());
break;
}
case 2: {
message.GetIndex = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResInviteFriendData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResInviteFriendData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResInviteFriendData} ResInviteFriendData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResInviteFriendData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResInviteFriendData message.
* @function verify
* @memberof tutorial.ResInviteFriendData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResInviteFriendData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.IdLists != null && message.hasOwnProperty("IdLists")) {
if (!Array.isArray(message.IdLists))
return "IdLists: array expected";
for (var i = 0; i < message.IdLists.length; ++i)
if (!$util.isInteger(message.IdLists[i]))
return "IdLists: integer[] expected";
}
if (message.GetIndex != null && message.hasOwnProperty("GetIndex"))
if (!$util.isInteger(message.GetIndex))
return "GetIndex: integer expected";
return null;
};
/**
* Creates a ResInviteFriendData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResInviteFriendData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResInviteFriendData} ResInviteFriendData
*/
ResInviteFriendData.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResInviteFriendData)
return object;
var message = new $root.tutorial.ResInviteFriendData();
if (object.IdLists) {
if (!Array.isArray(object.IdLists))
throw TypeError(".tutorial.ResInviteFriendData.IdLists: array expected");
message.IdLists = [];
for (var i = 0; i < object.IdLists.length; ++i)
message.IdLists[i] = object.IdLists[i] | 0;
}
if (object.GetIndex != null)
message.GetIndex = object.GetIndex | 0;
return message;
};
/**
* Creates a plain object from a ResInviteFriendData message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResInviteFriendData
* @static
* @param {tutorial.ResInviteFriendData} message ResInviteFriendData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResInviteFriendData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.IdLists = [];
if (options.defaults)
object.GetIndex = 0;
if (message.IdLists && message.IdLists.length) {
object.IdLists = [];
for (var j = 0; j < message.IdLists.length; ++j)
object.IdLists[j] = message.IdLists[j];
}
if (message.GetIndex != null && message.hasOwnProperty("GetIndex"))
object.GetIndex = message.GetIndex;
return object;
};
/**
* Converts this ResInviteFriendData to JSON.
* @function toJSON
* @memberof tutorial.ResInviteFriendData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResInviteFriendData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResInviteFriendData
* @function getTypeUrl
* @memberof tutorial.ResInviteFriendData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResInviteFriendData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResInviteFriendData";
};
return ResInviteFriendData;
})();
tutorial.ReqSelfInvited = (function() {
/**
* Properties of a ReqSelfInvited.
* @memberof tutorial
* @interface IReqSelfInvited
* @property {number|null} [InviterId] ReqSelfInvited InviterId
*/
/**
* Constructs a new ReqSelfInvited.
* @memberof tutorial
* @classdesc Represents a ReqSelfInvited.
* @implements IReqSelfInvited
* @constructor
* @param {tutorial.IReqSelfInvited=} [properties] Properties to set
*/
function ReqSelfInvited(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]];
}
/**
* ReqSelfInvited InviterId.
* @member {number} InviterId
* @memberof tutorial.ReqSelfInvited
* @instance
*/
ReqSelfInvited.prototype.InviterId = 0;
/**
* Creates a new ReqSelfInvited instance using the specified properties.
* @function create
* @memberof tutorial.ReqSelfInvited
* @static
* @param {tutorial.IReqSelfInvited=} [properties] Properties to set
* @returns {tutorial.ReqSelfInvited} ReqSelfInvited instance
*/
ReqSelfInvited.create = function create(properties) {
return new ReqSelfInvited(properties);
};
/**
* Encodes the specified ReqSelfInvited message. Does not implicitly {@link tutorial.ReqSelfInvited.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqSelfInvited
* @static
* @param {tutorial.IReqSelfInvited} message ReqSelfInvited message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSelfInvited.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.InviterId != null && Object.hasOwnProperty.call(message, "InviterId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.InviterId);
return writer;
};
/**
* Encodes the specified ReqSelfInvited message, length delimited. Does not implicitly {@link tutorial.ReqSelfInvited.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqSelfInvited
* @static
* @param {tutorial.IReqSelfInvited} message ReqSelfInvited message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqSelfInvited.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqSelfInvited message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqSelfInvited
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqSelfInvited} ReqSelfInvited
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSelfInvited.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.ReqSelfInvited();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.InviterId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqSelfInvited message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqSelfInvited
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqSelfInvited} ReqSelfInvited
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqSelfInvited.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqSelfInvited message.
* @function verify
* @memberof tutorial.ReqSelfInvited
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqSelfInvited.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.InviterId != null && message.hasOwnProperty("InviterId"))
if (!$util.isInteger(message.InviterId))
return "InviterId: integer expected";
return null;
};
/**
* Creates a ReqSelfInvited message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqSelfInvited
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqSelfInvited} ReqSelfInvited
*/
ReqSelfInvited.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqSelfInvited)
return object;
var message = new $root.tutorial.ReqSelfInvited();
if (object.InviterId != null)
message.InviterId = object.InviterId | 0;
return message;
};
/**
* Creates a plain object from a ReqSelfInvited message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqSelfInvited
* @static
* @param {tutorial.ReqSelfInvited} message ReqSelfInvited
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqSelfInvited.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.InviterId = 0;
if (message.InviterId != null && message.hasOwnProperty("InviterId"))
object.InviterId = message.InviterId;
return object;
};
/**
* Converts this ReqSelfInvited to JSON.
* @function toJSON
* @memberof tutorial.ReqSelfInvited
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqSelfInvited.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqSelfInvited
* @function getTypeUrl
* @memberof tutorial.ReqSelfInvited
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqSelfInvited.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqSelfInvited";
};
return ReqSelfInvited;
})();
tutorial.ResSelfInvited = (function() {
/**
* Properties of a ResSelfInvited.
* @memberof tutorial
* @interface IResSelfInvited
* @property {number|null} [ResultCode] ResSelfInvited ResultCode
*/
/**
* Constructs a new ResSelfInvited.
* @memberof tutorial
* @classdesc Represents a ResSelfInvited.
* @implements IResSelfInvited
* @constructor
* @param {tutorial.IResSelfInvited=} [properties] Properties to set
*/
function ResSelfInvited(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]];
}
/**
* ResSelfInvited ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResSelfInvited
* @instance
*/
ResSelfInvited.prototype.ResultCode = 0;
/**
* Creates a new ResSelfInvited instance using the specified properties.
* @function create
* @memberof tutorial.ResSelfInvited
* @static
* @param {tutorial.IResSelfInvited=} [properties] Properties to set
* @returns {tutorial.ResSelfInvited} ResSelfInvited instance
*/
ResSelfInvited.create = function create(properties) {
return new ResSelfInvited(properties);
};
/**
* Encodes the specified ResSelfInvited message. Does not implicitly {@link tutorial.ResSelfInvited.verify|verify} messages.
* @function encode
* @memberof tutorial.ResSelfInvited
* @static
* @param {tutorial.IResSelfInvited} message ResSelfInvited message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSelfInvited.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
return writer;
};
/**
* Encodes the specified ResSelfInvited message, length delimited. Does not implicitly {@link tutorial.ResSelfInvited.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResSelfInvited
* @static
* @param {tutorial.IResSelfInvited} message ResSelfInvited message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResSelfInvited.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResSelfInvited message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResSelfInvited
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResSelfInvited} ResSelfInvited
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSelfInvited.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.ResSelfInvited();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResSelfInvited message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResSelfInvited
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResSelfInvited} ResSelfInvited
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResSelfInvited.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResSelfInvited message.
* @function verify
* @memberof tutorial.ResSelfInvited
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResSelfInvited.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
return null;
};
/**
* Creates a ResSelfInvited message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResSelfInvited
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResSelfInvited} ResSelfInvited
*/
ResSelfInvited.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResSelfInvited)
return object;
var message = new $root.tutorial.ResSelfInvited();
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
return message;
};
/**
* Creates a plain object from a ResSelfInvited message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResSelfInvited
* @static
* @param {tutorial.ResSelfInvited} message ResSelfInvited
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResSelfInvited.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.ResultCode = 0;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
return object;
};
/**
* Converts this ResSelfInvited to JSON.
* @function toJSON
* @memberof tutorial.ResSelfInvited
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResSelfInvited.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResSelfInvited
* @function getTypeUrl
* @memberof tutorial.ResSelfInvited
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResSelfInvited.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResSelfInvited";
};
return ResSelfInvited;
})();
tutorial.NotifyInvitedSuccess = (function() {
/**
* Properties of a NotifyInvitedSuccess.
* @memberof tutorial
* @interface INotifyInvitedSuccess
* @property {number|null} [ResultCode] NotifyInvitedSuccess ResultCode
* @property {Array.<number>|null} [IdLists] NotifyInvitedSuccess IdLists
*/
/**
* Constructs a new NotifyInvitedSuccess.
* @memberof tutorial
* @classdesc Represents a NotifyInvitedSuccess.
* @implements INotifyInvitedSuccess
* @constructor
* @param {tutorial.INotifyInvitedSuccess=} [properties] Properties to set
*/
function NotifyInvitedSuccess(properties) {
this.IdLists = [];
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]];
}
/**
* NotifyInvitedSuccess ResultCode.
* @member {number} ResultCode
* @memberof tutorial.NotifyInvitedSuccess
* @instance
*/
NotifyInvitedSuccess.prototype.ResultCode = 0;
/**
* NotifyInvitedSuccess IdLists.
* @member {Array.<number>} IdLists
* @memberof tutorial.NotifyInvitedSuccess
* @instance
*/
NotifyInvitedSuccess.prototype.IdLists = $util.emptyArray;
/**
* Creates a new NotifyInvitedSuccess instance using the specified properties.
* @function create
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {tutorial.INotifyInvitedSuccess=} [properties] Properties to set
* @returns {tutorial.NotifyInvitedSuccess} NotifyInvitedSuccess instance
*/
NotifyInvitedSuccess.create = function create(properties) {
return new NotifyInvitedSuccess(properties);
};
/**
* Encodes the specified NotifyInvitedSuccess message. Does not implicitly {@link tutorial.NotifyInvitedSuccess.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {tutorial.INotifyInvitedSuccess} message NotifyInvitedSuccess message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyInvitedSuccess.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
if (message.IdLists != null && message.IdLists.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.IdLists.length; ++i)
writer.int32(message.IdLists[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified NotifyInvitedSuccess message, length delimited. Does not implicitly {@link tutorial.NotifyInvitedSuccess.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {tutorial.INotifyInvitedSuccess} message NotifyInvitedSuccess message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyInvitedSuccess.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyInvitedSuccess message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyInvitedSuccess} NotifyInvitedSuccess
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyInvitedSuccess.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.NotifyInvitedSuccess();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
case 2: {
if (!(message.IdLists && message.IdLists.length))
message.IdLists = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.IdLists.push(reader.int32());
} else
message.IdLists.push(reader.int32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyInvitedSuccess message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyInvitedSuccess} NotifyInvitedSuccess
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyInvitedSuccess.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyInvitedSuccess message.
* @function verify
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyInvitedSuccess.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
if (message.IdLists != null && message.hasOwnProperty("IdLists")) {
if (!Array.isArray(message.IdLists))
return "IdLists: array expected";
for (var i = 0; i < message.IdLists.length; ++i)
if (!$util.isInteger(message.IdLists[i]))
return "IdLists: integer[] expected";
}
return null;
};
/**
* Creates a NotifyInvitedSuccess message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyInvitedSuccess} NotifyInvitedSuccess
*/
NotifyInvitedSuccess.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyInvitedSuccess)
return object;
var message = new $root.tutorial.NotifyInvitedSuccess();
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
if (object.IdLists) {
if (!Array.isArray(object.IdLists))
throw TypeError(".tutorial.NotifyInvitedSuccess.IdLists: array expected");
message.IdLists = [];
for (var i = 0; i < object.IdLists.length; ++i)
message.IdLists[i] = object.IdLists[i] | 0;
}
return message;
};
/**
* Creates a plain object from a NotifyInvitedSuccess message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {tutorial.NotifyInvitedSuccess} message NotifyInvitedSuccess
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyInvitedSuccess.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.IdLists = [];
if (options.defaults)
object.ResultCode = 0;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
if (message.IdLists && message.IdLists.length) {
object.IdLists = [];
for (var j = 0; j < message.IdLists.length; ++j)
object.IdLists[j] = message.IdLists[j];
}
return object;
};
/**
* Converts this NotifyInvitedSuccess to JSON.
* @function toJSON
* @memberof tutorial.NotifyInvitedSuccess
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyInvitedSuccess.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyInvitedSuccess
* @function getTypeUrl
* @memberof tutorial.NotifyInvitedSuccess
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyInvitedSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyInvitedSuccess";
};
return NotifyInvitedSuccess;
})();
tutorial.ReqGetInviteReward = (function() {
/**
* Properties of a ReqGetInviteReward.
* @memberof tutorial
* @interface IReqGetInviteReward
* @property {number|null} [GetIndex] ReqGetInviteReward GetIndex
*/
/**
* Constructs a new ReqGetInviteReward.
* @memberof tutorial
* @classdesc Represents a ReqGetInviteReward.
* @implements IReqGetInviteReward
* @constructor
* @param {tutorial.IReqGetInviteReward=} [properties] Properties to set
*/
function ReqGetInviteReward(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]];
}
/**
* ReqGetInviteReward GetIndex.
* @member {number} GetIndex
* @memberof tutorial.ReqGetInviteReward
* @instance
*/
ReqGetInviteReward.prototype.GetIndex = 0;
/**
* Creates a new ReqGetInviteReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {tutorial.IReqGetInviteReward=} [properties] Properties to set
* @returns {tutorial.ReqGetInviteReward} ReqGetInviteReward instance
*/
ReqGetInviteReward.create = function create(properties) {
return new ReqGetInviteReward(properties);
};
/**
* Encodes the specified ReqGetInviteReward message. Does not implicitly {@link tutorial.ReqGetInviteReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {tutorial.IReqGetInviteReward} message ReqGetInviteReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetInviteReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.GetIndex != null && Object.hasOwnProperty.call(message, "GetIndex"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.GetIndex);
return writer;
};
/**
* Encodes the specified ReqGetInviteReward message, length delimited. Does not implicitly {@link tutorial.ReqGetInviteReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {tutorial.IReqGetInviteReward} message ReqGetInviteReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGetInviteReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGetInviteReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGetInviteReward} ReqGetInviteReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetInviteReward.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.ReqGetInviteReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.GetIndex = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGetInviteReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGetInviteReward} ReqGetInviteReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGetInviteReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGetInviteReward message.
* @function verify
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGetInviteReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.GetIndex != null && message.hasOwnProperty("GetIndex"))
if (!$util.isInteger(message.GetIndex))
return "GetIndex: integer expected";
return null;
};
/**
* Creates a ReqGetInviteReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGetInviteReward} ReqGetInviteReward
*/
ReqGetInviteReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGetInviteReward)
return object;
var message = new $root.tutorial.ReqGetInviteReward();
if (object.GetIndex != null)
message.GetIndex = object.GetIndex | 0;
return message;
};
/**
* Creates a plain object from a ReqGetInviteReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {tutorial.ReqGetInviteReward} message ReqGetInviteReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGetInviteReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.GetIndex = 0;
if (message.GetIndex != null && message.hasOwnProperty("GetIndex"))
object.GetIndex = message.GetIndex;
return object;
};
/**
* Converts this ReqGetInviteReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGetInviteReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGetInviteReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGetInviteReward
* @function getTypeUrl
* @memberof tutorial.ReqGetInviteReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGetInviteReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGetInviteReward";
};
return ReqGetInviteReward;
})();
tutorial.ResGetInviteReward = (function() {
/**
* Properties of a ResGetInviteReward.
* @memberof tutorial
* @interface IResGetInviteReward
* @property {number|null} [ResultCode] ResGetInviteReward ResultCode
*/
/**
* Constructs a new ResGetInviteReward.
* @memberof tutorial
* @classdesc Represents a ResGetInviteReward.
* @implements IResGetInviteReward
* @constructor
* @param {tutorial.IResGetInviteReward=} [properties] Properties to set
*/
function ResGetInviteReward(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]];
}
/**
* ResGetInviteReward ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResGetInviteReward
* @instance
*/
ResGetInviteReward.prototype.ResultCode = 0;
/**
* Creates a new ResGetInviteReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGetInviteReward
* @static
* @param {tutorial.IResGetInviteReward=} [properties] Properties to set
* @returns {tutorial.ResGetInviteReward} ResGetInviteReward instance
*/
ResGetInviteReward.create = function create(properties) {
return new ResGetInviteReward(properties);
};
/**
* Encodes the specified ResGetInviteReward message. Does not implicitly {@link tutorial.ResGetInviteReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGetInviteReward
* @static
* @param {tutorial.IResGetInviteReward} message ResGetInviteReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetInviteReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
return writer;
};
/**
* Encodes the specified ResGetInviteReward message, length delimited. Does not implicitly {@link tutorial.ResGetInviteReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGetInviteReward
* @static
* @param {tutorial.IResGetInviteReward} message ResGetInviteReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGetInviteReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGetInviteReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGetInviteReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGetInviteReward} ResGetInviteReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetInviteReward.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.ResGetInviteReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGetInviteReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGetInviteReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGetInviteReward} ResGetInviteReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGetInviteReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGetInviteReward message.
* @function verify
* @memberof tutorial.ResGetInviteReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGetInviteReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
return null;
};
/**
* Creates a ResGetInviteReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGetInviteReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGetInviteReward} ResGetInviteReward
*/
ResGetInviteReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGetInviteReward)
return object;
var message = new $root.tutorial.ResGetInviteReward();
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
return message;
};
/**
* Creates a plain object from a ResGetInviteReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGetInviteReward
* @static
* @param {tutorial.ResGetInviteReward} message ResGetInviteReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGetInviteReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.ResultCode = 0;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
return object;
};
/**
* Converts this ResGetInviteReward to JSON.
* @function toJSON
* @memberof tutorial.ResGetInviteReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGetInviteReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGetInviteReward
* @function getTypeUrl
* @memberof tutorial.ResGetInviteReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGetInviteReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGetInviteReward";
};
return ResGetInviteReward;
})();
tutorial.ReqAutoAddInviteFriend = (function() {
/**
* Properties of a ReqAutoAddInviteFriend.
* @memberof tutorial
* @interface IReqAutoAddInviteFriend
* @property {number|null} [id] ReqAutoAddInviteFriend id
*/
/**
* Constructs a new ReqAutoAddInviteFriend.
* @memberof tutorial
* @classdesc Represents a ReqAutoAddInviteFriend.
* @implements IReqAutoAddInviteFriend
* @constructor
* @param {tutorial.IReqAutoAddInviteFriend=} [properties] Properties to set
*/
function ReqAutoAddInviteFriend(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]];
}
/**
* ReqAutoAddInviteFriend id.
* @member {number} id
* @memberof tutorial.ReqAutoAddInviteFriend
* @instance
*/
ReqAutoAddInviteFriend.prototype.id = 0;
/**
* Creates a new ReqAutoAddInviteFriend instance using the specified properties.
* @function create
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {tutorial.IReqAutoAddInviteFriend=} [properties] Properties to set
* @returns {tutorial.ReqAutoAddInviteFriend} ReqAutoAddInviteFriend instance
*/
ReqAutoAddInviteFriend.create = function create(properties) {
return new ReqAutoAddInviteFriend(properties);
};
/**
* Encodes the specified ReqAutoAddInviteFriend message. Does not implicitly {@link tutorial.ReqAutoAddInviteFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {tutorial.IReqAutoAddInviteFriend} message ReqAutoAddInviteFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAutoAddInviteFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
return writer;
};
/**
* Encodes the specified ReqAutoAddInviteFriend message, length delimited. Does not implicitly {@link tutorial.ReqAutoAddInviteFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {tutorial.IReqAutoAddInviteFriend} message ReqAutoAddInviteFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAutoAddInviteFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqAutoAddInviteFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqAutoAddInviteFriend} ReqAutoAddInviteFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAutoAddInviteFriend.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.ReqAutoAddInviteFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqAutoAddInviteFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqAutoAddInviteFriend} ReqAutoAddInviteFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAutoAddInviteFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqAutoAddInviteFriend message.
* @function verify
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqAutoAddInviteFriend.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))
return "id: integer expected";
return null;
};
/**
* Creates a ReqAutoAddInviteFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqAutoAddInviteFriend} ReqAutoAddInviteFriend
*/
ReqAutoAddInviteFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqAutoAddInviteFriend)
return object;
var message = new $root.tutorial.ReqAutoAddInviteFriend();
if (object.id != null)
message.id = object.id | 0;
return message;
};
/**
* Creates a plain object from a ReqAutoAddInviteFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {tutorial.ReqAutoAddInviteFriend} message ReqAutoAddInviteFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqAutoAddInviteFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.id = 0;
if (message.id != null && message.hasOwnProperty("id"))
object.id = message.id;
return object;
};
/**
* Converts this ReqAutoAddInviteFriend to JSON.
* @function toJSON
* @memberof tutorial.ReqAutoAddInviteFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqAutoAddInviteFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqAutoAddInviteFriend
* @function getTypeUrl
* @memberof tutorial.ReqAutoAddInviteFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqAutoAddInviteFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqAutoAddInviteFriend";
};
return ReqAutoAddInviteFriend;
})();
tutorial.ResAutoAddInviteFriend = (function() {
/**
* Properties of a ResAutoAddInviteFriend.
* @memberof tutorial
* @interface IResAutoAddInviteFriend
* @property {number|null} [ResultCode] ResAutoAddInviteFriend ResultCode
*/
/**
* Constructs a new ResAutoAddInviteFriend.
* @memberof tutorial
* @classdesc Represents a ResAutoAddInviteFriend.
* @implements IResAutoAddInviteFriend
* @constructor
* @param {tutorial.IResAutoAddInviteFriend=} [properties] Properties to set
*/
function ResAutoAddInviteFriend(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]];
}
/**
* ResAutoAddInviteFriend ResultCode.
* @member {number} ResultCode
* @memberof tutorial.ResAutoAddInviteFriend
* @instance
*/
ResAutoAddInviteFriend.prototype.ResultCode = 0;
/**
* Creates a new ResAutoAddInviteFriend instance using the specified properties.
* @function create
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {tutorial.IResAutoAddInviteFriend=} [properties] Properties to set
* @returns {tutorial.ResAutoAddInviteFriend} ResAutoAddInviteFriend instance
*/
ResAutoAddInviteFriend.create = function create(properties) {
return new ResAutoAddInviteFriend(properties);
};
/**
* Encodes the specified ResAutoAddInviteFriend message. Does not implicitly {@link tutorial.ResAutoAddInviteFriend.verify|verify} messages.
* @function encode
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {tutorial.IResAutoAddInviteFriend} message ResAutoAddInviteFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAutoAddInviteFriend.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ResultCode != null && Object.hasOwnProperty.call(message, "ResultCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ResultCode);
return writer;
};
/**
* Encodes the specified ResAutoAddInviteFriend message, length delimited. Does not implicitly {@link tutorial.ResAutoAddInviteFriend.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {tutorial.IResAutoAddInviteFriend} message ResAutoAddInviteFriend message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAutoAddInviteFriend.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResAutoAddInviteFriend message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResAutoAddInviteFriend} ResAutoAddInviteFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAutoAddInviteFriend.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.ResAutoAddInviteFriend();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.ResultCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResAutoAddInviteFriend message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResAutoAddInviteFriend} ResAutoAddInviteFriend
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAutoAddInviteFriend.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResAutoAddInviteFriend message.
* @function verify
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResAutoAddInviteFriend.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
if (!$util.isInteger(message.ResultCode))
return "ResultCode: integer expected";
return null;
};
/**
* Creates a ResAutoAddInviteFriend message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResAutoAddInviteFriend} ResAutoAddInviteFriend
*/
ResAutoAddInviteFriend.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResAutoAddInviteFriend)
return object;
var message = new $root.tutorial.ResAutoAddInviteFriend();
if (object.ResultCode != null)
message.ResultCode = object.ResultCode | 0;
return message;
};
/**
* Creates a plain object from a ResAutoAddInviteFriend message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {tutorial.ResAutoAddInviteFriend} message ResAutoAddInviteFriend
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResAutoAddInviteFriend.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.ResultCode = 0;
if (message.ResultCode != null && message.hasOwnProperty("ResultCode"))
object.ResultCode = message.ResultCode;
return object;
};
/**
* Converts this ResAutoAddInviteFriend to JSON.
* @function toJSON
* @memberof tutorial.ResAutoAddInviteFriend
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResAutoAddInviteFriend.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResAutoAddInviteFriend
* @function getTypeUrl
* @memberof tutorial.ResAutoAddInviteFriend
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResAutoAddInviteFriend.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResAutoAddInviteFriend";
};
return ResAutoAddInviteFriend;
})();
tutorial.ReqMining = (function() {
/**
* Properties of a ReqMining.
* @memberof tutorial
* @interface IReqMining
*/
/**
* Constructs a new ReqMining.
* @memberof tutorial
* @classdesc Represents a ReqMining.
* @implements IReqMining
* @constructor
* @param {tutorial.IReqMining=} [properties] Properties to set
*/
function ReqMining(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]];
}
/**
* Creates a new ReqMining instance using the specified properties.
* @function create
* @memberof tutorial.ReqMining
* @static
* @param {tutorial.IReqMining=} [properties] Properties to set
* @returns {tutorial.ReqMining} ReqMining instance
*/
ReqMining.create = function create(properties) {
return new ReqMining(properties);
};
/**
* Encodes the specified ReqMining message. Does not implicitly {@link tutorial.ReqMining.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqMining
* @static
* @param {tutorial.IReqMining} message ReqMining message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMining.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqMining message, length delimited. Does not implicitly {@link tutorial.ReqMining.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqMining
* @static
* @param {tutorial.IReqMining} message ReqMining message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMining.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqMining message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqMining
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqMining} ReqMining
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMining.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.ReqMining();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqMining message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqMining
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqMining} ReqMining
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMining.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqMining message.
* @function verify
* @memberof tutorial.ReqMining
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqMining.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqMining message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqMining
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqMining} ReqMining
*/
ReqMining.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqMining)
return object;
return new $root.tutorial.ReqMining();
};
/**
* Creates a plain object from a ReqMining message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqMining
* @static
* @param {tutorial.ReqMining} message ReqMining
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqMining.toObject = function toObject() {
return {};
};
/**
* Converts this ReqMining to JSON.
* @function toJSON
* @memberof tutorial.ReqMining
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqMining.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqMining
* @function getTypeUrl
* @memberof tutorial.ReqMining
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqMining.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqMining";
};
return ReqMining;
})();
tutorial.ResMining = (function() {
/**
* Properties of a ResMining.
* @memberof tutorial
* @interface IResMining
* @property {number|null} [Id] ResMining Id
* @property {number|null} [Status] ResMining Status
* @property {number|null} [EndTime] ResMining EndTime
* @property {number|null} [Template] ResMining Template
* @property {number|null} [Pass] ResMining Pass
* @property {Array.<number>|null} [Gem] ResMining Gem
* @property {Object.<string,string>|null} [Map] ResMining Map
* @property {number|null} [Mining] ResMining Mining
*/
/**
* Constructs a new ResMining.
* @memberof tutorial
* @classdesc Represents a ResMining.
* @implements IResMining
* @constructor
* @param {tutorial.IResMining=} [properties] Properties to set
*/
function ResMining(properties) {
this.Gem = [];
this.Map = {};
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]];
}
/**
* ResMining Id.
* @member {number} Id
* @memberof tutorial.ResMining
* @instance
*/
ResMining.prototype.Id = 0;
/**
* ResMining Status.
* @member {number} Status
* @memberof tutorial.ResMining
* @instance
*/
ResMining.prototype.Status = 0;
/**
* ResMining EndTime.
* @member {number} EndTime
* @memberof tutorial.ResMining
* @instance
*/
ResMining.prototype.EndTime = 0;
/**
* ResMining Template.
* @member {number} Template
* @memberof tutorial.ResMining
* @instance
*/
ResMining.prototype.Template = 0;
/**
* ResMining Pass.
* @member {number} Pass
* @memberof tutorial.ResMining
* @instance
*/
ResMining.prototype.Pass = 0;
/**
* ResMining Gem.
* @member {Array.<number>} Gem
* @memberof tutorial.ResMining
* @instance
*/
ResMining.prototype.Gem = $util.emptyArray;
/**
* ResMining Map.
* @member {Object.<string,string>} Map
* @memberof tutorial.ResMining
* @instance
*/
ResMining.prototype.Map = $util.emptyObject;
/**
* ResMining Mining.
* @member {number} Mining
* @memberof tutorial.ResMining
* @instance
*/
ResMining.prototype.Mining = 0;
/**
* Creates a new ResMining instance using the specified properties.
* @function create
* @memberof tutorial.ResMining
* @static
* @param {tutorial.IResMining=} [properties] Properties to set
* @returns {tutorial.ResMining} ResMining instance
*/
ResMining.create = function create(properties) {
return new ResMining(properties);
};
/**
* Encodes the specified ResMining message. Does not implicitly {@link tutorial.ResMining.verify|verify} messages.
* @function encode
* @memberof tutorial.ResMining
* @static
* @param {tutorial.IResMining} message ResMining message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMining.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Status);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.EndTime);
if (message.Template != null && Object.hasOwnProperty.call(message, "Template"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Template);
if (message.Pass != null && Object.hasOwnProperty.call(message, "Pass"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Pass);
if (message.Gem != null && message.Gem.length) {
writer.uint32(/* id 6, wireType 2 =*/50).fork();
for (var i = 0; i < message.Gem.length; ++i)
writer.int32(message.Gem[i]);
writer.ldelim();
}
if (message.Map != null && Object.hasOwnProperty.call(message, "Map"))
for (var keys = Object.keys(message.Map), i = 0; i < keys.length; ++i)
writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.Map[keys[i]]).ldelim();
if (message.Mining != null && Object.hasOwnProperty.call(message, "Mining"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.Mining);
return writer;
};
/**
* Encodes the specified ResMining message, length delimited. Does not implicitly {@link tutorial.ResMining.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResMining
* @static
* @param {tutorial.IResMining} message ResMining message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMining.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResMining message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResMining
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResMining} ResMining
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMining.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.ResMining(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Status = reader.int32();
break;
}
case 3: {
message.EndTime = reader.int32();
break;
}
case 4: {
message.Template = reader.int32();
break;
}
case 5: {
message.Pass = reader.int32();
break;
}
case 6: {
if (!(message.Gem && message.Gem.length))
message.Gem = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Gem.push(reader.int32());
} else
message.Gem.push(reader.int32());
break;
}
case 7: {
if (message.Map === $util.emptyObject)
message.Map = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Map[key] = value;
break;
}
case 8: {
message.Mining = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResMining message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResMining
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResMining} ResMining
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMining.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResMining message.
* @function verify
* @memberof tutorial.ResMining
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResMining.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))
return "Id: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
if (message.Template != null && message.hasOwnProperty("Template"))
if (!$util.isInteger(message.Template))
return "Template: integer expected";
if (message.Pass != null && message.hasOwnProperty("Pass"))
if (!$util.isInteger(message.Pass))
return "Pass: integer expected";
if (message.Gem != null && message.hasOwnProperty("Gem")) {
if (!Array.isArray(message.Gem))
return "Gem: array expected";
for (var i = 0; i < message.Gem.length; ++i)
if (!$util.isInteger(message.Gem[i]))
return "Gem: integer[] expected";
}
if (message.Map != null && message.hasOwnProperty("Map")) {
if (!$util.isObject(message.Map))
return "Map: object expected";
var key = Object.keys(message.Map);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Map: integer key{k:int32} expected";
if (!$util.isString(message.Map[key[i]]))
return "Map: string{k:int32} expected";
}
}
if (message.Mining != null && message.hasOwnProperty("Mining"))
if (!$util.isInteger(message.Mining))
return "Mining: integer expected";
return null;
};
/**
* Creates a ResMining message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResMining
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResMining} ResMining
*/
ResMining.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResMining)
return object;
var message = new $root.tutorial.ResMining();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Status != null)
message.Status = object.Status | 0;
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
if (object.Template != null)
message.Template = object.Template | 0;
if (object.Pass != null)
message.Pass = object.Pass | 0;
if (object.Gem) {
if (!Array.isArray(object.Gem))
throw TypeError(".tutorial.ResMining.Gem: array expected");
message.Gem = [];
for (var i = 0; i < object.Gem.length; ++i)
message.Gem[i] = object.Gem[i] | 0;
}
if (object.Map) {
if (typeof object.Map !== "object")
throw TypeError(".tutorial.ResMining.Map: object expected");
message.Map = {};
for (var keys = Object.keys(object.Map), i = 0; i < keys.length; ++i)
message.Map[keys[i]] = String(object.Map[keys[i]]);
}
if (object.Mining != null)
message.Mining = object.Mining | 0;
return message;
};
/**
* Creates a plain object from a ResMining message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResMining
* @static
* @param {tutorial.ResMining} message ResMining
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResMining.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Gem = [];
if (options.objects || options.defaults)
object.Map = {};
if (options.defaults) {
object.Id = 0;
object.Status = 0;
object.EndTime = 0;
object.Template = 0;
object.Pass = 0;
object.Mining = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
if (message.Template != null && message.hasOwnProperty("Template"))
object.Template = message.Template;
if (message.Pass != null && message.hasOwnProperty("Pass"))
object.Pass = message.Pass;
if (message.Gem && message.Gem.length) {
object.Gem = [];
for (var j = 0; j < message.Gem.length; ++j)
object.Gem[j] = message.Gem[j];
}
var keys2;
if (message.Map && (keys2 = Object.keys(message.Map)).length) {
object.Map = {};
for (var j = 0; j < keys2.length; ++j)
object.Map[keys2[j]] = message.Map[keys2[j]];
}
if (message.Mining != null && message.hasOwnProperty("Mining"))
object.Mining = message.Mining;
return object;
};
/**
* Converts this ResMining to JSON.
* @function toJSON
* @memberof tutorial.ResMining
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResMining.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResMining
* @function getTypeUrl
* @memberof tutorial.ResMining
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResMining.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResMining";
};
return ResMining;
})();
tutorial.ReqMiningTake = (function() {
/**
* Properties of a ReqMiningTake.
* @memberof tutorial
* @interface IReqMiningTake
* @property {Object.<string,string>|null} [Map] ReqMiningTake Map
* @property {number|null} [Gem] ReqMiningTake Gem
*/
/**
* Constructs a new ReqMiningTake.
* @memberof tutorial
* @classdesc Represents a ReqMiningTake.
* @implements IReqMiningTake
* @constructor
* @param {tutorial.IReqMiningTake=} [properties] Properties to set
*/
function ReqMiningTake(properties) {
this.Map = {};
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]];
}
/**
* ReqMiningTake Map.
* @member {Object.<string,string>} Map
* @memberof tutorial.ReqMiningTake
* @instance
*/
ReqMiningTake.prototype.Map = $util.emptyObject;
/**
* ReqMiningTake Gem.
* @member {number} Gem
* @memberof tutorial.ReqMiningTake
* @instance
*/
ReqMiningTake.prototype.Gem = 0;
/**
* Creates a new ReqMiningTake instance using the specified properties.
* @function create
* @memberof tutorial.ReqMiningTake
* @static
* @param {tutorial.IReqMiningTake=} [properties] Properties to set
* @returns {tutorial.ReqMiningTake} ReqMiningTake instance
*/
ReqMiningTake.create = function create(properties) {
return new ReqMiningTake(properties);
};
/**
* Encodes the specified ReqMiningTake message. Does not implicitly {@link tutorial.ReqMiningTake.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqMiningTake
* @static
* @param {tutorial.IReqMiningTake} message ReqMiningTake message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMiningTake.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Map != null && Object.hasOwnProperty.call(message, "Map"))
for (var keys = Object.keys(message.Map), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.Map[keys[i]]).ldelim();
if (message.Gem != null && Object.hasOwnProperty.call(message, "Gem"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Gem);
return writer;
};
/**
* Encodes the specified ReqMiningTake message, length delimited. Does not implicitly {@link tutorial.ReqMiningTake.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqMiningTake
* @static
* @param {tutorial.IReqMiningTake} message ReqMiningTake message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMiningTake.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqMiningTake message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqMiningTake
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqMiningTake} ReqMiningTake
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMiningTake.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.ReqMiningTake(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Map === $util.emptyObject)
message.Map = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Map[key] = value;
break;
}
case 2: {
message.Gem = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqMiningTake message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqMiningTake
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqMiningTake} ReqMiningTake
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMiningTake.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqMiningTake message.
* @function verify
* @memberof tutorial.ReqMiningTake
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqMiningTake.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Map != null && message.hasOwnProperty("Map")) {
if (!$util.isObject(message.Map))
return "Map: object expected";
var key = Object.keys(message.Map);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Map: integer key{k:int32} expected";
if (!$util.isString(message.Map[key[i]]))
return "Map: string{k:int32} expected";
}
}
if (message.Gem != null && message.hasOwnProperty("Gem"))
if (!$util.isInteger(message.Gem))
return "Gem: integer expected";
return null;
};
/**
* Creates a ReqMiningTake message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqMiningTake
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqMiningTake} ReqMiningTake
*/
ReqMiningTake.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqMiningTake)
return object;
var message = new $root.tutorial.ReqMiningTake();
if (object.Map) {
if (typeof object.Map !== "object")
throw TypeError(".tutorial.ReqMiningTake.Map: object expected");
message.Map = {};
for (var keys = Object.keys(object.Map), i = 0; i < keys.length; ++i)
message.Map[keys[i]] = String(object.Map[keys[i]]);
}
if (object.Gem != null)
message.Gem = object.Gem | 0;
return message;
};
/**
* Creates a plain object from a ReqMiningTake message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqMiningTake
* @static
* @param {tutorial.ReqMiningTake} message ReqMiningTake
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqMiningTake.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Map = {};
if (options.defaults)
object.Gem = 0;
var keys2;
if (message.Map && (keys2 = Object.keys(message.Map)).length) {
object.Map = {};
for (var j = 0; j < keys2.length; ++j)
object.Map[keys2[j]] = message.Map[keys2[j]];
}
if (message.Gem != null && message.hasOwnProperty("Gem"))
object.Gem = message.Gem;
return object;
};
/**
* Converts this ReqMiningTake to JSON.
* @function toJSON
* @memberof tutorial.ReqMiningTake
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqMiningTake.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqMiningTake
* @function getTypeUrl
* @memberof tutorial.ReqMiningTake
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqMiningTake.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqMiningTake";
};
return ReqMiningTake;
})();
tutorial.ResMiningTake = (function() {
/**
* Properties of a ResMiningTake.
* @memberof tutorial
* @interface IResMiningTake
* @property {tutorial.RES_CODE|null} [Code] ResMiningTake Code
* @property {string|null} [Msg] ResMiningTake Msg
*/
/**
* Constructs a new ResMiningTake.
* @memberof tutorial
* @classdesc Represents a ResMiningTake.
* @implements IResMiningTake
* @constructor
* @param {tutorial.IResMiningTake=} [properties] Properties to set
*/
function ResMiningTake(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]];
}
/**
* ResMiningTake Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResMiningTake
* @instance
*/
ResMiningTake.prototype.Code = 0;
/**
* ResMiningTake Msg.
* @member {string} Msg
* @memberof tutorial.ResMiningTake
* @instance
*/
ResMiningTake.prototype.Msg = "";
/**
* Creates a new ResMiningTake instance using the specified properties.
* @function create
* @memberof tutorial.ResMiningTake
* @static
* @param {tutorial.IResMiningTake=} [properties] Properties to set
* @returns {tutorial.ResMiningTake} ResMiningTake instance
*/
ResMiningTake.create = function create(properties) {
return new ResMiningTake(properties);
};
/**
* Encodes the specified ResMiningTake message. Does not implicitly {@link tutorial.ResMiningTake.verify|verify} messages.
* @function encode
* @memberof tutorial.ResMiningTake
* @static
* @param {tutorial.IResMiningTake} message ResMiningTake message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMiningTake.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResMiningTake message, length delimited. Does not implicitly {@link tutorial.ResMiningTake.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResMiningTake
* @static
* @param {tutorial.IResMiningTake} message ResMiningTake message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMiningTake.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResMiningTake message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResMiningTake
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResMiningTake} ResMiningTake
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMiningTake.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.ResMiningTake();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResMiningTake message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResMiningTake
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResMiningTake} ResMiningTake
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMiningTake.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResMiningTake message.
* @function verify
* @memberof tutorial.ResMiningTake
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResMiningTake.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResMiningTake message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResMiningTake
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResMiningTake} ResMiningTake
*/
ResMiningTake.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResMiningTake)
return object;
var message = new $root.tutorial.ResMiningTake();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResMiningTake message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResMiningTake
* @static
* @param {tutorial.ResMiningTake} message ResMiningTake
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResMiningTake.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResMiningTake to JSON.
* @function toJSON
* @memberof tutorial.ResMiningTake
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResMiningTake.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResMiningTake
* @function getTypeUrl
* @memberof tutorial.ResMiningTake
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResMiningTake.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResMiningTake";
};
return ResMiningTake;
})();
tutorial.ReqMiningReward = (function() {
/**
* Properties of a ReqMiningReward.
* @memberof tutorial
* @interface IReqMiningReward
*/
/**
* Constructs a new ReqMiningReward.
* @memberof tutorial
* @classdesc Represents a ReqMiningReward.
* @implements IReqMiningReward
* @constructor
* @param {tutorial.IReqMiningReward=} [properties] Properties to set
*/
function ReqMiningReward(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]];
}
/**
* Creates a new ReqMiningReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqMiningReward
* @static
* @param {tutorial.IReqMiningReward=} [properties] Properties to set
* @returns {tutorial.ReqMiningReward} ReqMiningReward instance
*/
ReqMiningReward.create = function create(properties) {
return new ReqMiningReward(properties);
};
/**
* Encodes the specified ReqMiningReward message. Does not implicitly {@link tutorial.ReqMiningReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqMiningReward
* @static
* @param {tutorial.IReqMiningReward} message ReqMiningReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMiningReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqMiningReward message, length delimited. Does not implicitly {@link tutorial.ReqMiningReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqMiningReward
* @static
* @param {tutorial.IReqMiningReward} message ReqMiningReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqMiningReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqMiningReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqMiningReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqMiningReward} ReqMiningReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMiningReward.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.ReqMiningReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqMiningReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqMiningReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqMiningReward} ReqMiningReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqMiningReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqMiningReward message.
* @function verify
* @memberof tutorial.ReqMiningReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqMiningReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqMiningReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqMiningReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqMiningReward} ReqMiningReward
*/
ReqMiningReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqMiningReward)
return object;
return new $root.tutorial.ReqMiningReward();
};
/**
* Creates a plain object from a ReqMiningReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqMiningReward
* @static
* @param {tutorial.ReqMiningReward} message ReqMiningReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqMiningReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqMiningReward to JSON.
* @function toJSON
* @memberof tutorial.ReqMiningReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqMiningReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqMiningReward
* @function getTypeUrl
* @memberof tutorial.ReqMiningReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqMiningReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqMiningReward";
};
return ReqMiningReward;
})();
tutorial.ResMiningReward = (function() {
/**
* Properties of a ResMiningReward.
* @memberof tutorial
* @interface IResMiningReward
* @property {tutorial.RES_CODE|null} [Code] ResMiningReward Code
* @property {string|null} [Msg] ResMiningReward Msg
*/
/**
* Constructs a new ResMiningReward.
* @memberof tutorial
* @classdesc Represents a ResMiningReward.
* @implements IResMiningReward
* @constructor
* @param {tutorial.IResMiningReward=} [properties] Properties to set
*/
function ResMiningReward(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]];
}
/**
* ResMiningReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResMiningReward
* @instance
*/
ResMiningReward.prototype.Code = 0;
/**
* ResMiningReward Msg.
* @member {string} Msg
* @memberof tutorial.ResMiningReward
* @instance
*/
ResMiningReward.prototype.Msg = "";
/**
* Creates a new ResMiningReward instance using the specified properties.
* @function create
* @memberof tutorial.ResMiningReward
* @static
* @param {tutorial.IResMiningReward=} [properties] Properties to set
* @returns {tutorial.ResMiningReward} ResMiningReward instance
*/
ResMiningReward.create = function create(properties) {
return new ResMiningReward(properties);
};
/**
* Encodes the specified ResMiningReward message. Does not implicitly {@link tutorial.ResMiningReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResMiningReward
* @static
* @param {tutorial.IResMiningReward} message ResMiningReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMiningReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResMiningReward message, length delimited. Does not implicitly {@link tutorial.ResMiningReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResMiningReward
* @static
* @param {tutorial.IResMiningReward} message ResMiningReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResMiningReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResMiningReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResMiningReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResMiningReward} ResMiningReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMiningReward.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.ResMiningReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResMiningReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResMiningReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResMiningReward} ResMiningReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResMiningReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResMiningReward message.
* @function verify
* @memberof tutorial.ResMiningReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResMiningReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResMiningReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResMiningReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResMiningReward} ResMiningReward
*/
ResMiningReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResMiningReward)
return object;
var message = new $root.tutorial.ResMiningReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResMiningReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResMiningReward
* @static
* @param {tutorial.ResMiningReward} message ResMiningReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResMiningReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResMiningReward to JSON.
* @function toJSON
* @memberof tutorial.ResMiningReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResMiningReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResMiningReward
* @function getTypeUrl
* @memberof tutorial.ResMiningReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResMiningReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResMiningReward";
};
return ResMiningReward;
})();
tutorial.ResActRed = (function() {
/**
* Properties of a ResActRed.
* @memberof tutorial
* @interface IResActRed
* @property {Object.<string,number>|null} [Red] ResActRed Red
*/
/**
* Constructs a new ResActRed.
* @memberof tutorial
* @classdesc Represents a ResActRed.
* @implements IResActRed
* @constructor
* @param {tutorial.IResActRed=} [properties] Properties to set
*/
function ResActRed(properties) {
this.Red = {};
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]];
}
/**
* ResActRed Red.
* @member {Object.<string,number>} Red
* @memberof tutorial.ResActRed
* @instance
*/
ResActRed.prototype.Red = $util.emptyObject;
/**
* Creates a new ResActRed instance using the specified properties.
* @function create
* @memberof tutorial.ResActRed
* @static
* @param {tutorial.IResActRed=} [properties] Properties to set
* @returns {tutorial.ResActRed} ResActRed instance
*/
ResActRed.create = function create(properties) {
return new ResActRed(properties);
};
/**
* Encodes the specified ResActRed message. Does not implicitly {@link tutorial.ResActRed.verify|verify} messages.
* @function encode
* @memberof tutorial.ResActRed
* @static
* @param {tutorial.IResActRed} message ResActRed message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResActRed.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Red != null && Object.hasOwnProperty.call(message, "Red"))
for (var keys = Object.keys(message.Red), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Red[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ResActRed message, length delimited. Does not implicitly {@link tutorial.ResActRed.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResActRed
* @static
* @param {tutorial.IResActRed} message ResActRed message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResActRed.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResActRed message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResActRed
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResActRed} ResActRed
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResActRed.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.ResActRed(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Red === $util.emptyObject)
message.Red = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Red[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResActRed message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResActRed
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResActRed} ResActRed
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResActRed.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResActRed message.
* @function verify
* @memberof tutorial.ResActRed
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResActRed.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Red != null && message.hasOwnProperty("Red")) {
if (!$util.isObject(message.Red))
return "Red: object expected";
var key = Object.keys(message.Red);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Red: integer key{k:int32} expected";
if (!$util.isInteger(message.Red[key[i]]))
return "Red: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates a ResActRed message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResActRed
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResActRed} ResActRed
*/
ResActRed.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResActRed)
return object;
var message = new $root.tutorial.ResActRed();
if (object.Red) {
if (typeof object.Red !== "object")
throw TypeError(".tutorial.ResActRed.Red: object expected");
message.Red = {};
for (var keys = Object.keys(object.Red), i = 0; i < keys.length; ++i)
message.Red[keys[i]] = object.Red[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ResActRed message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResActRed
* @static
* @param {tutorial.ResActRed} message ResActRed
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResActRed.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Red = {};
var keys2;
if (message.Red && (keys2 = Object.keys(message.Red)).length) {
object.Red = {};
for (var j = 0; j < keys2.length; ++j)
object.Red[keys2[j]] = message.Red[keys2[j]];
}
return object;
};
/**
* Converts this ResActRed to JSON.
* @function toJSON
* @memberof tutorial.ResActRed
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResActRed.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResActRed
* @function getTypeUrl
* @memberof tutorial.ResActRed
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResActRed.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResActRed";
};
return ResActRed;
})();
tutorial.NotifyActRed = (function() {
/**
* Properties of a NotifyActRed.
* @memberof tutorial
* @interface INotifyActRed
* @property {number|null} [Id] NotifyActRed Id
* @property {number|null} [Red] NotifyActRed Red
*/
/**
* Constructs a new NotifyActRed.
* @memberof tutorial
* @classdesc Represents a NotifyActRed.
* @implements INotifyActRed
* @constructor
* @param {tutorial.INotifyActRed=} [properties] Properties to set
*/
function NotifyActRed(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]];
}
/**
* NotifyActRed Id.
* @member {number} Id
* @memberof tutorial.NotifyActRed
* @instance
*/
NotifyActRed.prototype.Id = 0;
/**
* NotifyActRed Red.
* @member {number} Red
* @memberof tutorial.NotifyActRed
* @instance
*/
NotifyActRed.prototype.Red = 0;
/**
* Creates a new NotifyActRed instance using the specified properties.
* @function create
* @memberof tutorial.NotifyActRed
* @static
* @param {tutorial.INotifyActRed=} [properties] Properties to set
* @returns {tutorial.NotifyActRed} NotifyActRed instance
*/
NotifyActRed.create = function create(properties) {
return new NotifyActRed(properties);
};
/**
* Encodes the specified NotifyActRed message. Does not implicitly {@link tutorial.NotifyActRed.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyActRed
* @static
* @param {tutorial.INotifyActRed} message NotifyActRed message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyActRed.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Red != null && Object.hasOwnProperty.call(message, "Red"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Red);
return writer;
};
/**
* Encodes the specified NotifyActRed message, length delimited. Does not implicitly {@link tutorial.NotifyActRed.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyActRed
* @static
* @param {tutorial.INotifyActRed} message NotifyActRed message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyActRed.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyActRed message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyActRed
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyActRed} NotifyActRed
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyActRed.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.NotifyActRed();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Red = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyActRed message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyActRed
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyActRed} NotifyActRed
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyActRed.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyActRed message.
* @function verify
* @memberof tutorial.NotifyActRed
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyActRed.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))
return "Id: integer expected";
if (message.Red != null && message.hasOwnProperty("Red"))
if (!$util.isInteger(message.Red))
return "Red: integer expected";
return null;
};
/**
* Creates a NotifyActRed message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyActRed
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyActRed} NotifyActRed
*/
NotifyActRed.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyActRed)
return object;
var message = new $root.tutorial.NotifyActRed();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Red != null)
message.Red = object.Red | 0;
return message;
};
/**
* Creates a plain object from a NotifyActRed message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyActRed
* @static
* @param {tutorial.NotifyActRed} message NotifyActRed
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyActRed.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.Red = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Red != null && message.hasOwnProperty("Red"))
object.Red = message.Red;
return object;
};
/**
* Converts this NotifyActRed to JSON.
* @function toJSON
* @memberof tutorial.NotifyActRed
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyActRed.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyActRed
* @function getTypeUrl
* @memberof tutorial.NotifyActRed
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyActRed.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyActRed";
};
return NotifyActRed;
})();
tutorial.ActivityNotify = (function() {
/**
* Properties of an ActivityNotify.
* @memberof tutorial
* @interface IActivityNotify
* @property {tutorial.IActivityInfo|null} [Info] ActivityNotify Info
*/
/**
* Constructs a new ActivityNotify.
* @memberof tutorial
* @classdesc Represents an ActivityNotify.
* @implements IActivityNotify
* @constructor
* @param {tutorial.IActivityNotify=} [properties] Properties to set
*/
function ActivityNotify(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]];
}
/**
* ActivityNotify Info.
* @member {tutorial.IActivityInfo|null|undefined} Info
* @memberof tutorial.ActivityNotify
* @instance
*/
ActivityNotify.prototype.Info = null;
/**
* Creates a new ActivityNotify instance using the specified properties.
* @function create
* @memberof tutorial.ActivityNotify
* @static
* @param {tutorial.IActivityNotify=} [properties] Properties to set
* @returns {tutorial.ActivityNotify} ActivityNotify instance
*/
ActivityNotify.create = function create(properties) {
return new ActivityNotify(properties);
};
/**
* Encodes the specified ActivityNotify message. Does not implicitly {@link tutorial.ActivityNotify.verify|verify} messages.
* @function encode
* @memberof tutorial.ActivityNotify
* @static
* @param {tutorial.IActivityNotify} message ActivityNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ActivityNotify.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Info != null && Object.hasOwnProperty.call(message, "Info"))
$root.tutorial.ActivityInfo.encode(message.Info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ActivityNotify message, length delimited. Does not implicitly {@link tutorial.ActivityNotify.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ActivityNotify
* @static
* @param {tutorial.IActivityNotify} message ActivityNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ActivityNotify.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ActivityNotify message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ActivityNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ActivityNotify} ActivityNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ActivityNotify.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.ActivityNotify();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Info = $root.tutorial.ActivityInfo.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ActivityNotify message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ActivityNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ActivityNotify} ActivityNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ActivityNotify.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ActivityNotify message.
* @function verify
* @memberof tutorial.ActivityNotify
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ActivityNotify.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Info != null && message.hasOwnProperty("Info")) {
var error = $root.tutorial.ActivityInfo.verify(message.Info);
if (error)
return "Info." + error;
}
return null;
};
/**
* Creates an ActivityNotify message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ActivityNotify
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ActivityNotify} ActivityNotify
*/
ActivityNotify.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ActivityNotify)
return object;
var message = new $root.tutorial.ActivityNotify();
if (object.Info != null) {
if (typeof object.Info !== "object")
throw TypeError(".tutorial.ActivityNotify.Info: object expected");
message.Info = $root.tutorial.ActivityInfo.fromObject(object.Info);
}
return message;
};
/**
* Creates a plain object from an ActivityNotify message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ActivityNotify
* @static
* @param {tutorial.ActivityNotify} message ActivityNotify
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ActivityNotify.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Info = null;
if (message.Info != null && message.hasOwnProperty("Info"))
object.Info = $root.tutorial.ActivityInfo.toObject(message.Info, options);
return object;
};
/**
* Converts this ActivityNotify to JSON.
* @function toJSON
* @memberof tutorial.ActivityNotify
* @instance
* @returns {Object.<string,*>} JSON object
*/
ActivityNotify.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ActivityNotify
* @function getTypeUrl
* @memberof tutorial.ActivityNotify
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ActivityNotify.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ActivityNotify";
};
return ActivityNotify;
})();
tutorial.ResItem = (function() {
/**
* Properties of a ResItem.
* @memberof tutorial
* @interface IResItem
* @property {Object.<string,number>|null} [Item] ResItem Item
*/
/**
* Constructs a new ResItem.
* @memberof tutorial
* @classdesc Represents a ResItem.
* @implements IResItem
* @constructor
* @param {tutorial.IResItem=} [properties] Properties to set
*/
function ResItem(properties) {
this.Item = {};
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]];
}
/**
* ResItem Item.
* @member {Object.<string,number>} Item
* @memberof tutorial.ResItem
* @instance
*/
ResItem.prototype.Item = $util.emptyObject;
/**
* Creates a new ResItem instance using the specified properties.
* @function create
* @memberof tutorial.ResItem
* @static
* @param {tutorial.IResItem=} [properties] Properties to set
* @returns {tutorial.ResItem} ResItem instance
*/
ResItem.create = function create(properties) {
return new ResItem(properties);
};
/**
* Encodes the specified ResItem message. Does not implicitly {@link tutorial.ResItem.verify|verify} messages.
* @function encode
* @memberof tutorial.ResItem
* @static
* @param {tutorial.IResItem} message ResItem message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResItem.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Item != null && Object.hasOwnProperty.call(message, "Item"))
for (var keys = Object.keys(message.Item), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Item[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ResItem message, length delimited. Does not implicitly {@link tutorial.ResItem.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResItem
* @static
* @param {tutorial.IResItem} message ResItem message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResItem.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResItem message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResItem
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResItem} ResItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResItem.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.ResItem(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Item === $util.emptyObject)
message.Item = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Item[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResItem message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResItem
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResItem} ResItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResItem.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResItem message.
* @function verify
* @memberof tutorial.ResItem
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResItem.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Item != null && message.hasOwnProperty("Item")) {
if (!$util.isObject(message.Item))
return "Item: object expected";
var key = Object.keys(message.Item);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Item: integer key{k:int32} expected";
if (!$util.isInteger(message.Item[key[i]]))
return "Item: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates a ResItem message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResItem
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResItem} ResItem
*/
ResItem.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResItem)
return object;
var message = new $root.tutorial.ResItem();
if (object.Item) {
if (typeof object.Item !== "object")
throw TypeError(".tutorial.ResItem.Item: object expected");
message.Item = {};
for (var keys = Object.keys(object.Item), i = 0; i < keys.length; ++i)
message.Item[keys[i]] = object.Item[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ResItem message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResItem
* @static
* @param {tutorial.ResItem} message ResItem
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResItem.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Item = {};
var keys2;
if (message.Item && (keys2 = Object.keys(message.Item)).length) {
object.Item = {};
for (var j = 0; j < keys2.length; ++j)
object.Item[keys2[j]] = message.Item[keys2[j]];
}
return object;
};
/**
* Converts this ResItem to JSON.
* @function toJSON
* @memberof tutorial.ResItem
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResItem.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResItem
* @function getTypeUrl
* @memberof tutorial.ResItem
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResItem";
};
return ResItem;
})();
tutorial.ItemNotify = (function() {
/**
* Properties of an ItemNotify.
* @memberof tutorial
* @interface IItemNotify
* @property {Object.<string,number>|null} [Item] ItemNotify Item
*/
/**
* Constructs a new ItemNotify.
* @memberof tutorial
* @classdesc Represents an ItemNotify.
* @implements IItemNotify
* @constructor
* @param {tutorial.IItemNotify=} [properties] Properties to set
*/
function ItemNotify(properties) {
this.Item = {};
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]];
}
/**
* ItemNotify Item.
* @member {Object.<string,number>} Item
* @memberof tutorial.ItemNotify
* @instance
*/
ItemNotify.prototype.Item = $util.emptyObject;
/**
* Creates a new ItemNotify instance using the specified properties.
* @function create
* @memberof tutorial.ItemNotify
* @static
* @param {tutorial.IItemNotify=} [properties] Properties to set
* @returns {tutorial.ItemNotify} ItemNotify instance
*/
ItemNotify.create = function create(properties) {
return new ItemNotify(properties);
};
/**
* Encodes the specified ItemNotify message. Does not implicitly {@link tutorial.ItemNotify.verify|verify} messages.
* @function encode
* @memberof tutorial.ItemNotify
* @static
* @param {tutorial.IItemNotify} message ItemNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ItemNotify.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Item != null && Object.hasOwnProperty.call(message, "Item"))
for (var keys = Object.keys(message.Item), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Item[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ItemNotify message, length delimited. Does not implicitly {@link tutorial.ItemNotify.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ItemNotify
* @static
* @param {tutorial.IItemNotify} message ItemNotify message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ItemNotify.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ItemNotify message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ItemNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ItemNotify} ItemNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ItemNotify.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.ItemNotify(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Item === $util.emptyObject)
message.Item = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Item[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ItemNotify message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ItemNotify
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ItemNotify} ItemNotify
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ItemNotify.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ItemNotify message.
* @function verify
* @memberof tutorial.ItemNotify
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ItemNotify.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Item != null && message.hasOwnProperty("Item")) {
if (!$util.isObject(message.Item))
return "Item: object expected";
var key = Object.keys(message.Item);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Item: integer key{k:int32} expected";
if (!$util.isInteger(message.Item[key[i]]))
return "Item: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates an ItemNotify message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ItemNotify
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ItemNotify} ItemNotify
*/
ItemNotify.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ItemNotify)
return object;
var message = new $root.tutorial.ItemNotify();
if (object.Item) {
if (typeof object.Item !== "object")
throw TypeError(".tutorial.ItemNotify.Item: object expected");
message.Item = {};
for (var keys = Object.keys(object.Item), i = 0; i < keys.length; ++i)
message.Item[keys[i]] = object.Item[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from an ItemNotify message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ItemNotify
* @static
* @param {tutorial.ItemNotify} message ItemNotify
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ItemNotify.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Item = {};
var keys2;
if (message.Item && (keys2 = Object.keys(message.Item)).length) {
object.Item = {};
for (var j = 0; j < keys2.length; ++j)
object.Item[keys2[j]] = message.Item[keys2[j]];
}
return object;
};
/**
* Converts this ItemNotify to JSON.
* @function toJSON
* @memberof tutorial.ItemNotify
* @instance
* @returns {Object.<string,*>} JSON object
*/
ItemNotify.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ItemNotify
* @function getTypeUrl
* @memberof tutorial.ItemNotify
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ItemNotify.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ItemNotify";
};
return ItemNotify;
})();
tutorial.ReqGuessColor = (function() {
/**
* Properties of a ReqGuessColor.
* @memberof tutorial
* @interface IReqGuessColor
*/
/**
* Constructs a new ReqGuessColor.
* @memberof tutorial
* @classdesc Represents a ReqGuessColor.
* @implements IReqGuessColor
* @constructor
* @param {tutorial.IReqGuessColor=} [properties] Properties to set
*/
function ReqGuessColor(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]];
}
/**
* Creates a new ReqGuessColor instance using the specified properties.
* @function create
* @memberof tutorial.ReqGuessColor
* @static
* @param {tutorial.IReqGuessColor=} [properties] Properties to set
* @returns {tutorial.ReqGuessColor} ReqGuessColor instance
*/
ReqGuessColor.create = function create(properties) {
return new ReqGuessColor(properties);
};
/**
* Encodes the specified ReqGuessColor message. Does not implicitly {@link tutorial.ReqGuessColor.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGuessColor
* @static
* @param {tutorial.IReqGuessColor} message ReqGuessColor message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGuessColor.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqGuessColor message, length delimited. Does not implicitly {@link tutorial.ReqGuessColor.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGuessColor
* @static
* @param {tutorial.IReqGuessColor} message ReqGuessColor message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGuessColor.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGuessColor message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGuessColor
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGuessColor} ReqGuessColor
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGuessColor.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.ReqGuessColor();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGuessColor message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGuessColor
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGuessColor} ReqGuessColor
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGuessColor.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGuessColor message.
* @function verify
* @memberof tutorial.ReqGuessColor
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGuessColor.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqGuessColor message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGuessColor
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGuessColor} ReqGuessColor
*/
ReqGuessColor.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGuessColor)
return object;
return new $root.tutorial.ReqGuessColor();
};
/**
* Creates a plain object from a ReqGuessColor message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGuessColor
* @static
* @param {tutorial.ReqGuessColor} message ReqGuessColor
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGuessColor.toObject = function toObject() {
return {};
};
/**
* Converts this ReqGuessColor to JSON.
* @function toJSON
* @memberof tutorial.ReqGuessColor
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGuessColor.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGuessColor
* @function getTypeUrl
* @memberof tutorial.ReqGuessColor
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGuessColor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGuessColor";
};
return ReqGuessColor;
})();
tutorial.ResGuessColor = (function() {
/**
* Properties of a ResGuessColor.
* @memberof tutorial
* @interface IResGuessColor
* @property {number|null} [Id] ResGuessColor Id
* @property {number|null} [Status] ResGuessColor Status
* @property {number|null} [EndTime] ResGuessColor EndTime
* @property {number|null} [Template] ResGuessColor Template
* @property {number|null} [Pass] ResGuessColor Pass
* @property {Array.<number>|null} [Color] ResGuessColor Color
* @property {Array.<number>|null} [Pos] ResGuessColor Pos
* @property {tutorial.Iopponent|null} [Opponent] ResGuessColor Opponent
*/
/**
* Constructs a new ResGuessColor.
* @memberof tutorial
* @classdesc Represents a ResGuessColor.
* @implements IResGuessColor
* @constructor
* @param {tutorial.IResGuessColor=} [properties] Properties to set
*/
function ResGuessColor(properties) {
this.Color = [];
this.Pos = [];
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]];
}
/**
* ResGuessColor Id.
* @member {number} Id
* @memberof tutorial.ResGuessColor
* @instance
*/
ResGuessColor.prototype.Id = 0;
/**
* ResGuessColor Status.
* @member {number} Status
* @memberof tutorial.ResGuessColor
* @instance
*/
ResGuessColor.prototype.Status = 0;
/**
* ResGuessColor EndTime.
* @member {number} EndTime
* @memberof tutorial.ResGuessColor
* @instance
*/
ResGuessColor.prototype.EndTime = 0;
/**
* ResGuessColor Template.
* @member {number} Template
* @memberof tutorial.ResGuessColor
* @instance
*/
ResGuessColor.prototype.Template = 0;
/**
* ResGuessColor Pass.
* @member {number} Pass
* @memberof tutorial.ResGuessColor
* @instance
*/
ResGuessColor.prototype.Pass = 0;
/**
* ResGuessColor Color.
* @member {Array.<number>} Color
* @memberof tutorial.ResGuessColor
* @instance
*/
ResGuessColor.prototype.Color = $util.emptyArray;
/**
* ResGuessColor Pos.
* @member {Array.<number>} Pos
* @memberof tutorial.ResGuessColor
* @instance
*/
ResGuessColor.prototype.Pos = $util.emptyArray;
/**
* ResGuessColor Opponent.
* @member {tutorial.Iopponent|null|undefined} Opponent
* @memberof tutorial.ResGuessColor
* @instance
*/
ResGuessColor.prototype.Opponent = null;
/**
* Creates a new ResGuessColor instance using the specified properties.
* @function create
* @memberof tutorial.ResGuessColor
* @static
* @param {tutorial.IResGuessColor=} [properties] Properties to set
* @returns {tutorial.ResGuessColor} ResGuessColor instance
*/
ResGuessColor.create = function create(properties) {
return new ResGuessColor(properties);
};
/**
* Encodes the specified ResGuessColor message. Does not implicitly {@link tutorial.ResGuessColor.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGuessColor
* @static
* @param {tutorial.IResGuessColor} message ResGuessColor message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuessColor.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Status);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.EndTime);
if (message.Template != null && Object.hasOwnProperty.call(message, "Template"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Template);
if (message.Pass != null && Object.hasOwnProperty.call(message, "Pass"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Pass);
if (message.Color != null && message.Color.length) {
writer.uint32(/* id 6, wireType 2 =*/50).fork();
for (var i = 0; i < message.Color.length; ++i)
writer.int32(message.Color[i]);
writer.ldelim();
}
if (message.Pos != null && message.Pos.length) {
writer.uint32(/* id 7, wireType 2 =*/58).fork();
for (var i = 0; i < message.Pos.length; ++i)
writer.int32(message.Pos[i]);
writer.ldelim();
}
if (message.Opponent != null && Object.hasOwnProperty.call(message, "Opponent"))
$root.tutorial.opponent.encode(message.Opponent, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResGuessColor message, length delimited. Does not implicitly {@link tutorial.ResGuessColor.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGuessColor
* @static
* @param {tutorial.IResGuessColor} message ResGuessColor message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuessColor.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGuessColor message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGuessColor
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGuessColor} ResGuessColor
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuessColor.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.ResGuessColor();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Status = reader.int32();
break;
}
case 3: {
message.EndTime = reader.int32();
break;
}
case 4: {
message.Template = reader.int32();
break;
}
case 5: {
message.Pass = reader.int32();
break;
}
case 6: {
if (!(message.Color && message.Color.length))
message.Color = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Color.push(reader.int32());
} else
message.Color.push(reader.int32());
break;
}
case 7: {
if (!(message.Pos && message.Pos.length))
message.Pos = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Pos.push(reader.int32());
} else
message.Pos.push(reader.int32());
break;
}
case 8: {
message.Opponent = $root.tutorial.opponent.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGuessColor message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGuessColor
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGuessColor} ResGuessColor
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuessColor.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGuessColor message.
* @function verify
* @memberof tutorial.ResGuessColor
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGuessColor.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))
return "Id: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
if (message.Template != null && message.hasOwnProperty("Template"))
if (!$util.isInteger(message.Template))
return "Template: integer expected";
if (message.Pass != null && message.hasOwnProperty("Pass"))
if (!$util.isInteger(message.Pass))
return "Pass: integer expected";
if (message.Color != null && message.hasOwnProperty("Color")) {
if (!Array.isArray(message.Color))
return "Color: array expected";
for (var i = 0; i < message.Color.length; ++i)
if (!$util.isInteger(message.Color[i]))
return "Color: integer[] expected";
}
if (message.Pos != null && message.hasOwnProperty("Pos")) {
if (!Array.isArray(message.Pos))
return "Pos: array expected";
for (var i = 0; i < message.Pos.length; ++i)
if (!$util.isInteger(message.Pos[i]))
return "Pos: integer[] expected";
}
if (message.Opponent != null && message.hasOwnProperty("Opponent")) {
var error = $root.tutorial.opponent.verify(message.Opponent);
if (error)
return "Opponent." + error;
}
return null;
};
/**
* Creates a ResGuessColor message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGuessColor
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGuessColor} ResGuessColor
*/
ResGuessColor.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGuessColor)
return object;
var message = new $root.tutorial.ResGuessColor();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Status != null)
message.Status = object.Status | 0;
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
if (object.Template != null)
message.Template = object.Template | 0;
if (object.Pass != null)
message.Pass = object.Pass | 0;
if (object.Color) {
if (!Array.isArray(object.Color))
throw TypeError(".tutorial.ResGuessColor.Color: array expected");
message.Color = [];
for (var i = 0; i < object.Color.length; ++i)
message.Color[i] = object.Color[i] | 0;
}
if (object.Pos) {
if (!Array.isArray(object.Pos))
throw TypeError(".tutorial.ResGuessColor.Pos: array expected");
message.Pos = [];
for (var i = 0; i < object.Pos.length; ++i)
message.Pos[i] = object.Pos[i] | 0;
}
if (object.Opponent != null) {
if (typeof object.Opponent !== "object")
throw TypeError(".tutorial.ResGuessColor.Opponent: object expected");
message.Opponent = $root.tutorial.opponent.fromObject(object.Opponent);
}
return message;
};
/**
* Creates a plain object from a ResGuessColor message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGuessColor
* @static
* @param {tutorial.ResGuessColor} message ResGuessColor
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGuessColor.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.Color = [];
object.Pos = [];
}
if (options.defaults) {
object.Id = 0;
object.Status = 0;
object.EndTime = 0;
object.Template = 0;
object.Pass = 0;
object.Opponent = null;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
if (message.Template != null && message.hasOwnProperty("Template"))
object.Template = message.Template;
if (message.Pass != null && message.hasOwnProperty("Pass"))
object.Pass = message.Pass;
if (message.Color && message.Color.length) {
object.Color = [];
for (var j = 0; j < message.Color.length; ++j)
object.Color[j] = message.Color[j];
}
if (message.Pos && message.Pos.length) {
object.Pos = [];
for (var j = 0; j < message.Pos.length; ++j)
object.Pos[j] = message.Pos[j];
}
if (message.Opponent != null && message.hasOwnProperty("Opponent"))
object.Opponent = $root.tutorial.opponent.toObject(message.Opponent, options);
return object;
};
/**
* Converts this ResGuessColor to JSON.
* @function toJSON
* @memberof tutorial.ResGuessColor
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGuessColor.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGuessColor
* @function getTypeUrl
* @memberof tutorial.ResGuessColor
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGuessColor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGuessColor";
};
return ResGuessColor;
})();
tutorial.opponent = (function() {
/**
* Properties of an opponent.
* @memberof tutorial
* @interface Iopponent
* @property {string|null} [Name] opponent Name
* @property {number|null} [Face] opponent Face
* @property {number|null} [Avatar] opponent Avatar
* @property {number|null} [Progress] opponent Progress
*/
/**
* Constructs a new opponent.
* @memberof tutorial
* @classdesc Represents an opponent.
* @implements Iopponent
* @constructor
* @param {tutorial.Iopponent=} [properties] Properties to set
*/
function opponent(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]];
}
/**
* opponent Name.
* @member {string} Name
* @memberof tutorial.opponent
* @instance
*/
opponent.prototype.Name = "";
/**
* opponent Face.
* @member {number} Face
* @memberof tutorial.opponent
* @instance
*/
opponent.prototype.Face = 0;
/**
* opponent Avatar.
* @member {number} Avatar
* @memberof tutorial.opponent
* @instance
*/
opponent.prototype.Avatar = 0;
/**
* opponent Progress.
* @member {number} Progress
* @memberof tutorial.opponent
* @instance
*/
opponent.prototype.Progress = 0;
/**
* Creates a new opponent instance using the specified properties.
* @function create
* @memberof tutorial.opponent
* @static
* @param {tutorial.Iopponent=} [properties] Properties to set
* @returns {tutorial.opponent} opponent instance
*/
opponent.create = function create(properties) {
return new opponent(properties);
};
/**
* Encodes the specified opponent message. Does not implicitly {@link tutorial.opponent.verify|verify} messages.
* @function encode
* @memberof tutorial.opponent
* @static
* @param {tutorial.Iopponent} message opponent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
opponent.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Name);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Avatar);
if (message.Progress != null && Object.hasOwnProperty.call(message, "Progress"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Progress);
return writer;
};
/**
* Encodes the specified opponent message, length delimited. Does not implicitly {@link tutorial.opponent.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.opponent
* @static
* @param {tutorial.Iopponent} message opponent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
opponent.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an opponent message from the specified reader or buffer.
* @function decode
* @memberof tutorial.opponent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.opponent} opponent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
opponent.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.opponent();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 2: {
message.Name = reader.string();
break;
}
case 3: {
message.Face = reader.int32();
break;
}
case 4: {
message.Avatar = reader.int32();
break;
}
case 5: {
message.Progress = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an opponent message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.opponent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.opponent} opponent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
opponent.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an opponent message.
* @function verify
* @memberof tutorial.opponent
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
opponent.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
if (message.Progress != null && message.hasOwnProperty("Progress"))
if (!$util.isInteger(message.Progress))
return "Progress: integer expected";
return null;
};
/**
* Creates an opponent message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.opponent
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.opponent} opponent
*/
opponent.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.opponent)
return object;
var message = new $root.tutorial.opponent();
if (object.Name != null)
message.Name = String(object.Name);
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
if (object.Progress != null)
message.Progress = object.Progress | 0;
return message;
};
/**
* Creates a plain object from an opponent message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.opponent
* @static
* @param {tutorial.opponent} message opponent
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
opponent.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Name = "";
object.Face = 0;
object.Avatar = 0;
object.Progress = 0;
}
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
if (message.Progress != null && message.hasOwnProperty("Progress"))
object.Progress = message.Progress;
return object;
};
/**
* Converts this opponent to JSON.
* @function toJSON
* @memberof tutorial.opponent
* @instance
* @returns {Object.<string,*>} JSON object
*/
opponent.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for opponent
* @function getTypeUrl
* @memberof tutorial.opponent
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
opponent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.opponent";
};
return opponent;
})();
tutorial.ReqGuessColorTake = (function() {
/**
* Properties of a ReqGuessColorTake.
* @memberof tutorial
* @interface IReqGuessColorTake
* @property {Object.<string,number>|null} [Map] ReqGuessColorTake Map
*/
/**
* Constructs a new ReqGuessColorTake.
* @memberof tutorial
* @classdesc Represents a ReqGuessColorTake.
* @implements IReqGuessColorTake
* @constructor
* @param {tutorial.IReqGuessColorTake=} [properties] Properties to set
*/
function ReqGuessColorTake(properties) {
this.Map = {};
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]];
}
/**
* ReqGuessColorTake Map.
* @member {Object.<string,number>} Map
* @memberof tutorial.ReqGuessColorTake
* @instance
*/
ReqGuessColorTake.prototype.Map = $util.emptyObject;
/**
* Creates a new ReqGuessColorTake instance using the specified properties.
* @function create
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {tutorial.IReqGuessColorTake=} [properties] Properties to set
* @returns {tutorial.ReqGuessColorTake} ReqGuessColorTake instance
*/
ReqGuessColorTake.create = function create(properties) {
return new ReqGuessColorTake(properties);
};
/**
* Encodes the specified ReqGuessColorTake message. Does not implicitly {@link tutorial.ReqGuessColorTake.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {tutorial.IReqGuessColorTake} message ReqGuessColorTake message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGuessColorTake.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Map != null && Object.hasOwnProperty.call(message, "Map"))
for (var keys = Object.keys(message.Map), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Map[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqGuessColorTake message, length delimited. Does not implicitly {@link tutorial.ReqGuessColorTake.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {tutorial.IReqGuessColorTake} message ReqGuessColorTake message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGuessColorTake.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGuessColorTake message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGuessColorTake} ReqGuessColorTake
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGuessColorTake.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.ReqGuessColorTake(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Map === $util.emptyObject)
message.Map = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Map[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGuessColorTake message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGuessColorTake} ReqGuessColorTake
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGuessColorTake.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGuessColorTake message.
* @function verify
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGuessColorTake.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Map != null && message.hasOwnProperty("Map")) {
if (!$util.isObject(message.Map))
return "Map: object expected";
var key = Object.keys(message.Map);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Map: integer key{k:int32} expected";
if (!$util.isInteger(message.Map[key[i]]))
return "Map: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates a ReqGuessColorTake message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGuessColorTake} ReqGuessColorTake
*/
ReqGuessColorTake.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGuessColorTake)
return object;
var message = new $root.tutorial.ReqGuessColorTake();
if (object.Map) {
if (typeof object.Map !== "object")
throw TypeError(".tutorial.ReqGuessColorTake.Map: object expected");
message.Map = {};
for (var keys = Object.keys(object.Map), i = 0; i < keys.length; ++i)
message.Map[keys[i]] = object.Map[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqGuessColorTake message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {tutorial.ReqGuessColorTake} message ReqGuessColorTake
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGuessColorTake.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Map = {};
var keys2;
if (message.Map && (keys2 = Object.keys(message.Map)).length) {
object.Map = {};
for (var j = 0; j < keys2.length; ++j)
object.Map[keys2[j]] = message.Map[keys2[j]];
}
return object;
};
/**
* Converts this ReqGuessColorTake to JSON.
* @function toJSON
* @memberof tutorial.ReqGuessColorTake
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGuessColorTake.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGuessColorTake
* @function getTypeUrl
* @memberof tutorial.ReqGuessColorTake
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGuessColorTake.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGuessColorTake";
};
return ReqGuessColorTake;
})();
tutorial.ResGuessColorTake = (function() {
/**
* Properties of a ResGuessColorTake.
* @memberof tutorial
* @interface IResGuessColorTake
* @property {tutorial.RES_CODE|null} [Code] ResGuessColorTake Code
* @property {string|null} [Msg] ResGuessColorTake Msg
*/
/**
* Constructs a new ResGuessColorTake.
* @memberof tutorial
* @classdesc Represents a ResGuessColorTake.
* @implements IResGuessColorTake
* @constructor
* @param {tutorial.IResGuessColorTake=} [properties] Properties to set
*/
function ResGuessColorTake(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]];
}
/**
* ResGuessColorTake Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGuessColorTake
* @instance
*/
ResGuessColorTake.prototype.Code = 0;
/**
* ResGuessColorTake Msg.
* @member {string} Msg
* @memberof tutorial.ResGuessColorTake
* @instance
*/
ResGuessColorTake.prototype.Msg = "";
/**
* Creates a new ResGuessColorTake instance using the specified properties.
* @function create
* @memberof tutorial.ResGuessColorTake
* @static
* @param {tutorial.IResGuessColorTake=} [properties] Properties to set
* @returns {tutorial.ResGuessColorTake} ResGuessColorTake instance
*/
ResGuessColorTake.create = function create(properties) {
return new ResGuessColorTake(properties);
};
/**
* Encodes the specified ResGuessColorTake message. Does not implicitly {@link tutorial.ResGuessColorTake.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGuessColorTake
* @static
* @param {tutorial.IResGuessColorTake} message ResGuessColorTake message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuessColorTake.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResGuessColorTake message, length delimited. Does not implicitly {@link tutorial.ResGuessColorTake.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGuessColorTake
* @static
* @param {tutorial.IResGuessColorTake} message ResGuessColorTake message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuessColorTake.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGuessColorTake message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGuessColorTake
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGuessColorTake} ResGuessColorTake
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuessColorTake.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.ResGuessColorTake();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGuessColorTake message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGuessColorTake
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGuessColorTake} ResGuessColorTake
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuessColorTake.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGuessColorTake message.
* @function verify
* @memberof tutorial.ResGuessColorTake
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGuessColorTake.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResGuessColorTake message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGuessColorTake
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGuessColorTake} ResGuessColorTake
*/
ResGuessColorTake.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGuessColorTake)
return object;
var message = new $root.tutorial.ResGuessColorTake();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResGuessColorTake message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGuessColorTake
* @static
* @param {tutorial.ResGuessColorTake} message ResGuessColorTake
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGuessColorTake.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResGuessColorTake to JSON.
* @function toJSON
* @memberof tutorial.ResGuessColorTake
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGuessColorTake.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGuessColorTake
* @function getTypeUrl
* @memberof tutorial.ResGuessColorTake
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGuessColorTake.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGuessColorTake";
};
return ResGuessColorTake;
})();
tutorial.ReqGuessColorReward = (function() {
/**
* Properties of a ReqGuessColorReward.
* @memberof tutorial
* @interface IReqGuessColorReward
*/
/**
* Constructs a new ReqGuessColorReward.
* @memberof tutorial
* @classdesc Represents a ReqGuessColorReward.
* @implements IReqGuessColorReward
* @constructor
* @param {tutorial.IReqGuessColorReward=} [properties] Properties to set
*/
function ReqGuessColorReward(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]];
}
/**
* Creates a new ReqGuessColorReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {tutorial.IReqGuessColorReward=} [properties] Properties to set
* @returns {tutorial.ReqGuessColorReward} ReqGuessColorReward instance
*/
ReqGuessColorReward.create = function create(properties) {
return new ReqGuessColorReward(properties);
};
/**
* Encodes the specified ReqGuessColorReward message. Does not implicitly {@link tutorial.ReqGuessColorReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {tutorial.IReqGuessColorReward} message ReqGuessColorReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGuessColorReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqGuessColorReward message, length delimited. Does not implicitly {@link tutorial.ReqGuessColorReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {tutorial.IReqGuessColorReward} message ReqGuessColorReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqGuessColorReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqGuessColorReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqGuessColorReward} ReqGuessColorReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGuessColorReward.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.ReqGuessColorReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqGuessColorReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqGuessColorReward} ReqGuessColorReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqGuessColorReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqGuessColorReward message.
* @function verify
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqGuessColorReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqGuessColorReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqGuessColorReward} ReqGuessColorReward
*/
ReqGuessColorReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqGuessColorReward)
return object;
return new $root.tutorial.ReqGuessColorReward();
};
/**
* Creates a plain object from a ReqGuessColorReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {tutorial.ReqGuessColorReward} message ReqGuessColorReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqGuessColorReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqGuessColorReward to JSON.
* @function toJSON
* @memberof tutorial.ReqGuessColorReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqGuessColorReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqGuessColorReward
* @function getTypeUrl
* @memberof tutorial.ReqGuessColorReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqGuessColorReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqGuessColorReward";
};
return ReqGuessColorReward;
})();
tutorial.ResGuessColorReward = (function() {
/**
* Properties of a ResGuessColorReward.
* @memberof tutorial
* @interface IResGuessColorReward
* @property {tutorial.RES_CODE|null} [Code] ResGuessColorReward Code
* @property {string|null} [Msg] ResGuessColorReward Msg
*/
/**
* Constructs a new ResGuessColorReward.
* @memberof tutorial
* @classdesc Represents a ResGuessColorReward.
* @implements IResGuessColorReward
* @constructor
* @param {tutorial.IResGuessColorReward=} [properties] Properties to set
*/
function ResGuessColorReward(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]];
}
/**
* ResGuessColorReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResGuessColorReward
* @instance
*/
ResGuessColorReward.prototype.Code = 0;
/**
* ResGuessColorReward Msg.
* @member {string} Msg
* @memberof tutorial.ResGuessColorReward
* @instance
*/
ResGuessColorReward.prototype.Msg = "";
/**
* Creates a new ResGuessColorReward instance using the specified properties.
* @function create
* @memberof tutorial.ResGuessColorReward
* @static
* @param {tutorial.IResGuessColorReward=} [properties] Properties to set
* @returns {tutorial.ResGuessColorReward} ResGuessColorReward instance
*/
ResGuessColorReward.create = function create(properties) {
return new ResGuessColorReward(properties);
};
/**
* Encodes the specified ResGuessColorReward message. Does not implicitly {@link tutorial.ResGuessColorReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResGuessColorReward
* @static
* @param {tutorial.IResGuessColorReward} message ResGuessColorReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuessColorReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResGuessColorReward message, length delimited. Does not implicitly {@link tutorial.ResGuessColorReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResGuessColorReward
* @static
* @param {tutorial.IResGuessColorReward} message ResGuessColorReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResGuessColorReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResGuessColorReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResGuessColorReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResGuessColorReward} ResGuessColorReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuessColorReward.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.ResGuessColorReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResGuessColorReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResGuessColorReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResGuessColorReward} ResGuessColorReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResGuessColorReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResGuessColorReward message.
* @function verify
* @memberof tutorial.ResGuessColorReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResGuessColorReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResGuessColorReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResGuessColorReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResGuessColorReward} ResGuessColorReward
*/
ResGuessColorReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResGuessColorReward)
return object;
var message = new $root.tutorial.ResGuessColorReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResGuessColorReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResGuessColorReward
* @static
* @param {tutorial.ResGuessColorReward} message ResGuessColorReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResGuessColorReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResGuessColorReward to JSON.
* @function toJSON
* @memberof tutorial.ResGuessColorReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResGuessColorReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResGuessColorReward
* @function getTypeUrl
* @memberof tutorial.ResGuessColorReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResGuessColorReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResGuessColorReward";
};
return ResGuessColorReward;
})();
tutorial.ReqRace = (function() {
/**
* Properties of a ReqRace.
* @memberof tutorial
* @interface IReqRace
*/
/**
* Constructs a new ReqRace.
* @memberof tutorial
* @classdesc Represents a ReqRace.
* @implements IReqRace
* @constructor
* @param {tutorial.IReqRace=} [properties] Properties to set
*/
function ReqRace(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]];
}
/**
* Creates a new ReqRace instance using the specified properties.
* @function create
* @memberof tutorial.ReqRace
* @static
* @param {tutorial.IReqRace=} [properties] Properties to set
* @returns {tutorial.ReqRace} ReqRace instance
*/
ReqRace.create = function create(properties) {
return new ReqRace(properties);
};
/**
* Encodes the specified ReqRace message. Does not implicitly {@link tutorial.ReqRace.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRace
* @static
* @param {tutorial.IReqRace} message ReqRace message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRace.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqRace message, length delimited. Does not implicitly {@link tutorial.ReqRace.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRace
* @static
* @param {tutorial.IReqRace} message ReqRace message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRace.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRace message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRace
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRace} ReqRace
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRace.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.ReqRace();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRace message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRace
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRace} ReqRace
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRace.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRace message.
* @function verify
* @memberof tutorial.ReqRace
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRace.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqRace message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRace
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRace} ReqRace
*/
ReqRace.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRace)
return object;
return new $root.tutorial.ReqRace();
};
/**
* Creates a plain object from a ReqRace message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRace
* @static
* @param {tutorial.ReqRace} message ReqRace
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRace.toObject = function toObject() {
return {};
};
/**
* Converts this ReqRace to JSON.
* @function toJSON
* @memberof tutorial.ReqRace
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRace.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRace
* @function getTypeUrl
* @memberof tutorial.ReqRace
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRace.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRace";
};
return ReqRace;
})();
tutorial.ResRace = (function() {
/**
* Properties of a ResRace.
* @memberof tutorial
* @interface IResRace
* @property {number|null} [Id] ResRace Id
* @property {number|null} [Status] ResRace Status
* @property {number|null} [EndTime] ResRace EndTime
* @property {number|null} [Template] ResRace Template
* @property {number|null} [Pass] ResRace Pass
* @property {number|null} [GameStartTime] ResRace GameStartTime
* @property {number|null} [GameEndTime] ResRace GameEndTime
* @property {number|null} [Progress] ResRace Progress
* @property {Array.<tutorial.Iraceopponent>|null} [Opponent] ResRace Opponent
*/
/**
* Constructs a new ResRace.
* @memberof tutorial
* @classdesc Represents a ResRace.
* @implements IResRace
* @constructor
* @param {tutorial.IResRace=} [properties] Properties to set
*/
function ResRace(properties) {
this.Opponent = [];
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]];
}
/**
* ResRace Id.
* @member {number} Id
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.Id = 0;
/**
* ResRace Status.
* @member {number} Status
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.Status = 0;
/**
* ResRace EndTime.
* @member {number} EndTime
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.EndTime = 0;
/**
* ResRace Template.
* @member {number} Template
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.Template = 0;
/**
* ResRace Pass.
* @member {number} Pass
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.Pass = 0;
/**
* ResRace GameStartTime.
* @member {number} GameStartTime
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.GameStartTime = 0;
/**
* ResRace GameEndTime.
* @member {number} GameEndTime
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.GameEndTime = 0;
/**
* ResRace Progress.
* @member {number} Progress
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.Progress = 0;
/**
* ResRace Opponent.
* @member {Array.<tutorial.Iraceopponent>} Opponent
* @memberof tutorial.ResRace
* @instance
*/
ResRace.prototype.Opponent = $util.emptyArray;
/**
* Creates a new ResRace instance using the specified properties.
* @function create
* @memberof tutorial.ResRace
* @static
* @param {tutorial.IResRace=} [properties] Properties to set
* @returns {tutorial.ResRace} ResRace instance
*/
ResRace.create = function create(properties) {
return new ResRace(properties);
};
/**
* Encodes the specified ResRace message. Does not implicitly {@link tutorial.ResRace.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRace
* @static
* @param {tutorial.IResRace} message ResRace message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRace.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Status);
if (message.EndTime != null && Object.hasOwnProperty.call(message, "EndTime"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.EndTime);
if (message.Template != null && Object.hasOwnProperty.call(message, "Template"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Template);
if (message.Pass != null && Object.hasOwnProperty.call(message, "Pass"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Pass);
if (message.GameStartTime != null && Object.hasOwnProperty.call(message, "GameStartTime"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.GameStartTime);
if (message.GameEndTime != null && Object.hasOwnProperty.call(message, "GameEndTime"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.GameEndTime);
if (message.Progress != null && Object.hasOwnProperty.call(message, "Progress"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.Progress);
if (message.Opponent != null && message.Opponent.length)
for (var i = 0; i < message.Opponent.length; ++i)
$root.tutorial.raceopponent.encode(message.Opponent[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResRace message, length delimited. Does not implicitly {@link tutorial.ResRace.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRace
* @static
* @param {tutorial.IResRace} message ResRace message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRace.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRace message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRace
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRace} ResRace
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRace.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.ResRace();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Status = reader.int32();
break;
}
case 3: {
message.EndTime = reader.int32();
break;
}
case 4: {
message.Template = reader.int32();
break;
}
case 5: {
message.Pass = reader.int32();
break;
}
case 6: {
message.GameStartTime = reader.int32();
break;
}
case 7: {
message.GameEndTime = reader.int32();
break;
}
case 8: {
message.Progress = reader.int32();
break;
}
case 9: {
if (!(message.Opponent && message.Opponent.length))
message.Opponent = [];
message.Opponent.push($root.tutorial.raceopponent.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRace message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRace
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRace} ResRace
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRace.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRace message.
* @function verify
* @memberof tutorial.ResRace
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRace.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))
return "Id: integer expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
if (!$util.isInteger(message.EndTime))
return "EndTime: integer expected";
if (message.Template != null && message.hasOwnProperty("Template"))
if (!$util.isInteger(message.Template))
return "Template: integer expected";
if (message.Pass != null && message.hasOwnProperty("Pass"))
if (!$util.isInteger(message.Pass))
return "Pass: integer expected";
if (message.GameStartTime != null && message.hasOwnProperty("GameStartTime"))
if (!$util.isInteger(message.GameStartTime))
return "GameStartTime: integer expected";
if (message.GameEndTime != null && message.hasOwnProperty("GameEndTime"))
if (!$util.isInteger(message.GameEndTime))
return "GameEndTime: integer expected";
if (message.Progress != null && message.hasOwnProperty("Progress"))
if (!$util.isInteger(message.Progress))
return "Progress: integer expected";
if (message.Opponent != null && message.hasOwnProperty("Opponent")) {
if (!Array.isArray(message.Opponent))
return "Opponent: array expected";
for (var i = 0; i < message.Opponent.length; ++i) {
var error = $root.tutorial.raceopponent.verify(message.Opponent[i]);
if (error)
return "Opponent." + error;
}
}
return null;
};
/**
* Creates a ResRace message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRace
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRace} ResRace
*/
ResRace.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRace)
return object;
var message = new $root.tutorial.ResRace();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Status != null)
message.Status = object.Status | 0;
if (object.EndTime != null)
message.EndTime = object.EndTime | 0;
if (object.Template != null)
message.Template = object.Template | 0;
if (object.Pass != null)
message.Pass = object.Pass | 0;
if (object.GameStartTime != null)
message.GameStartTime = object.GameStartTime | 0;
if (object.GameEndTime != null)
message.GameEndTime = object.GameEndTime | 0;
if (object.Progress != null)
message.Progress = object.Progress | 0;
if (object.Opponent) {
if (!Array.isArray(object.Opponent))
throw TypeError(".tutorial.ResRace.Opponent: array expected");
message.Opponent = [];
for (var i = 0; i < object.Opponent.length; ++i) {
if (typeof object.Opponent[i] !== "object")
throw TypeError(".tutorial.ResRace.Opponent: object expected");
message.Opponent[i] = $root.tutorial.raceopponent.fromObject(object.Opponent[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResRace message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRace
* @static
* @param {tutorial.ResRace} message ResRace
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRace.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Opponent = [];
if (options.defaults) {
object.Id = 0;
object.Status = 0;
object.EndTime = 0;
object.Template = 0;
object.Pass = 0;
object.GameStartTime = 0;
object.GameEndTime = 0;
object.Progress = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.EndTime != null && message.hasOwnProperty("EndTime"))
object.EndTime = message.EndTime;
if (message.Template != null && message.hasOwnProperty("Template"))
object.Template = message.Template;
if (message.Pass != null && message.hasOwnProperty("Pass"))
object.Pass = message.Pass;
if (message.GameStartTime != null && message.hasOwnProperty("GameStartTime"))
object.GameStartTime = message.GameStartTime;
if (message.GameEndTime != null && message.hasOwnProperty("GameEndTime"))
object.GameEndTime = message.GameEndTime;
if (message.Progress != null && message.hasOwnProperty("Progress"))
object.Progress = message.Progress;
if (message.Opponent && message.Opponent.length) {
object.Opponent = [];
for (var j = 0; j < message.Opponent.length; ++j)
object.Opponent[j] = $root.tutorial.raceopponent.toObject(message.Opponent[j], options);
}
return object;
};
/**
* Converts this ResRace to JSON.
* @function toJSON
* @memberof tutorial.ResRace
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRace.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRace
* @function getTypeUrl
* @memberof tutorial.ResRace
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRace.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRace";
};
return ResRace;
})();
tutorial.raceopponent = (function() {
/**
* Properties of a raceopponent.
* @memberof tutorial
* @interface Iraceopponent
* @property {number|null} [Id] raceopponent Id
* @property {number|null} [Image] raceopponent Image
* @property {number|null} [Progress] raceopponent Progress
*/
/**
* Constructs a new raceopponent.
* @memberof tutorial
* @classdesc Represents a raceopponent.
* @implements Iraceopponent
* @constructor
* @param {tutorial.Iraceopponent=} [properties] Properties to set
*/
function raceopponent(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]];
}
/**
* raceopponent Id.
* @member {number} Id
* @memberof tutorial.raceopponent
* @instance
*/
raceopponent.prototype.Id = 0;
/**
* raceopponent Image.
* @member {number} Image
* @memberof tutorial.raceopponent
* @instance
*/
raceopponent.prototype.Image = 0;
/**
* raceopponent Progress.
* @member {number} Progress
* @memberof tutorial.raceopponent
* @instance
*/
raceopponent.prototype.Progress = 0;
/**
* Creates a new raceopponent instance using the specified properties.
* @function create
* @memberof tutorial.raceopponent
* @static
* @param {tutorial.Iraceopponent=} [properties] Properties to set
* @returns {tutorial.raceopponent} raceopponent instance
*/
raceopponent.create = function create(properties) {
return new raceopponent(properties);
};
/**
* Encodes the specified raceopponent message. Does not implicitly {@link tutorial.raceopponent.verify|verify} messages.
* @function encode
* @memberof tutorial.raceopponent
* @static
* @param {tutorial.Iraceopponent} message raceopponent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
raceopponent.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Image != null && Object.hasOwnProperty.call(message, "Image"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Image);
if (message.Progress != null && Object.hasOwnProperty.call(message, "Progress"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Progress);
return writer;
};
/**
* Encodes the specified raceopponent message, length delimited. Does not implicitly {@link tutorial.raceopponent.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.raceopponent
* @static
* @param {tutorial.Iraceopponent} message raceopponent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
raceopponent.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a raceopponent message from the specified reader or buffer.
* @function decode
* @memberof tutorial.raceopponent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.raceopponent} raceopponent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
raceopponent.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.raceopponent();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Image = reader.int32();
break;
}
case 3: {
message.Progress = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a raceopponent message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.raceopponent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.raceopponent} raceopponent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
raceopponent.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a raceopponent message.
* @function verify
* @memberof tutorial.raceopponent
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
raceopponent.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))
return "Id: integer expected";
if (message.Image != null && message.hasOwnProperty("Image"))
if (!$util.isInteger(message.Image))
return "Image: integer expected";
if (message.Progress != null && message.hasOwnProperty("Progress"))
if (!$util.isInteger(message.Progress))
return "Progress: integer expected";
return null;
};
/**
* Creates a raceopponent message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.raceopponent
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.raceopponent} raceopponent
*/
raceopponent.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.raceopponent)
return object;
var message = new $root.tutorial.raceopponent();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Image != null)
message.Image = object.Image | 0;
if (object.Progress != null)
message.Progress = object.Progress | 0;
return message;
};
/**
* Creates a plain object from a raceopponent message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.raceopponent
* @static
* @param {tutorial.raceopponent} message raceopponent
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
raceopponent.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.Image = 0;
object.Progress = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Image != null && message.hasOwnProperty("Image"))
object.Image = message.Image;
if (message.Progress != null && message.hasOwnProperty("Progress"))
object.Progress = message.Progress;
return object;
};
/**
* Converts this raceopponent to JSON.
* @function toJSON
* @memberof tutorial.raceopponent
* @instance
* @returns {Object.<string,*>} JSON object
*/
raceopponent.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for raceopponent
* @function getTypeUrl
* @memberof tutorial.raceopponent
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
raceopponent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.raceopponent";
};
return raceopponent;
})();
tutorial.ReqRaceStart = (function() {
/**
* Properties of a ReqRaceStart.
* @memberof tutorial
* @interface IReqRaceStart
*/
/**
* Constructs a new ReqRaceStart.
* @memberof tutorial
* @classdesc Represents a ReqRaceStart.
* @implements IReqRaceStart
* @constructor
* @param {tutorial.IReqRaceStart=} [properties] Properties to set
*/
function ReqRaceStart(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]];
}
/**
* Creates a new ReqRaceStart instance using the specified properties.
* @function create
* @memberof tutorial.ReqRaceStart
* @static
* @param {tutorial.IReqRaceStart=} [properties] Properties to set
* @returns {tutorial.ReqRaceStart} ReqRaceStart instance
*/
ReqRaceStart.create = function create(properties) {
return new ReqRaceStart(properties);
};
/**
* Encodes the specified ReqRaceStart message. Does not implicitly {@link tutorial.ReqRaceStart.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRaceStart
* @static
* @param {tutorial.IReqRaceStart} message ReqRaceStart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRaceStart.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqRaceStart message, length delimited. Does not implicitly {@link tutorial.ReqRaceStart.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRaceStart
* @static
* @param {tutorial.IReqRaceStart} message ReqRaceStart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRaceStart.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRaceStart message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRaceStart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRaceStart} ReqRaceStart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRaceStart.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.ReqRaceStart();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRaceStart message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRaceStart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRaceStart} ReqRaceStart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRaceStart.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRaceStart message.
* @function verify
* @memberof tutorial.ReqRaceStart
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRaceStart.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqRaceStart message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRaceStart
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRaceStart} ReqRaceStart
*/
ReqRaceStart.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRaceStart)
return object;
return new $root.tutorial.ReqRaceStart();
};
/**
* Creates a plain object from a ReqRaceStart message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRaceStart
* @static
* @param {tutorial.ReqRaceStart} message ReqRaceStart
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRaceStart.toObject = function toObject() {
return {};
};
/**
* Converts this ReqRaceStart to JSON.
* @function toJSON
* @memberof tutorial.ReqRaceStart
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRaceStart.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRaceStart
* @function getTypeUrl
* @memberof tutorial.ReqRaceStart
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRaceStart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRaceStart";
};
return ReqRaceStart;
})();
tutorial.ResRaceStart = (function() {
/**
* Properties of a ResRaceStart.
* @memberof tutorial
* @interface IResRaceStart
* @property {tutorial.RES_CODE|null} [Code] ResRaceStart Code
* @property {string|null} [Msg] ResRaceStart Msg
*/
/**
* Constructs a new ResRaceStart.
* @memberof tutorial
* @classdesc Represents a ResRaceStart.
* @implements IResRaceStart
* @constructor
* @param {tutorial.IResRaceStart=} [properties] Properties to set
*/
function ResRaceStart(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]];
}
/**
* ResRaceStart Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResRaceStart
* @instance
*/
ResRaceStart.prototype.Code = 0;
/**
* ResRaceStart Msg.
* @member {string} Msg
* @memberof tutorial.ResRaceStart
* @instance
*/
ResRaceStart.prototype.Msg = "";
/**
* Creates a new ResRaceStart instance using the specified properties.
* @function create
* @memberof tutorial.ResRaceStart
* @static
* @param {tutorial.IResRaceStart=} [properties] Properties to set
* @returns {tutorial.ResRaceStart} ResRaceStart instance
*/
ResRaceStart.create = function create(properties) {
return new ResRaceStart(properties);
};
/**
* Encodes the specified ResRaceStart message. Does not implicitly {@link tutorial.ResRaceStart.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRaceStart
* @static
* @param {tutorial.IResRaceStart} message ResRaceStart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRaceStart.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResRaceStart message, length delimited. Does not implicitly {@link tutorial.ResRaceStart.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRaceStart
* @static
* @param {tutorial.IResRaceStart} message ResRaceStart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRaceStart.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRaceStart message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRaceStart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRaceStart} ResRaceStart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRaceStart.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.ResRaceStart();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRaceStart message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRaceStart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRaceStart} ResRaceStart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRaceStart.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRaceStart message.
* @function verify
* @memberof tutorial.ResRaceStart
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRaceStart.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResRaceStart message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRaceStart
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRaceStart} ResRaceStart
*/
ResRaceStart.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRaceStart)
return object;
var message = new $root.tutorial.ResRaceStart();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResRaceStart message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRaceStart
* @static
* @param {tutorial.ResRaceStart} message ResRaceStart
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRaceStart.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResRaceStart to JSON.
* @function toJSON
* @memberof tutorial.ResRaceStart
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRaceStart.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRaceStart
* @function getTypeUrl
* @memberof tutorial.ResRaceStart
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRaceStart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRaceStart";
};
return ResRaceStart;
})();
tutorial.ReqRaceReward = (function() {
/**
* Properties of a ReqRaceReward.
* @memberof tutorial
* @interface IReqRaceReward
*/
/**
* Constructs a new ReqRaceReward.
* @memberof tutorial
* @classdesc Represents a ReqRaceReward.
* @implements IReqRaceReward
* @constructor
* @param {tutorial.IReqRaceReward=} [properties] Properties to set
*/
function ReqRaceReward(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]];
}
/**
* Creates a new ReqRaceReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqRaceReward
* @static
* @param {tutorial.IReqRaceReward=} [properties] Properties to set
* @returns {tutorial.ReqRaceReward} ReqRaceReward instance
*/
ReqRaceReward.create = function create(properties) {
return new ReqRaceReward(properties);
};
/**
* Encodes the specified ReqRaceReward message. Does not implicitly {@link tutorial.ReqRaceReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqRaceReward
* @static
* @param {tutorial.IReqRaceReward} message ReqRaceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRaceReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqRaceReward message, length delimited. Does not implicitly {@link tutorial.ReqRaceReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqRaceReward
* @static
* @param {tutorial.IReqRaceReward} message ReqRaceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqRaceReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqRaceReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqRaceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqRaceReward} ReqRaceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRaceReward.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.ReqRaceReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqRaceReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqRaceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqRaceReward} ReqRaceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqRaceReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqRaceReward message.
* @function verify
* @memberof tutorial.ReqRaceReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqRaceReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqRaceReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqRaceReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqRaceReward} ReqRaceReward
*/
ReqRaceReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqRaceReward)
return object;
return new $root.tutorial.ReqRaceReward();
};
/**
* Creates a plain object from a ReqRaceReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqRaceReward
* @static
* @param {tutorial.ReqRaceReward} message ReqRaceReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqRaceReward.toObject = function toObject() {
return {};
};
/**
* Converts this ReqRaceReward to JSON.
* @function toJSON
* @memberof tutorial.ReqRaceReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqRaceReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqRaceReward
* @function getTypeUrl
* @memberof tutorial.ReqRaceReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqRaceReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqRaceReward";
};
return ReqRaceReward;
})();
tutorial.ResRaceReward = (function() {
/**
* Properties of a ResRaceReward.
* @memberof tutorial
* @interface IResRaceReward
* @property {tutorial.RES_CODE|null} [Code] ResRaceReward Code
* @property {string|null} [Msg] ResRaceReward Msg
*/
/**
* Constructs a new ResRaceReward.
* @memberof tutorial
* @classdesc Represents a ResRaceReward.
* @implements IResRaceReward
* @constructor
* @param {tutorial.IResRaceReward=} [properties] Properties to set
*/
function ResRaceReward(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]];
}
/**
* ResRaceReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResRaceReward
* @instance
*/
ResRaceReward.prototype.Code = 0;
/**
* ResRaceReward Msg.
* @member {string} Msg
* @memberof tutorial.ResRaceReward
* @instance
*/
ResRaceReward.prototype.Msg = "";
/**
* Creates a new ResRaceReward instance using the specified properties.
* @function create
* @memberof tutorial.ResRaceReward
* @static
* @param {tutorial.IResRaceReward=} [properties] Properties to set
* @returns {tutorial.ResRaceReward} ResRaceReward instance
*/
ResRaceReward.create = function create(properties) {
return new ResRaceReward(properties);
};
/**
* Encodes the specified ResRaceReward message. Does not implicitly {@link tutorial.ResRaceReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResRaceReward
* @static
* @param {tutorial.IResRaceReward} message ResRaceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRaceReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResRaceReward message, length delimited. Does not implicitly {@link tutorial.ResRaceReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResRaceReward
* @static
* @param {tutorial.IResRaceReward} message ResRaceReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResRaceReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResRaceReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResRaceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResRaceReward} ResRaceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRaceReward.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.ResRaceReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResRaceReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResRaceReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResRaceReward} ResRaceReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResRaceReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResRaceReward message.
* @function verify
* @memberof tutorial.ResRaceReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResRaceReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResRaceReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResRaceReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResRaceReward} ResRaceReward
*/
ResRaceReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResRaceReward)
return object;
var message = new $root.tutorial.ResRaceReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResRaceReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResRaceReward
* @static
* @param {tutorial.ResRaceReward} message ResRaceReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResRaceReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResRaceReward to JSON.
* @function toJSON
* @memberof tutorial.ResRaceReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResRaceReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResRaceReward
* @function getTypeUrl
* @memberof tutorial.ResRaceReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResRaceReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResRaceReward";
};
return ResRaceReward;
})();
tutorial.ReqPlayroom = (function() {
/**
* Properties of a ReqPlayroom.
* @memberof tutorial
* @interface IReqPlayroom
*/
/**
* Constructs a new ReqPlayroom.
* @memberof tutorial
* @classdesc Represents a ReqPlayroom.
* @implements IReqPlayroom
* @constructor
* @param {tutorial.IReqPlayroom=} [properties] Properties to set
*/
function ReqPlayroom(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]];
}
/**
* Creates a new ReqPlayroom instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroom
* @static
* @param {tutorial.IReqPlayroom=} [properties] Properties to set
* @returns {tutorial.ReqPlayroom} ReqPlayroom instance
*/
ReqPlayroom.create = function create(properties) {
return new ReqPlayroom(properties);
};
/**
* Encodes the specified ReqPlayroom message. Does not implicitly {@link tutorial.ReqPlayroom.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroom
* @static
* @param {tutorial.IReqPlayroom} message ReqPlayroom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroom.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqPlayroom message, length delimited. Does not implicitly {@link tutorial.ReqPlayroom.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroom
* @static
* @param {tutorial.IReqPlayroom} message ReqPlayroom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroom.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroom message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroom} ReqPlayroom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroom.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.ReqPlayroom();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroom message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroom} ReqPlayroom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroom.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroom message.
* @function verify
* @memberof tutorial.ReqPlayroom
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroom.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqPlayroom message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroom
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroom} ReqPlayroom
*/
ReqPlayroom.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroom)
return object;
return new $root.tutorial.ReqPlayroom();
};
/**
* Creates a plain object from a ReqPlayroom message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroom
* @static
* @param {tutorial.ReqPlayroom} message ReqPlayroom
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroom.toObject = function toObject() {
return {};
};
/**
* Converts this ReqPlayroom to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroom
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroom.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroom
* @function getTypeUrl
* @memberof tutorial.ReqPlayroom
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroom.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroom";
};
return ReqPlayroom;
})();
tutorial.ResPlayroom = (function() {
/**
* Properties of a ResPlayroom.
* @memberof tutorial
* @interface IResPlayroom
* @property {number|null} [status] ResPlayroom status
* @property {Array.<tutorial.IItemInfo>|null} [Items] ResPlayroom Items
* @property {Array.<tutorial.IRoomOpponent>|null} [Opponent] ResPlayroom Opponent
* @property {Array.<tutorial.IFriendRoom>|null} [Friend] ResPlayroom Friend
* @property {Object.<string,number>|null} [Playroom] ResPlayroom Playroom
* @property {Array.<number>|null} [collect] ResPlayroom collect
* @property {Object.<string,number>|null} [Mood] ResPlayroom Mood
* @property {Array.<tutorial.IItemInfo>|null} [LoseItem] ResPlayroom LoseItem
* @property {number|null} [StartTime] ResPlayroom StartTime
* @property {number|null} [WorkStatus] ResPlayroom WorkStatus
* @property {number|null} [AllMood] ResPlayroom AllMood
* @property {number|null} [Chip] ResPlayroom Chip
* @property {number|null} [WorkOutline] ResPlayroom WorkOutline
*/
/**
* Constructs a new ResPlayroom.
* @memberof tutorial
* @classdesc Represents a ResPlayroom.
* @implements IResPlayroom
* @constructor
* @param {tutorial.IResPlayroom=} [properties] Properties to set
*/
function ResPlayroom(properties) {
this.Items = [];
this.Opponent = [];
this.Friend = [];
this.Playroom = {};
this.collect = [];
this.Mood = {};
this.LoseItem = [];
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]];
}
/**
* ResPlayroom status.
* @member {number} status
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.status = 0;
/**
* ResPlayroom Items.
* @member {Array.<tutorial.IItemInfo>} Items
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.Items = $util.emptyArray;
/**
* ResPlayroom Opponent.
* @member {Array.<tutorial.IRoomOpponent>} Opponent
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.Opponent = $util.emptyArray;
/**
* ResPlayroom Friend.
* @member {Array.<tutorial.IFriendRoom>} Friend
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.Friend = $util.emptyArray;
/**
* ResPlayroom Playroom.
* @member {Object.<string,number>} Playroom
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.Playroom = $util.emptyObject;
/**
* ResPlayroom collect.
* @member {Array.<number>} collect
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.collect = $util.emptyArray;
/**
* ResPlayroom Mood.
* @member {Object.<string,number>} Mood
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.Mood = $util.emptyObject;
/**
* ResPlayroom LoseItem.
* @member {Array.<tutorial.IItemInfo>} LoseItem
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.LoseItem = $util.emptyArray;
/**
* ResPlayroom StartTime.
* @member {number} StartTime
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.StartTime = 0;
/**
* ResPlayroom WorkStatus.
* @member {number} WorkStatus
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.WorkStatus = 0;
/**
* ResPlayroom AllMood.
* @member {number} AllMood
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.AllMood = 0;
/**
* ResPlayroom Chip.
* @member {number} Chip
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.Chip = 0;
/**
* ResPlayroom WorkOutline.
* @member {number} WorkOutline
* @memberof tutorial.ResPlayroom
* @instance
*/
ResPlayroom.prototype.WorkOutline = 0;
/**
* Creates a new ResPlayroom instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroom
* @static
* @param {tutorial.IResPlayroom=} [properties] Properties to set
* @returns {tutorial.ResPlayroom} ResPlayroom instance
*/
ResPlayroom.create = function create(properties) {
return new ResPlayroom(properties);
};
/**
* Encodes the specified ResPlayroom message. Does not implicitly {@link tutorial.ResPlayroom.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroom
* @static
* @param {tutorial.IResPlayroom} message ResPlayroom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroom.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.status != null && Object.hasOwnProperty.call(message, "status"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status);
if (message.Items != null && message.Items.length)
for (var i = 0; i < message.Items.length; ++i)
$root.tutorial.ItemInfo.encode(message.Items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.Opponent != null && message.Opponent.length)
for (var i = 0; i < message.Opponent.length; ++i)
$root.tutorial.RoomOpponent.encode(message.Opponent[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.Friend != null && message.Friend.length)
for (var i = 0; i < message.Friend.length; ++i)
$root.tutorial.FriendRoom.encode(message.Friend[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.Playroom != null && Object.hasOwnProperty.call(message, "Playroom"))
for (var keys = Object.keys(message.Playroom), i = 0; i < keys.length; ++i)
writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Playroom[keys[i]]).ldelim();
if (message.collect != null && message.collect.length) {
writer.uint32(/* id 6, wireType 2 =*/50).fork();
for (var i = 0; i < message.collect.length; ++i)
writer.int32(message.collect[i]);
writer.ldelim();
}
if (message.Mood != null && Object.hasOwnProperty.call(message, "Mood"))
for (var keys = Object.keys(message.Mood), i = 0; i < keys.length; ++i)
writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Mood[keys[i]]).ldelim();
if (message.LoseItem != null && message.LoseItem.length)
for (var i = 0; i < message.LoseItem.length; ++i)
$root.tutorial.ItemInfo.encode(message.LoseItem[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
if (message.StartTime != null && Object.hasOwnProperty.call(message, "StartTime"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.StartTime);
if (message.WorkStatus != null && Object.hasOwnProperty.call(message, "WorkStatus"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.WorkStatus);
if (message.AllMood != null && Object.hasOwnProperty.call(message, "AllMood"))
writer.uint32(/* id 11, wireType 0 =*/88).int32(message.AllMood);
if (message.Chip != null && Object.hasOwnProperty.call(message, "Chip"))
writer.uint32(/* id 12, wireType 0 =*/96).int32(message.Chip);
if (message.WorkOutline != null && Object.hasOwnProperty.call(message, "WorkOutline"))
writer.uint32(/* id 13, wireType 0 =*/104).int32(message.WorkOutline);
return writer;
};
/**
* Encodes the specified ResPlayroom message, length delimited. Does not implicitly {@link tutorial.ResPlayroom.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroom
* @static
* @param {tutorial.IResPlayroom} message ResPlayroom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroom.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroom message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroom} ResPlayroom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroom.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.ResPlayroom(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.status = reader.int32();
break;
}
case 2: {
if (!(message.Items && message.Items.length))
message.Items = [];
message.Items.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
case 3: {
if (!(message.Opponent && message.Opponent.length))
message.Opponent = [];
message.Opponent.push($root.tutorial.RoomOpponent.decode(reader, reader.uint32()));
break;
}
case 4: {
if (!(message.Friend && message.Friend.length))
message.Friend = [];
message.Friend.push($root.tutorial.FriendRoom.decode(reader, reader.uint32()));
break;
}
case 5: {
if (message.Playroom === $util.emptyObject)
message.Playroom = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Playroom[key] = value;
break;
}
case 6: {
if (!(message.collect && message.collect.length))
message.collect = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.collect.push(reader.int32());
} else
message.collect.push(reader.int32());
break;
}
case 7: {
if (message.Mood === $util.emptyObject)
message.Mood = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Mood[key] = value;
break;
}
case 8: {
if (!(message.LoseItem && message.LoseItem.length))
message.LoseItem = [];
message.LoseItem.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
case 9: {
message.StartTime = reader.int32();
break;
}
case 10: {
message.WorkStatus = reader.int32();
break;
}
case 11: {
message.AllMood = reader.int32();
break;
}
case 12: {
message.Chip = reader.int32();
break;
}
case 13: {
message.WorkOutline = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroom message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroom} ResPlayroom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroom.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroom message.
* @function verify
* @memberof tutorial.ResPlayroom
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroom.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.status != null && message.hasOwnProperty("status"))
if (!$util.isInteger(message.status))
return "status: integer expected";
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!Array.isArray(message.Items))
return "Items: array expected";
for (var i = 0; i < message.Items.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.Items[i]);
if (error)
return "Items." + error;
}
}
if (message.Opponent != null && message.hasOwnProperty("Opponent")) {
if (!Array.isArray(message.Opponent))
return "Opponent: array expected";
for (var i = 0; i < message.Opponent.length; ++i) {
var error = $root.tutorial.RoomOpponent.verify(message.Opponent[i]);
if (error)
return "Opponent." + error;
}
}
if (message.Friend != null && message.hasOwnProperty("Friend")) {
if (!Array.isArray(message.Friend))
return "Friend: array expected";
for (var i = 0; i < message.Friend.length; ++i) {
var error = $root.tutorial.FriendRoom.verify(message.Friend[i]);
if (error)
return "Friend." + error;
}
}
if (message.Playroom != null && message.hasOwnProperty("Playroom")) {
if (!$util.isObject(message.Playroom))
return "Playroom: object expected";
var key = Object.keys(message.Playroom);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Playroom: integer key{k:int32} expected";
if (!$util.isInteger(message.Playroom[key[i]]))
return "Playroom: integer{k:int32} expected";
}
}
if (message.collect != null && message.hasOwnProperty("collect")) {
if (!Array.isArray(message.collect))
return "collect: array expected";
for (var i = 0; i < message.collect.length; ++i)
if (!$util.isInteger(message.collect[i]))
return "collect: integer[] expected";
}
if (message.Mood != null && message.hasOwnProperty("Mood")) {
if (!$util.isObject(message.Mood))
return "Mood: object expected";
var key = Object.keys(message.Mood);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Mood: integer key{k:int32} expected";
if (!$util.isInteger(message.Mood[key[i]]))
return "Mood: integer{k:int32} expected";
}
}
if (message.LoseItem != null && message.hasOwnProperty("LoseItem")) {
if (!Array.isArray(message.LoseItem))
return "LoseItem: array expected";
for (var i = 0; i < message.LoseItem.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.LoseItem[i]);
if (error)
return "LoseItem." + error;
}
}
if (message.StartTime != null && message.hasOwnProperty("StartTime"))
if (!$util.isInteger(message.StartTime))
return "StartTime: integer expected";
if (message.WorkStatus != null && message.hasOwnProperty("WorkStatus"))
if (!$util.isInteger(message.WorkStatus))
return "WorkStatus: integer expected";
if (message.AllMood != null && message.hasOwnProperty("AllMood"))
if (!$util.isInteger(message.AllMood))
return "AllMood: integer expected";
if (message.Chip != null && message.hasOwnProperty("Chip"))
if (!$util.isInteger(message.Chip))
return "Chip: integer expected";
if (message.WorkOutline != null && message.hasOwnProperty("WorkOutline"))
if (!$util.isInteger(message.WorkOutline))
return "WorkOutline: integer expected";
return null;
};
/**
* Creates a ResPlayroom message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroom
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroom} ResPlayroom
*/
ResPlayroom.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroom)
return object;
var message = new $root.tutorial.ResPlayroom();
if (object.status != null)
message.status = object.status | 0;
if (object.Items) {
if (!Array.isArray(object.Items))
throw TypeError(".tutorial.ResPlayroom.Items: array expected");
message.Items = [];
for (var i = 0; i < object.Items.length; ++i) {
if (typeof object.Items[i] !== "object")
throw TypeError(".tutorial.ResPlayroom.Items: object expected");
message.Items[i] = $root.tutorial.ItemInfo.fromObject(object.Items[i]);
}
}
if (object.Opponent) {
if (!Array.isArray(object.Opponent))
throw TypeError(".tutorial.ResPlayroom.Opponent: array expected");
message.Opponent = [];
for (var i = 0; i < object.Opponent.length; ++i) {
if (typeof object.Opponent[i] !== "object")
throw TypeError(".tutorial.ResPlayroom.Opponent: object expected");
message.Opponent[i] = $root.tutorial.RoomOpponent.fromObject(object.Opponent[i]);
}
}
if (object.Friend) {
if (!Array.isArray(object.Friend))
throw TypeError(".tutorial.ResPlayroom.Friend: array expected");
message.Friend = [];
for (var i = 0; i < object.Friend.length; ++i) {
if (typeof object.Friend[i] !== "object")
throw TypeError(".tutorial.ResPlayroom.Friend: object expected");
message.Friend[i] = $root.tutorial.FriendRoom.fromObject(object.Friend[i]);
}
}
if (object.Playroom) {
if (typeof object.Playroom !== "object")
throw TypeError(".tutorial.ResPlayroom.Playroom: object expected");
message.Playroom = {};
for (var keys = Object.keys(object.Playroom), i = 0; i < keys.length; ++i)
message.Playroom[keys[i]] = object.Playroom[keys[i]] | 0;
}
if (object.collect) {
if (!Array.isArray(object.collect))
throw TypeError(".tutorial.ResPlayroom.collect: array expected");
message.collect = [];
for (var i = 0; i < object.collect.length; ++i)
message.collect[i] = object.collect[i] | 0;
}
if (object.Mood) {
if (typeof object.Mood !== "object")
throw TypeError(".tutorial.ResPlayroom.Mood: object expected");
message.Mood = {};
for (var keys = Object.keys(object.Mood), i = 0; i < keys.length; ++i)
message.Mood[keys[i]] = object.Mood[keys[i]] | 0;
}
if (object.LoseItem) {
if (!Array.isArray(object.LoseItem))
throw TypeError(".tutorial.ResPlayroom.LoseItem: array expected");
message.LoseItem = [];
for (var i = 0; i < object.LoseItem.length; ++i) {
if (typeof object.LoseItem[i] !== "object")
throw TypeError(".tutorial.ResPlayroom.LoseItem: object expected");
message.LoseItem[i] = $root.tutorial.ItemInfo.fromObject(object.LoseItem[i]);
}
}
if (object.StartTime != null)
message.StartTime = object.StartTime | 0;
if (object.WorkStatus != null)
message.WorkStatus = object.WorkStatus | 0;
if (object.AllMood != null)
message.AllMood = object.AllMood | 0;
if (object.Chip != null)
message.Chip = object.Chip | 0;
if (object.WorkOutline != null)
message.WorkOutline = object.WorkOutline | 0;
return message;
};
/**
* Creates a plain object from a ResPlayroom message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroom
* @static
* @param {tutorial.ResPlayroom} message ResPlayroom
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroom.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.Items = [];
object.Opponent = [];
object.Friend = [];
object.collect = [];
object.LoseItem = [];
}
if (options.objects || options.defaults) {
object.Playroom = {};
object.Mood = {};
}
if (options.defaults) {
object.status = 0;
object.StartTime = 0;
object.WorkStatus = 0;
object.AllMood = 0;
object.Chip = 0;
object.WorkOutline = 0;
}
if (message.status != null && message.hasOwnProperty("status"))
object.status = message.status;
if (message.Items && message.Items.length) {
object.Items = [];
for (var j = 0; j < message.Items.length; ++j)
object.Items[j] = $root.tutorial.ItemInfo.toObject(message.Items[j], options);
}
if (message.Opponent && message.Opponent.length) {
object.Opponent = [];
for (var j = 0; j < message.Opponent.length; ++j)
object.Opponent[j] = $root.tutorial.RoomOpponent.toObject(message.Opponent[j], options);
}
if (message.Friend && message.Friend.length) {
object.Friend = [];
for (var j = 0; j < message.Friend.length; ++j)
object.Friend[j] = $root.tutorial.FriendRoom.toObject(message.Friend[j], options);
}
var keys2;
if (message.Playroom && (keys2 = Object.keys(message.Playroom)).length) {
object.Playroom = {};
for (var j = 0; j < keys2.length; ++j)
object.Playroom[keys2[j]] = message.Playroom[keys2[j]];
}
if (message.collect && message.collect.length) {
object.collect = [];
for (var j = 0; j < message.collect.length; ++j)
object.collect[j] = message.collect[j];
}
if (message.Mood && (keys2 = Object.keys(message.Mood)).length) {
object.Mood = {};
for (var j = 0; j < keys2.length; ++j)
object.Mood[keys2[j]] = message.Mood[keys2[j]];
}
if (message.LoseItem && message.LoseItem.length) {
object.LoseItem = [];
for (var j = 0; j < message.LoseItem.length; ++j)
object.LoseItem[j] = $root.tutorial.ItemInfo.toObject(message.LoseItem[j], options);
}
if (message.StartTime != null && message.hasOwnProperty("StartTime"))
object.StartTime = message.StartTime;
if (message.WorkStatus != null && message.hasOwnProperty("WorkStatus"))
object.WorkStatus = message.WorkStatus;
if (message.AllMood != null && message.hasOwnProperty("AllMood"))
object.AllMood = message.AllMood;
if (message.Chip != null && message.hasOwnProperty("Chip"))
object.Chip = message.Chip;
if (message.WorkOutline != null && message.hasOwnProperty("WorkOutline"))
object.WorkOutline = message.WorkOutline;
return object;
};
/**
* Converts this ResPlayroom to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroom
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroom.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroom
* @function getTypeUrl
* @memberof tutorial.ResPlayroom
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroom.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroom";
};
return ResPlayroom;
})();
tutorial.ReqPlayroomWrokOutline = (function() {
/**
* Properties of a ReqPlayroomWrokOutline.
* @memberof tutorial
* @interface IReqPlayroomWrokOutline
*/
/**
* Constructs a new ReqPlayroomWrokOutline.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomWrokOutline.
* @implements IReqPlayroomWrokOutline
* @constructor
* @param {tutorial.IReqPlayroomWrokOutline=} [properties] Properties to set
*/
function ReqPlayroomWrokOutline(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]];
}
/**
* Creates a new ReqPlayroomWrokOutline instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {tutorial.IReqPlayroomWrokOutline=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomWrokOutline} ReqPlayroomWrokOutline instance
*/
ReqPlayroomWrokOutline.create = function create(properties) {
return new ReqPlayroomWrokOutline(properties);
};
/**
* Encodes the specified ReqPlayroomWrokOutline message. Does not implicitly {@link tutorial.ReqPlayroomWrokOutline.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {tutorial.IReqPlayroomWrokOutline} message ReqPlayroomWrokOutline message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomWrokOutline.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqPlayroomWrokOutline message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomWrokOutline.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {tutorial.IReqPlayroomWrokOutline} message ReqPlayroomWrokOutline message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomWrokOutline.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomWrokOutline message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomWrokOutline} ReqPlayroomWrokOutline
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomWrokOutline.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.ReqPlayroomWrokOutline();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomWrokOutline message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomWrokOutline} ReqPlayroomWrokOutline
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomWrokOutline.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomWrokOutline message.
* @function verify
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomWrokOutline.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqPlayroomWrokOutline message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomWrokOutline} ReqPlayroomWrokOutline
*/
ReqPlayroomWrokOutline.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomWrokOutline)
return object;
return new $root.tutorial.ReqPlayroomWrokOutline();
};
/**
* Creates a plain object from a ReqPlayroomWrokOutline message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {tutorial.ReqPlayroomWrokOutline} message ReqPlayroomWrokOutline
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomWrokOutline.toObject = function toObject() {
return {};
};
/**
* Converts this ReqPlayroomWrokOutline to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomWrokOutline
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomWrokOutline.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomWrokOutline
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomWrokOutline
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomWrokOutline.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomWrokOutline";
};
return ReqPlayroomWrokOutline;
})();
tutorial.ResPlayroomWrokOutline = (function() {
/**
* Properties of a ResPlayroomWrokOutline.
* @memberof tutorial
* @interface IResPlayroomWrokOutline
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomWrokOutline Code
* @property {string|null} [Msg] ResPlayroomWrokOutline Msg
*/
/**
* Constructs a new ResPlayroomWrokOutline.
* @memberof tutorial
* @classdesc Represents a ResPlayroomWrokOutline.
* @implements IResPlayroomWrokOutline
* @constructor
* @param {tutorial.IResPlayroomWrokOutline=} [properties] Properties to set
*/
function ResPlayroomWrokOutline(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]];
}
/**
* ResPlayroomWrokOutline Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomWrokOutline
* @instance
*/
ResPlayroomWrokOutline.prototype.Code = 0;
/**
* ResPlayroomWrokOutline Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomWrokOutline
* @instance
*/
ResPlayroomWrokOutline.prototype.Msg = "";
/**
* Creates a new ResPlayroomWrokOutline instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {tutorial.IResPlayroomWrokOutline=} [properties] Properties to set
* @returns {tutorial.ResPlayroomWrokOutline} ResPlayroomWrokOutline instance
*/
ResPlayroomWrokOutline.create = function create(properties) {
return new ResPlayroomWrokOutline(properties);
};
/**
* Encodes the specified ResPlayroomWrokOutline message. Does not implicitly {@link tutorial.ResPlayroomWrokOutline.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {tutorial.IResPlayroomWrokOutline} message ResPlayroomWrokOutline message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomWrokOutline.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPlayroomWrokOutline message, length delimited. Does not implicitly {@link tutorial.ResPlayroomWrokOutline.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {tutorial.IResPlayroomWrokOutline} message ResPlayroomWrokOutline message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomWrokOutline.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomWrokOutline message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomWrokOutline} ResPlayroomWrokOutline
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomWrokOutline.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.ResPlayroomWrokOutline();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomWrokOutline message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomWrokOutline} ResPlayroomWrokOutline
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomWrokOutline.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomWrokOutline message.
* @function verify
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomWrokOutline.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPlayroomWrokOutline message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomWrokOutline} ResPlayroomWrokOutline
*/
ResPlayroomWrokOutline.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomWrokOutline)
return object;
var message = new $root.tutorial.ResPlayroomWrokOutline();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomWrokOutline message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {tutorial.ResPlayroomWrokOutline} message ResPlayroomWrokOutline
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomWrokOutline.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPlayroomWrokOutline to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomWrokOutline
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomWrokOutline.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomWrokOutline
* @function getTypeUrl
* @memberof tutorial.ResPlayroomWrokOutline
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomWrokOutline.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomWrokOutline";
};
return ResPlayroomWrokOutline;
})();
tutorial.NofiPlayroomStatus = (function() {
/**
* Properties of a NofiPlayroomStatus.
* @memberof tutorial
* @interface INofiPlayroomStatus
* @property {number|null} [WorkOutline] NofiPlayroomStatus WorkOutline
*/
/**
* Constructs a new NofiPlayroomStatus.
* @memberof tutorial
* @classdesc Represents a NofiPlayroomStatus.
* @implements INofiPlayroomStatus
* @constructor
* @param {tutorial.INofiPlayroomStatus=} [properties] Properties to set
*/
function NofiPlayroomStatus(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]];
}
/**
* NofiPlayroomStatus WorkOutline.
* @member {number} WorkOutline
* @memberof tutorial.NofiPlayroomStatus
* @instance
*/
NofiPlayroomStatus.prototype.WorkOutline = 0;
/**
* Creates a new NofiPlayroomStatus instance using the specified properties.
* @function create
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {tutorial.INofiPlayroomStatus=} [properties] Properties to set
* @returns {tutorial.NofiPlayroomStatus} NofiPlayroomStatus instance
*/
NofiPlayroomStatus.create = function create(properties) {
return new NofiPlayroomStatus(properties);
};
/**
* Encodes the specified NofiPlayroomStatus message. Does not implicitly {@link tutorial.NofiPlayroomStatus.verify|verify} messages.
* @function encode
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {tutorial.INofiPlayroomStatus} message NofiPlayroomStatus message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NofiPlayroomStatus.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.WorkOutline != null && Object.hasOwnProperty.call(message, "WorkOutline"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.WorkOutline);
return writer;
};
/**
* Encodes the specified NofiPlayroomStatus message, length delimited. Does not implicitly {@link tutorial.NofiPlayroomStatus.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {tutorial.INofiPlayroomStatus} message NofiPlayroomStatus message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NofiPlayroomStatus.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NofiPlayroomStatus message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NofiPlayroomStatus} NofiPlayroomStatus
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NofiPlayroomStatus.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.NofiPlayroomStatus();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.WorkOutline = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NofiPlayroomStatus message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NofiPlayroomStatus} NofiPlayroomStatus
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NofiPlayroomStatus.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NofiPlayroomStatus message.
* @function verify
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NofiPlayroomStatus.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.WorkOutline != null && message.hasOwnProperty("WorkOutline"))
if (!$util.isInteger(message.WorkOutline))
return "WorkOutline: integer expected";
return null;
};
/**
* Creates a NofiPlayroomStatus message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NofiPlayroomStatus} NofiPlayroomStatus
*/
NofiPlayroomStatus.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NofiPlayroomStatus)
return object;
var message = new $root.tutorial.NofiPlayroomStatus();
if (object.WorkOutline != null)
message.WorkOutline = object.WorkOutline | 0;
return message;
};
/**
* Creates a plain object from a NofiPlayroomStatus message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {tutorial.NofiPlayroomStatus} message NofiPlayroomStatus
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NofiPlayroomStatus.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.WorkOutline = 0;
if (message.WorkOutline != null && message.hasOwnProperty("WorkOutline"))
object.WorkOutline = message.WorkOutline;
return object;
};
/**
* Converts this NofiPlayroomStatus to JSON.
* @function toJSON
* @memberof tutorial.NofiPlayroomStatus
* @instance
* @returns {Object.<string,*>} JSON object
*/
NofiPlayroomStatus.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NofiPlayroomStatus
* @function getTypeUrl
* @memberof tutorial.NofiPlayroomStatus
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NofiPlayroomStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NofiPlayroomStatus";
};
return NofiPlayroomStatus;
})();
tutorial.NotifyPlayroomWork = (function() {
/**
* Properties of a NotifyPlayroomWork.
* @memberof tutorial
* @interface INotifyPlayroomWork
* @property {number|null} [StartTime] NotifyPlayroomWork StartTime
* @property {number|null} [WorkStatus] NotifyPlayroomWork WorkStatus
*/
/**
* Constructs a new NotifyPlayroomWork.
* @memberof tutorial
* @classdesc Represents a NotifyPlayroomWork.
* @implements INotifyPlayroomWork
* @constructor
* @param {tutorial.INotifyPlayroomWork=} [properties] Properties to set
*/
function NotifyPlayroomWork(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]];
}
/**
* NotifyPlayroomWork StartTime.
* @member {number} StartTime
* @memberof tutorial.NotifyPlayroomWork
* @instance
*/
NotifyPlayroomWork.prototype.StartTime = 0;
/**
* NotifyPlayroomWork WorkStatus.
* @member {number} WorkStatus
* @memberof tutorial.NotifyPlayroomWork
* @instance
*/
NotifyPlayroomWork.prototype.WorkStatus = 0;
/**
* Creates a new NotifyPlayroomWork instance using the specified properties.
* @function create
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {tutorial.INotifyPlayroomWork=} [properties] Properties to set
* @returns {tutorial.NotifyPlayroomWork} NotifyPlayroomWork instance
*/
NotifyPlayroomWork.create = function create(properties) {
return new NotifyPlayroomWork(properties);
};
/**
* Encodes the specified NotifyPlayroomWork message. Does not implicitly {@link tutorial.NotifyPlayroomWork.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {tutorial.INotifyPlayroomWork} message NotifyPlayroomWork message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyPlayroomWork.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.StartTime != null && Object.hasOwnProperty.call(message, "StartTime"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.StartTime);
if (message.WorkStatus != null && Object.hasOwnProperty.call(message, "WorkStatus"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.WorkStatus);
return writer;
};
/**
* Encodes the specified NotifyPlayroomWork message, length delimited. Does not implicitly {@link tutorial.NotifyPlayroomWork.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {tutorial.INotifyPlayroomWork} message NotifyPlayroomWork message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyPlayroomWork.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyPlayroomWork message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyPlayroomWork} NotifyPlayroomWork
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyPlayroomWork.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.NotifyPlayroomWork();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.StartTime = reader.int32();
break;
}
case 2: {
message.WorkStatus = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyPlayroomWork message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyPlayroomWork} NotifyPlayroomWork
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyPlayroomWork.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyPlayroomWork message.
* @function verify
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyPlayroomWork.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.StartTime != null && message.hasOwnProperty("StartTime"))
if (!$util.isInteger(message.StartTime))
return "StartTime: integer expected";
if (message.WorkStatus != null && message.hasOwnProperty("WorkStatus"))
if (!$util.isInteger(message.WorkStatus))
return "WorkStatus: integer expected";
return null;
};
/**
* Creates a NotifyPlayroomWork message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyPlayroomWork} NotifyPlayroomWork
*/
NotifyPlayroomWork.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyPlayroomWork)
return object;
var message = new $root.tutorial.NotifyPlayroomWork();
if (object.StartTime != null)
message.StartTime = object.StartTime | 0;
if (object.WorkStatus != null)
message.WorkStatus = object.WorkStatus | 0;
return message;
};
/**
* Creates a plain object from a NotifyPlayroomWork message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {tutorial.NotifyPlayroomWork} message NotifyPlayroomWork
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyPlayroomWork.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.StartTime = 0;
object.WorkStatus = 0;
}
if (message.StartTime != null && message.hasOwnProperty("StartTime"))
object.StartTime = message.StartTime;
if (message.WorkStatus != null && message.hasOwnProperty("WorkStatus"))
object.WorkStatus = message.WorkStatus;
return object;
};
/**
* Converts this NotifyPlayroomWork to JSON.
* @function toJSON
* @memberof tutorial.NotifyPlayroomWork
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyPlayroomWork.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyPlayroomWork
* @function getTypeUrl
* @memberof tutorial.NotifyPlayroomWork
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyPlayroomWork.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyPlayroomWork";
};
return NotifyPlayroomWork;
})();
tutorial.NotifyPlayroomLose = (function() {
/**
* Properties of a NotifyPlayroomLose.
* @memberof tutorial
* @interface INotifyPlayroomLose
* @property {Array.<tutorial.IItemInfo>|null} [LoseItem] NotifyPlayroomLose LoseItem
* @property {number|null} [Chip] NotifyPlayroomLose Chip
*/
/**
* Constructs a new NotifyPlayroomLose.
* @memberof tutorial
* @classdesc Represents a NotifyPlayroomLose.
* @implements INotifyPlayroomLose
* @constructor
* @param {tutorial.INotifyPlayroomLose=} [properties] Properties to set
*/
function NotifyPlayroomLose(properties) {
this.LoseItem = [];
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]];
}
/**
* NotifyPlayroomLose LoseItem.
* @member {Array.<tutorial.IItemInfo>} LoseItem
* @memberof tutorial.NotifyPlayroomLose
* @instance
*/
NotifyPlayroomLose.prototype.LoseItem = $util.emptyArray;
/**
* NotifyPlayroomLose Chip.
* @member {number} Chip
* @memberof tutorial.NotifyPlayroomLose
* @instance
*/
NotifyPlayroomLose.prototype.Chip = 0;
/**
* Creates a new NotifyPlayroomLose instance using the specified properties.
* @function create
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {tutorial.INotifyPlayroomLose=} [properties] Properties to set
* @returns {tutorial.NotifyPlayroomLose} NotifyPlayroomLose instance
*/
NotifyPlayroomLose.create = function create(properties) {
return new NotifyPlayroomLose(properties);
};
/**
* Encodes the specified NotifyPlayroomLose message. Does not implicitly {@link tutorial.NotifyPlayroomLose.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {tutorial.INotifyPlayroomLose} message NotifyPlayroomLose message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyPlayroomLose.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.LoseItem != null && message.LoseItem.length)
for (var i = 0; i < message.LoseItem.length; ++i)
$root.tutorial.ItemInfo.encode(message.LoseItem[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.Chip != null && Object.hasOwnProperty.call(message, "Chip"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Chip);
return writer;
};
/**
* Encodes the specified NotifyPlayroomLose message, length delimited. Does not implicitly {@link tutorial.NotifyPlayroomLose.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {tutorial.INotifyPlayroomLose} message NotifyPlayroomLose message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyPlayroomLose.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyPlayroomLose message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyPlayroomLose} NotifyPlayroomLose
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyPlayroomLose.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.NotifyPlayroomLose();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.LoseItem && message.LoseItem.length))
message.LoseItem = [];
message.LoseItem.push($root.tutorial.ItemInfo.decode(reader, reader.uint32()));
break;
}
case 2: {
message.Chip = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyPlayroomLose message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyPlayroomLose} NotifyPlayroomLose
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyPlayroomLose.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyPlayroomLose message.
* @function verify
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyPlayroomLose.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.LoseItem != null && message.hasOwnProperty("LoseItem")) {
if (!Array.isArray(message.LoseItem))
return "LoseItem: array expected";
for (var i = 0; i < message.LoseItem.length; ++i) {
var error = $root.tutorial.ItemInfo.verify(message.LoseItem[i]);
if (error)
return "LoseItem." + error;
}
}
if (message.Chip != null && message.hasOwnProperty("Chip"))
if (!$util.isInteger(message.Chip))
return "Chip: integer expected";
return null;
};
/**
* Creates a NotifyPlayroomLose message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyPlayroomLose} NotifyPlayroomLose
*/
NotifyPlayroomLose.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyPlayroomLose)
return object;
var message = new $root.tutorial.NotifyPlayroomLose();
if (object.LoseItem) {
if (!Array.isArray(object.LoseItem))
throw TypeError(".tutorial.NotifyPlayroomLose.LoseItem: array expected");
message.LoseItem = [];
for (var i = 0; i < object.LoseItem.length; ++i) {
if (typeof object.LoseItem[i] !== "object")
throw TypeError(".tutorial.NotifyPlayroomLose.LoseItem: object expected");
message.LoseItem[i] = $root.tutorial.ItemInfo.fromObject(object.LoseItem[i]);
}
}
if (object.Chip != null)
message.Chip = object.Chip | 0;
return message;
};
/**
* Creates a plain object from a NotifyPlayroomLose message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {tutorial.NotifyPlayroomLose} message NotifyPlayroomLose
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyPlayroomLose.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.LoseItem = [];
if (options.defaults)
object.Chip = 0;
if (message.LoseItem && message.LoseItem.length) {
object.LoseItem = [];
for (var j = 0; j < message.LoseItem.length; ++j)
object.LoseItem[j] = $root.tutorial.ItemInfo.toObject(message.LoseItem[j], options);
}
if (message.Chip != null && message.hasOwnProperty("Chip"))
object.Chip = message.Chip;
return object;
};
/**
* Converts this NotifyPlayroomLose to JSON.
* @function toJSON
* @memberof tutorial.NotifyPlayroomLose
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyPlayroomLose.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyPlayroomLose
* @function getTypeUrl
* @memberof tutorial.NotifyPlayroomLose
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyPlayroomLose.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyPlayroomLose";
};
return NotifyPlayroomLose;
})();
tutorial.NotifyPlayroomMood = (function() {
/**
* Properties of a NotifyPlayroomMood.
* @memberof tutorial
* @interface INotifyPlayroomMood
* @property {number|null} [AllMood] NotifyPlayroomMood AllMood
* @property {Object.<string,number>|null} [Mood] NotifyPlayroomMood Mood
*/
/**
* Constructs a new NotifyPlayroomMood.
* @memberof tutorial
* @classdesc Represents a NotifyPlayroomMood.
* @implements INotifyPlayroomMood
* @constructor
* @param {tutorial.INotifyPlayroomMood=} [properties] Properties to set
*/
function NotifyPlayroomMood(properties) {
this.Mood = {};
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]];
}
/**
* NotifyPlayroomMood AllMood.
* @member {number} AllMood
* @memberof tutorial.NotifyPlayroomMood
* @instance
*/
NotifyPlayroomMood.prototype.AllMood = 0;
/**
* NotifyPlayroomMood Mood.
* @member {Object.<string,number>} Mood
* @memberof tutorial.NotifyPlayroomMood
* @instance
*/
NotifyPlayroomMood.prototype.Mood = $util.emptyObject;
/**
* Creates a new NotifyPlayroomMood instance using the specified properties.
* @function create
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {tutorial.INotifyPlayroomMood=} [properties] Properties to set
* @returns {tutorial.NotifyPlayroomMood} NotifyPlayroomMood instance
*/
NotifyPlayroomMood.create = function create(properties) {
return new NotifyPlayroomMood(properties);
};
/**
* Encodes the specified NotifyPlayroomMood message. Does not implicitly {@link tutorial.NotifyPlayroomMood.verify|verify} messages.
* @function encode
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {tutorial.INotifyPlayroomMood} message NotifyPlayroomMood message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyPlayroomMood.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.AllMood != null && Object.hasOwnProperty.call(message, "AllMood"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.AllMood);
if (message.Mood != null && Object.hasOwnProperty.call(message, "Mood"))
for (var keys = Object.keys(message.Mood), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Mood[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified NotifyPlayroomMood message, length delimited. Does not implicitly {@link tutorial.NotifyPlayroomMood.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {tutorial.INotifyPlayroomMood} message NotifyPlayroomMood message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NotifyPlayroomMood.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NotifyPlayroomMood message from the specified reader or buffer.
* @function decode
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.NotifyPlayroomMood} NotifyPlayroomMood
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyPlayroomMood.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.NotifyPlayroomMood(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.AllMood = reader.int32();
break;
}
case 2: {
if (message.Mood === $util.emptyObject)
message.Mood = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Mood[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a NotifyPlayroomMood message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.NotifyPlayroomMood} NotifyPlayroomMood
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NotifyPlayroomMood.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NotifyPlayroomMood message.
* @function verify
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NotifyPlayroomMood.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.AllMood != null && message.hasOwnProperty("AllMood"))
if (!$util.isInteger(message.AllMood))
return "AllMood: integer expected";
if (message.Mood != null && message.hasOwnProperty("Mood")) {
if (!$util.isObject(message.Mood))
return "Mood: object expected";
var key = Object.keys(message.Mood);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Mood: integer key{k:int32} expected";
if (!$util.isInteger(message.Mood[key[i]]))
return "Mood: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates a NotifyPlayroomMood message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.NotifyPlayroomMood} NotifyPlayroomMood
*/
NotifyPlayroomMood.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.NotifyPlayroomMood)
return object;
var message = new $root.tutorial.NotifyPlayroomMood();
if (object.AllMood != null)
message.AllMood = object.AllMood | 0;
if (object.Mood) {
if (typeof object.Mood !== "object")
throw TypeError(".tutorial.NotifyPlayroomMood.Mood: object expected");
message.Mood = {};
for (var keys = Object.keys(object.Mood), i = 0; i < keys.length; ++i)
message.Mood[keys[i]] = object.Mood[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a NotifyPlayroomMood message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {tutorial.NotifyPlayroomMood} message NotifyPlayroomMood
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NotifyPlayroomMood.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Mood = {};
if (options.defaults)
object.AllMood = 0;
if (message.AllMood != null && message.hasOwnProperty("AllMood"))
object.AllMood = message.AllMood;
var keys2;
if (message.Mood && (keys2 = Object.keys(message.Mood)).length) {
object.Mood = {};
for (var j = 0; j < keys2.length; ++j)
object.Mood[keys2[j]] = message.Mood[keys2[j]];
}
return object;
};
/**
* Converts this NotifyPlayroomMood to JSON.
* @function toJSON
* @memberof tutorial.NotifyPlayroomMood
* @instance
* @returns {Object.<string,*>} JSON object
*/
NotifyPlayroomMood.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for NotifyPlayroomMood
* @function getTypeUrl
* @memberof tutorial.NotifyPlayroomMood
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
NotifyPlayroomMood.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.NotifyPlayroomMood";
};
return NotifyPlayroomMood;
})();
tutorial.FriendRoom = (function() {
/**
* Properties of a FriendRoom.
* @memberof tutorial
* @interface IFriendRoom
* @property {number|null} [Uid] FriendRoom Uid
* @property {string|null} [Name] FriendRoom Name
* @property {number|null} [Face] FriendRoom Face
* @property {number|null} [Avatar] FriendRoom Avatar
* @property {number|null} [Times] FriendRoom Times
*/
/**
* Constructs a new FriendRoom.
* @memberof tutorial
* @classdesc Represents a FriendRoom.
* @implements IFriendRoom
* @constructor
* @param {tutorial.IFriendRoom=} [properties] Properties to set
*/
function FriendRoom(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]];
}
/**
* FriendRoom Uid.
* @member {number} Uid
* @memberof tutorial.FriendRoom
* @instance
*/
FriendRoom.prototype.Uid = 0;
/**
* FriendRoom Name.
* @member {string} Name
* @memberof tutorial.FriendRoom
* @instance
*/
FriendRoom.prototype.Name = "";
/**
* FriendRoom Face.
* @member {number} Face
* @memberof tutorial.FriendRoom
* @instance
*/
FriendRoom.prototype.Face = 0;
/**
* FriendRoom Avatar.
* @member {number} Avatar
* @memberof tutorial.FriendRoom
* @instance
*/
FriendRoom.prototype.Avatar = 0;
/**
* FriendRoom Times.
* @member {number} Times
* @memberof tutorial.FriendRoom
* @instance
*/
FriendRoom.prototype.Times = 0;
/**
* Creates a new FriendRoom instance using the specified properties.
* @function create
* @memberof tutorial.FriendRoom
* @static
* @param {tutorial.IFriendRoom=} [properties] Properties to set
* @returns {tutorial.FriendRoom} FriendRoom instance
*/
FriendRoom.create = function create(properties) {
return new FriendRoom(properties);
};
/**
* Encodes the specified FriendRoom message. Does not implicitly {@link tutorial.FriendRoom.verify|verify} messages.
* @function encode
* @memberof tutorial.FriendRoom
* @static
* @param {tutorial.IFriendRoom} message FriendRoom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FriendRoom.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Name);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Avatar);
if (message.Times != null && Object.hasOwnProperty.call(message, "Times"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Times);
return writer;
};
/**
* Encodes the specified FriendRoom message, length delimited. Does not implicitly {@link tutorial.FriendRoom.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.FriendRoom
* @static
* @param {tutorial.IFriendRoom} message FriendRoom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FriendRoom.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a FriendRoom message from the specified reader or buffer.
* @function decode
* @memberof tutorial.FriendRoom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.FriendRoom} FriendRoom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FriendRoom.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.FriendRoom();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.Name = reader.string();
break;
}
case 3: {
message.Face = reader.int32();
break;
}
case 4: {
message.Avatar = reader.int32();
break;
}
case 5: {
message.Times = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a FriendRoom message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.FriendRoom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.FriendRoom} FriendRoom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FriendRoom.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a FriendRoom message.
* @function verify
* @memberof tutorial.FriendRoom
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
FriendRoom.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
if (message.Times != null && message.hasOwnProperty("Times"))
if (!$util.isInteger(message.Times))
return "Times: integer expected";
return null;
};
/**
* Creates a FriendRoom message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.FriendRoom
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.FriendRoom} FriendRoom
*/
FriendRoom.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.FriendRoom)
return object;
var message = new $root.tutorial.FriendRoom();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.Name != null)
message.Name = String(object.Name);
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
if (object.Times != null)
message.Times = object.Times | 0;
return message;
};
/**
* Creates a plain object from a FriendRoom message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.FriendRoom
* @static
* @param {tutorial.FriendRoom} message FriendRoom
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
FriendRoom.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Uid = 0;
object.Name = "";
object.Face = 0;
object.Avatar = 0;
object.Times = 0;
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
if (message.Times != null && message.hasOwnProperty("Times"))
object.Times = message.Times;
return object;
};
/**
* Converts this FriendRoom to JSON.
* @function toJSON
* @memberof tutorial.FriendRoom
* @instance
* @returns {Object.<string,*>} JSON object
*/
FriendRoom.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for FriendRoom
* @function getTypeUrl
* @memberof tutorial.FriendRoom
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
FriendRoom.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.FriendRoom";
};
return FriendRoom;
})();
tutorial.RoomOpponent = (function() {
/**
* Properties of a RoomOpponent.
* @memberof tutorial
* @interface IRoomOpponent
* @property {number|null} [Uid] RoomOpponent Uid
* @property {string|null} [Name] RoomOpponent Name
* @property {number|null} [Face] RoomOpponent Face
* @property {number|null} [Avatar] RoomOpponent Avatar
* @property {number|null} [LastTime] RoomOpponent LastTime
*/
/**
* Constructs a new RoomOpponent.
* @memberof tutorial
* @classdesc Represents a RoomOpponent.
* @implements IRoomOpponent
* @constructor
* @param {tutorial.IRoomOpponent=} [properties] Properties to set
*/
function RoomOpponent(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]];
}
/**
* RoomOpponent Uid.
* @member {number} Uid
* @memberof tutorial.RoomOpponent
* @instance
*/
RoomOpponent.prototype.Uid = 0;
/**
* RoomOpponent Name.
* @member {string} Name
* @memberof tutorial.RoomOpponent
* @instance
*/
RoomOpponent.prototype.Name = "";
/**
* RoomOpponent Face.
* @member {number} Face
* @memberof tutorial.RoomOpponent
* @instance
*/
RoomOpponent.prototype.Face = 0;
/**
* RoomOpponent Avatar.
* @member {number} Avatar
* @memberof tutorial.RoomOpponent
* @instance
*/
RoomOpponent.prototype.Avatar = 0;
/**
* RoomOpponent LastTime.
* @member {number} LastTime
* @memberof tutorial.RoomOpponent
* @instance
*/
RoomOpponent.prototype.LastTime = 0;
/**
* Creates a new RoomOpponent instance using the specified properties.
* @function create
* @memberof tutorial.RoomOpponent
* @static
* @param {tutorial.IRoomOpponent=} [properties] Properties to set
* @returns {tutorial.RoomOpponent} RoomOpponent instance
*/
RoomOpponent.create = function create(properties) {
return new RoomOpponent(properties);
};
/**
* Encodes the specified RoomOpponent message. Does not implicitly {@link tutorial.RoomOpponent.verify|verify} messages.
* @function encode
* @memberof tutorial.RoomOpponent
* @static
* @param {tutorial.IRoomOpponent} message RoomOpponent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
RoomOpponent.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Name);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Avatar);
if (message.LastTime != null && Object.hasOwnProperty.call(message, "LastTime"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.LastTime);
return writer;
};
/**
* Encodes the specified RoomOpponent message, length delimited. Does not implicitly {@link tutorial.RoomOpponent.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.RoomOpponent
* @static
* @param {tutorial.IRoomOpponent} message RoomOpponent message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
RoomOpponent.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a RoomOpponent message from the specified reader or buffer.
* @function decode
* @memberof tutorial.RoomOpponent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.RoomOpponent} RoomOpponent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
RoomOpponent.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.RoomOpponent();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.Name = reader.string();
break;
}
case 3: {
message.Face = reader.int32();
break;
}
case 4: {
message.Avatar = reader.int32();
break;
}
case 5: {
message.LastTime = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a RoomOpponent message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.RoomOpponent
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.RoomOpponent} RoomOpponent
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
RoomOpponent.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a RoomOpponent message.
* @function verify
* @memberof tutorial.RoomOpponent
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
RoomOpponent.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
if (message.LastTime != null && message.hasOwnProperty("LastTime"))
if (!$util.isInteger(message.LastTime))
return "LastTime: integer expected";
return null;
};
/**
* Creates a RoomOpponent message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.RoomOpponent
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.RoomOpponent} RoomOpponent
*/
RoomOpponent.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.RoomOpponent)
return object;
var message = new $root.tutorial.RoomOpponent();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.Name != null)
message.Name = String(object.Name);
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
if (object.LastTime != null)
message.LastTime = object.LastTime | 0;
return message;
};
/**
* Creates a plain object from a RoomOpponent message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.RoomOpponent
* @static
* @param {tutorial.RoomOpponent} message RoomOpponent
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
RoomOpponent.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Uid = 0;
object.Name = "";
object.Face = 0;
object.Avatar = 0;
object.LastTime = 0;
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
if (message.LastTime != null && message.hasOwnProperty("LastTime"))
object.LastTime = message.LastTime;
return object;
};
/**
* Converts this RoomOpponent to JSON.
* @function toJSON
* @memberof tutorial.RoomOpponent
* @instance
* @returns {Object.<string,*>} JSON object
*/
RoomOpponent.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for RoomOpponent
* @function getTypeUrl
* @memberof tutorial.RoomOpponent
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
RoomOpponent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.RoomOpponent";
};
return RoomOpponent;
})();
tutorial.ReqPlayroomInfo = (function() {
/**
* Properties of a ReqPlayroomInfo.
* @memberof tutorial
* @interface IReqPlayroomInfo
* @property {number|null} [Uid] ReqPlayroomInfo Uid
*/
/**
* Constructs a new ReqPlayroomInfo.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomInfo.
* @implements IReqPlayroomInfo
* @constructor
* @param {tutorial.IReqPlayroomInfo=} [properties] Properties to set
*/
function ReqPlayroomInfo(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]];
}
/**
* ReqPlayroomInfo Uid.
* @member {number} Uid
* @memberof tutorial.ReqPlayroomInfo
* @instance
*/
ReqPlayroomInfo.prototype.Uid = 0;
/**
* Creates a new ReqPlayroomInfo instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {tutorial.IReqPlayroomInfo=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomInfo} ReqPlayroomInfo instance
*/
ReqPlayroomInfo.create = function create(properties) {
return new ReqPlayroomInfo(properties);
};
/**
* Encodes the specified ReqPlayroomInfo message. Does not implicitly {@link tutorial.ReqPlayroomInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {tutorial.IReqPlayroomInfo} message ReqPlayroomInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ReqPlayroomInfo message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {tutorial.IReqPlayroomInfo} message ReqPlayroomInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomInfo} ReqPlayroomInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomInfo.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.ReqPlayroomInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomInfo} ReqPlayroomInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomInfo message.
* @function verify
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ReqPlayroomInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomInfo} ReqPlayroomInfo
*/
ReqPlayroomInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomInfo)
return object;
var message = new $root.tutorial.ReqPlayroomInfo();
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayroomInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {tutorial.ReqPlayroomInfo} message ReqPlayroomInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Uid = 0;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ReqPlayroomInfo to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomInfo
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomInfo";
};
return ReqPlayroomInfo;
})();
tutorial.ResPlayroomInfo = (function() {
/**
* Properties of a ResPlayroomInfo.
* @memberof tutorial
* @interface IResPlayroomInfo
* @property {number|null} [Uid] ResPlayroomInfo Uid
* @property {string|null} [name] ResPlayroomInfo name
* @property {number|null} [Face] ResPlayroomInfo Face
* @property {number|null} [Avatar] ResPlayroomInfo Avatar
* @property {Object.<string,number>|null} [Playroom] ResPlayroomInfo Playroom
* @property {number|null} [GameId] ResPlayroomInfo GameId
* @property {Object.<string,tutorial.IItemInfo>|null} [Items] ResPlayroomInfo Items
* @property {number|null} [Status] ResPlayroomInfo Status
* @property {boolean|null} [defense] ResPlayroomInfo defense
* @property {Object.<string,number>|null} [flip] ResPlayroomInfo flip
* @property {number|null} [Chip] ResPlayroomInfo Chip
* @property {string|null} [PetName] ResPlayroomInfo PetName
*/
/**
* Constructs a new ResPlayroomInfo.
* @memberof tutorial
* @classdesc Represents a ResPlayroomInfo.
* @implements IResPlayroomInfo
* @constructor
* @param {tutorial.IResPlayroomInfo=} [properties] Properties to set
*/
function ResPlayroomInfo(properties) {
this.Playroom = {};
this.Items = {};
this.flip = {};
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]];
}
/**
* ResPlayroomInfo Uid.
* @member {number} Uid
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.Uid = 0;
/**
* ResPlayroomInfo name.
* @member {string} name
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.name = "";
/**
* ResPlayroomInfo Face.
* @member {number} Face
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.Face = 0;
/**
* ResPlayroomInfo Avatar.
* @member {number} Avatar
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.Avatar = 0;
/**
* ResPlayroomInfo Playroom.
* @member {Object.<string,number>} Playroom
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.Playroom = $util.emptyObject;
/**
* ResPlayroomInfo GameId.
* @member {number} GameId
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.GameId = 0;
/**
* ResPlayroomInfo Items.
* @member {Object.<string,tutorial.IItemInfo>} Items
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.Items = $util.emptyObject;
/**
* ResPlayroomInfo Status.
* @member {number} Status
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.Status = 0;
/**
* ResPlayroomInfo defense.
* @member {boolean} defense
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.defense = false;
/**
* ResPlayroomInfo flip.
* @member {Object.<string,number>} flip
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.flip = $util.emptyObject;
/**
* ResPlayroomInfo Chip.
* @member {number} Chip
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.Chip = 0;
/**
* ResPlayroomInfo PetName.
* @member {string} PetName
* @memberof tutorial.ResPlayroomInfo
* @instance
*/
ResPlayroomInfo.prototype.PetName = "";
/**
* Creates a new ResPlayroomInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {tutorial.IResPlayroomInfo=} [properties] Properties to set
* @returns {tutorial.ResPlayroomInfo} ResPlayroomInfo instance
*/
ResPlayroomInfo.create = function create(properties) {
return new ResPlayroomInfo(properties);
};
/**
* Encodes the specified ResPlayroomInfo message. Does not implicitly {@link tutorial.ResPlayroomInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {tutorial.IResPlayroomInfo} message ResPlayroomInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Avatar);
if (message.Playroom != null && Object.hasOwnProperty.call(message, "Playroom"))
for (var keys = Object.keys(message.Playroom), i = 0; i < keys.length; ++i)
writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Playroom[keys[i]]).ldelim();
if (message.GameId != null && Object.hasOwnProperty.call(message, "GameId"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.GameId);
if (message.Items != null && Object.hasOwnProperty.call(message, "Items"))
for (var keys = Object.keys(message.Items), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.ItemInfo.encode(message.Items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.Status);
if (message.defense != null && Object.hasOwnProperty.call(message, "defense"))
writer.uint32(/* id 9, wireType 0 =*/72).bool(message.defense);
if (message.flip != null && Object.hasOwnProperty.call(message, "flip"))
for (var keys = Object.keys(message.flip), i = 0; i < keys.length; ++i)
writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.flip[keys[i]]).ldelim();
if (message.Chip != null && Object.hasOwnProperty.call(message, "Chip"))
writer.uint32(/* id 11, wireType 0 =*/88).int32(message.Chip);
if (message.PetName != null && Object.hasOwnProperty.call(message, "PetName"))
writer.uint32(/* id 12, wireType 2 =*/98).string(message.PetName);
return writer;
};
/**
* Encodes the specified ResPlayroomInfo message, length delimited. Does not implicitly {@link tutorial.ResPlayroomInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {tutorial.IResPlayroomInfo} message ResPlayroomInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomInfo} ResPlayroomInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomInfo.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.ResPlayroomInfo(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
case 2: {
message.name = reader.string();
break;
}
case 3: {
message.Face = reader.int32();
break;
}
case 4: {
message.Avatar = reader.int32();
break;
}
case 5: {
if (message.Playroom === $util.emptyObject)
message.Playroom = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Playroom[key] = value;
break;
}
case 6: {
message.GameId = reader.int32();
break;
}
case 7: {
if (message.Items === $util.emptyObject)
message.Items = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.ItemInfo.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Items[key] = value;
break;
}
case 8: {
message.Status = reader.int32();
break;
}
case 9: {
message.defense = reader.bool();
break;
}
case 10: {
if (message.flip === $util.emptyObject)
message.flip = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.flip[key] = value;
break;
}
case 11: {
message.Chip = reader.int32();
break;
}
case 12: {
message.PetName = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomInfo} ResPlayroomInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomInfo message.
* @function verify
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
if (message.Playroom != null && message.hasOwnProperty("Playroom")) {
if (!$util.isObject(message.Playroom))
return "Playroom: object expected";
var key = Object.keys(message.Playroom);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Playroom: integer key{k:int32} expected";
if (!$util.isInteger(message.Playroom[key[i]]))
return "Playroom: integer{k:int32} expected";
}
}
if (message.GameId != null && message.hasOwnProperty("GameId"))
if (!$util.isInteger(message.GameId))
return "GameId: integer expected";
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!$util.isObject(message.Items))
return "Items: object expected";
var key = Object.keys(message.Items);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Items: integer key{k:int32} expected";
{
var error = $root.tutorial.ItemInfo.verify(message.Items[key[i]]);
if (error)
return "Items." + error;
}
}
}
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.defense != null && message.hasOwnProperty("defense"))
if (typeof message.defense !== "boolean")
return "defense: boolean expected";
if (message.flip != null && message.hasOwnProperty("flip")) {
if (!$util.isObject(message.flip))
return "flip: object expected";
var key = Object.keys(message.flip);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "flip: integer key{k:int32} expected";
if (!$util.isInteger(message.flip[key[i]]))
return "flip: integer{k:int32} expected";
}
}
if (message.Chip != null && message.hasOwnProperty("Chip"))
if (!$util.isInteger(message.Chip))
return "Chip: integer expected";
if (message.PetName != null && message.hasOwnProperty("PetName"))
if (!$util.isString(message.PetName))
return "PetName: string expected";
return null;
};
/**
* Creates a ResPlayroomInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomInfo} ResPlayroomInfo
*/
ResPlayroomInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomInfo)
return object;
var message = new $root.tutorial.ResPlayroomInfo();
if (object.Uid != null)
message.Uid = object.Uid | 0;
if (object.name != null)
message.name = String(object.name);
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
if (object.Playroom) {
if (typeof object.Playroom !== "object")
throw TypeError(".tutorial.ResPlayroomInfo.Playroom: object expected");
message.Playroom = {};
for (var keys = Object.keys(object.Playroom), i = 0; i < keys.length; ++i)
message.Playroom[keys[i]] = object.Playroom[keys[i]] | 0;
}
if (object.GameId != null)
message.GameId = object.GameId | 0;
if (object.Items) {
if (typeof object.Items !== "object")
throw TypeError(".tutorial.ResPlayroomInfo.Items: object expected");
message.Items = {};
for (var keys = Object.keys(object.Items), i = 0; i < keys.length; ++i) {
if (typeof object.Items[keys[i]] !== "object")
throw TypeError(".tutorial.ResPlayroomInfo.Items: object expected");
message.Items[keys[i]] = $root.tutorial.ItemInfo.fromObject(object.Items[keys[i]]);
}
}
if (object.Status != null)
message.Status = object.Status | 0;
if (object.defense != null)
message.defense = Boolean(object.defense);
if (object.flip) {
if (typeof object.flip !== "object")
throw TypeError(".tutorial.ResPlayroomInfo.flip: object expected");
message.flip = {};
for (var keys = Object.keys(object.flip), i = 0; i < keys.length; ++i)
message.flip[keys[i]] = object.flip[keys[i]] | 0;
}
if (object.Chip != null)
message.Chip = object.Chip | 0;
if (object.PetName != null)
message.PetName = String(object.PetName);
return message;
};
/**
* Creates a plain object from a ResPlayroomInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {tutorial.ResPlayroomInfo} message ResPlayroomInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults) {
object.Playroom = {};
object.Items = {};
object.flip = {};
}
if (options.defaults) {
object.Uid = 0;
object.name = "";
object.Face = 0;
object.Avatar = 0;
object.GameId = 0;
object.Status = 0;
object.defense = false;
object.Chip = 0;
object.PetName = "";
}
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
var keys2;
if (message.Playroom && (keys2 = Object.keys(message.Playroom)).length) {
object.Playroom = {};
for (var j = 0; j < keys2.length; ++j)
object.Playroom[keys2[j]] = message.Playroom[keys2[j]];
}
if (message.GameId != null && message.hasOwnProperty("GameId"))
object.GameId = message.GameId;
if (message.Items && (keys2 = Object.keys(message.Items)).length) {
object.Items = {};
for (var j = 0; j < keys2.length; ++j)
object.Items[keys2[j]] = $root.tutorial.ItemInfo.toObject(message.Items[keys2[j]], options);
}
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.defense != null && message.hasOwnProperty("defense"))
object.defense = message.defense;
if (message.flip && (keys2 = Object.keys(message.flip)).length) {
object.flip = {};
for (var j = 0; j < keys2.length; ++j)
object.flip[keys2[j]] = message.flip[keys2[j]];
}
if (message.Chip != null && message.hasOwnProperty("Chip"))
object.Chip = message.Chip;
if (message.PetName != null && message.hasOwnProperty("PetName"))
object.PetName = message.PetName;
return object;
};
/**
* Converts this ResPlayroomInfo to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomInfo
* @function getTypeUrl
* @memberof tutorial.ResPlayroomInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomInfo";
};
return ResPlayroomInfo;
})();
tutorial.ReqPlayroomFlip = (function() {
/**
* Properties of a ReqPlayroomFlip.
* @memberof tutorial
* @interface IReqPlayroomFlip
* @property {number|null} [Id] ReqPlayroomFlip Id
*/
/**
* Constructs a new ReqPlayroomFlip.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomFlip.
* @implements IReqPlayroomFlip
* @constructor
* @param {tutorial.IReqPlayroomFlip=} [properties] Properties to set
*/
function ReqPlayroomFlip(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]];
}
/**
* ReqPlayroomFlip Id.
* @member {number} Id
* @memberof tutorial.ReqPlayroomFlip
* @instance
*/
ReqPlayroomFlip.prototype.Id = 0;
/**
* Creates a new ReqPlayroomFlip instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {tutorial.IReqPlayroomFlip=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomFlip} ReqPlayroomFlip instance
*/
ReqPlayroomFlip.create = function create(properties) {
return new ReqPlayroomFlip(properties);
};
/**
* Encodes the specified ReqPlayroomFlip message. Does not implicitly {@link tutorial.ReqPlayroomFlip.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {tutorial.IReqPlayroomFlip} message ReqPlayroomFlip message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomFlip.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqPlayroomFlip message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomFlip.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {tutorial.IReqPlayroomFlip} message ReqPlayroomFlip message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomFlip.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomFlip message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomFlip} ReqPlayroomFlip
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomFlip.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.ReqPlayroomFlip();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomFlip message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomFlip} ReqPlayroomFlip
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomFlip.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomFlip message.
* @function verify
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomFlip.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqPlayroomFlip message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomFlip} ReqPlayroomFlip
*/
ReqPlayroomFlip.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomFlip)
return object;
var message = new $root.tutorial.ReqPlayroomFlip();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayroomFlip message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {tutorial.ReqPlayroomFlip} message ReqPlayroomFlip
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomFlip.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqPlayroomFlip to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomFlip
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomFlip.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomFlip
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomFlip
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomFlip.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomFlip";
};
return ReqPlayroomFlip;
})();
tutorial.ResPlayroomFlip = (function() {
/**
* Properties of a ResPlayroomFlip.
* @memberof tutorial
* @interface IResPlayroomFlip
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomFlip Code
* @property {string|null} [Msg] ResPlayroomFlip Msg
* @property {number|null} [Id] ResPlayroomFlip Id
* @property {number|null} [CardId] ResPlayroomFlip CardId
*/
/**
* Constructs a new ResPlayroomFlip.
* @memberof tutorial
* @classdesc Represents a ResPlayroomFlip.
* @implements IResPlayroomFlip
* @constructor
* @param {tutorial.IResPlayroomFlip=} [properties] Properties to set
*/
function ResPlayroomFlip(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]];
}
/**
* ResPlayroomFlip Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomFlip
* @instance
*/
ResPlayroomFlip.prototype.Code = 0;
/**
* ResPlayroomFlip Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomFlip
* @instance
*/
ResPlayroomFlip.prototype.Msg = "";
/**
* ResPlayroomFlip Id.
* @member {number} Id
* @memberof tutorial.ResPlayroomFlip
* @instance
*/
ResPlayroomFlip.prototype.Id = 0;
/**
* ResPlayroomFlip CardId.
* @member {number} CardId
* @memberof tutorial.ResPlayroomFlip
* @instance
*/
ResPlayroomFlip.prototype.CardId = 0;
/**
* Creates a new ResPlayroomFlip instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {tutorial.IResPlayroomFlip=} [properties] Properties to set
* @returns {tutorial.ResPlayroomFlip} ResPlayroomFlip instance
*/
ResPlayroomFlip.create = function create(properties) {
return new ResPlayroomFlip(properties);
};
/**
* Encodes the specified ResPlayroomFlip message. Does not implicitly {@link tutorial.ResPlayroomFlip.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {tutorial.IResPlayroomFlip} message ResPlayroomFlip message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomFlip.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Id);
if (message.CardId != null && Object.hasOwnProperty.call(message, "CardId"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.CardId);
return writer;
};
/**
* Encodes the specified ResPlayroomFlip message, length delimited. Does not implicitly {@link tutorial.ResPlayroomFlip.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {tutorial.IResPlayroomFlip} message ResPlayroomFlip message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomFlip.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomFlip message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomFlip} ResPlayroomFlip
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomFlip.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.ResPlayroomFlip();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.int32();
break;
}
case 4: {
message.CardId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomFlip message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomFlip} ResPlayroomFlip
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomFlip.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomFlip message.
* @function verify
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomFlip.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isInteger(message.Id))
return "Id: integer expected";
if (message.CardId != null && message.hasOwnProperty("CardId"))
if (!$util.isInteger(message.CardId))
return "CardId: integer expected";
return null;
};
/**
* Creates a ResPlayroomFlip message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomFlip} ResPlayroomFlip
*/
ResPlayroomFlip.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomFlip)
return object;
var message = new $root.tutorial.ResPlayroomFlip();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = object.Id | 0;
if (object.CardId != null)
message.CardId = object.CardId | 0;
return message;
};
/**
* Creates a plain object from a ResPlayroomFlip message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {tutorial.ResPlayroomFlip} message ResPlayroomFlip
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomFlip.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = 0;
object.CardId = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.CardId != null && message.hasOwnProperty("CardId"))
object.CardId = message.CardId;
return object;
};
/**
* Converts this ResPlayroomFlip to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomFlip
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomFlip.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomFlip
* @function getTypeUrl
* @memberof tutorial.ResPlayroomFlip
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomFlip.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomFlip";
};
return ResPlayroomFlip;
})();
tutorial.ReqPlayroomGame = (function() {
/**
* Properties of a ReqPlayroomGame.
* @memberof tutorial
* @interface IReqPlayroomGame
* @property {number|null} [Type] ReqPlayroomGame Type
*/
/**
* Constructs a new ReqPlayroomGame.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomGame.
* @implements IReqPlayroomGame
* @constructor
* @param {tutorial.IReqPlayroomGame=} [properties] Properties to set
*/
function ReqPlayroomGame(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]];
}
/**
* ReqPlayroomGame Type.
* @member {number} Type
* @memberof tutorial.ReqPlayroomGame
* @instance
*/
ReqPlayroomGame.prototype.Type = 0;
/**
* Creates a new ReqPlayroomGame instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {tutorial.IReqPlayroomGame=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomGame} ReqPlayroomGame instance
*/
ReqPlayroomGame.create = function create(properties) {
return new ReqPlayroomGame(properties);
};
/**
* Encodes the specified ReqPlayroomGame message. Does not implicitly {@link tutorial.ReqPlayroomGame.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {tutorial.IReqPlayroomGame} message ReqPlayroomGame message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomGame.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Type);
return writer;
};
/**
* Encodes the specified ReqPlayroomGame message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomGame.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {tutorial.IReqPlayroomGame} message ReqPlayroomGame message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomGame.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomGame message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomGame} ReqPlayroomGame
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomGame.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.ReqPlayroomGame();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Type = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomGame message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomGame} ReqPlayroomGame
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomGame.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomGame message.
* @function verify
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomGame.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
return null;
};
/**
* Creates a ReqPlayroomGame message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomGame} ReqPlayroomGame
*/
ReqPlayroomGame.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomGame)
return object;
var message = new $root.tutorial.ReqPlayroomGame();
if (object.Type != null)
message.Type = object.Type | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayroomGame message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {tutorial.ReqPlayroomGame} message ReqPlayroomGame
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomGame.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Type = 0;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
return object;
};
/**
* Converts this ReqPlayroomGame to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomGame
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomGame.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomGame
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomGame
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomGame.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomGame";
};
return ReqPlayroomGame;
})();
tutorial.ResPlayroomGame = (function() {
/**
* Properties of a ResPlayroomGame.
* @memberof tutorial
* @interface IResPlayroomGame
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomGame Code
* @property {string|null} [Msg] ResPlayroomGame Msg
* @property {number|null} [Type] ResPlayroomGame Type
* @property {Object.<string,tutorial.IItemInfo>|null} [Items] ResPlayroomGame Items
*/
/**
* Constructs a new ResPlayroomGame.
* @memberof tutorial
* @classdesc Represents a ResPlayroomGame.
* @implements IResPlayroomGame
* @constructor
* @param {tutorial.IResPlayroomGame=} [properties] Properties to set
*/
function ResPlayroomGame(properties) {
this.Items = {};
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]];
}
/**
* ResPlayroomGame Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomGame
* @instance
*/
ResPlayroomGame.prototype.Code = 0;
/**
* ResPlayroomGame Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomGame
* @instance
*/
ResPlayroomGame.prototype.Msg = "";
/**
* ResPlayroomGame Type.
* @member {number} Type
* @memberof tutorial.ResPlayroomGame
* @instance
*/
ResPlayroomGame.prototype.Type = 0;
/**
* ResPlayroomGame Items.
* @member {Object.<string,tutorial.IItemInfo>} Items
* @memberof tutorial.ResPlayroomGame
* @instance
*/
ResPlayroomGame.prototype.Items = $util.emptyObject;
/**
* Creates a new ResPlayroomGame instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomGame
* @static
* @param {tutorial.IResPlayroomGame=} [properties] Properties to set
* @returns {tutorial.ResPlayroomGame} ResPlayroomGame instance
*/
ResPlayroomGame.create = function create(properties) {
return new ResPlayroomGame(properties);
};
/**
* Encodes the specified ResPlayroomGame message. Does not implicitly {@link tutorial.ResPlayroomGame.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomGame
* @static
* @param {tutorial.IResPlayroomGame} message ResPlayroomGame message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomGame.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Type);
if (message.Items != null && Object.hasOwnProperty.call(message, "Items"))
for (var keys = Object.keys(message.Items), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.tutorial.ItemInfo.encode(message.Items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
return writer;
};
/**
* Encodes the specified ResPlayroomGame message, length delimited. Does not implicitly {@link tutorial.ResPlayroomGame.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomGame
* @static
* @param {tutorial.IResPlayroomGame} message ResPlayroomGame message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomGame.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomGame message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomGame
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomGame} ResPlayroomGame
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomGame.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.ResPlayroomGame(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Type = reader.int32();
break;
}
case 4: {
if (message.Items === $util.emptyObject)
message.Items = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = $root.tutorial.ItemInfo.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Items[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomGame message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomGame
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomGame} ResPlayroomGame
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomGame.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomGame message.
* @function verify
* @memberof tutorial.ResPlayroomGame
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomGame.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!$util.isObject(message.Items))
return "Items: object expected";
var key = Object.keys(message.Items);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Items: integer key{k:int32} expected";
{
var error = $root.tutorial.ItemInfo.verify(message.Items[key[i]]);
if (error)
return "Items." + error;
}
}
}
return null;
};
/**
* Creates a ResPlayroomGame message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomGame
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomGame} ResPlayroomGame
*/
ResPlayroomGame.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomGame)
return object;
var message = new $root.tutorial.ResPlayroomGame();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Items) {
if (typeof object.Items !== "object")
throw TypeError(".tutorial.ResPlayroomGame.Items: object expected");
message.Items = {};
for (var keys = Object.keys(object.Items), i = 0; i < keys.length; ++i) {
if (typeof object.Items[keys[i]] !== "object")
throw TypeError(".tutorial.ResPlayroomGame.Items: object expected");
message.Items[keys[i]] = $root.tutorial.ItemInfo.fromObject(object.Items[keys[i]]);
}
}
return message;
};
/**
* Creates a plain object from a ResPlayroomGame message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomGame
* @static
* @param {tutorial.ResPlayroomGame} message ResPlayroomGame
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomGame.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Items = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Type = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
var keys2;
if (message.Items && (keys2 = Object.keys(message.Items)).length) {
object.Items = {};
for (var j = 0; j < keys2.length; ++j)
object.Items[keys2[j]] = $root.tutorial.ItemInfo.toObject(message.Items[keys2[j]], options);
}
return object;
};
/**
* Converts this ResPlayroomGame to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomGame
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomGame.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomGame
* @function getTypeUrl
* @memberof tutorial.ResPlayroomGame
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomGame.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomGame";
};
return ResPlayroomGame;
})();
tutorial.ReqPlayroomInteract = (function() {
/**
* Properties of a ReqPlayroomInteract.
* @memberof tutorial
* @interface IReqPlayroomInteract
* @property {number|null} [Id] ReqPlayroomInteract Id
* @property {number|null} [Type] ReqPlayroomInteract Type
*/
/**
* Constructs a new ReqPlayroomInteract.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomInteract.
* @implements IReqPlayroomInteract
* @constructor
* @param {tutorial.IReqPlayroomInteract=} [properties] Properties to set
*/
function ReqPlayroomInteract(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]];
}
/**
* ReqPlayroomInteract Id.
* @member {number} Id
* @memberof tutorial.ReqPlayroomInteract
* @instance
*/
ReqPlayroomInteract.prototype.Id = 0;
/**
* ReqPlayroomInteract Type.
* @member {number} Type
* @memberof tutorial.ReqPlayroomInteract
* @instance
*/
ReqPlayroomInteract.prototype.Type = 0;
/**
* Creates a new ReqPlayroomInteract instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {tutorial.IReqPlayroomInteract=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomInteract} ReqPlayroomInteract instance
*/
ReqPlayroomInteract.create = function create(properties) {
return new ReqPlayroomInteract(properties);
};
/**
* Encodes the specified ReqPlayroomInteract message. Does not implicitly {@link tutorial.ReqPlayroomInteract.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {tutorial.IReqPlayroomInteract} message ReqPlayroomInteract message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomInteract.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Type);
return writer;
};
/**
* Encodes the specified ReqPlayroomInteract message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomInteract.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {tutorial.IReqPlayroomInteract} message ReqPlayroomInteract message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomInteract.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomInteract message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomInteract} ReqPlayroomInteract
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomInteract.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.ReqPlayroomInteract();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
case 2: {
message.Type = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomInteract message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomInteract} ReqPlayroomInteract
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomInteract.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomInteract message.
* @function verify
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomInteract.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))
return "Id: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
return null;
};
/**
* Creates a ReqPlayroomInteract message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomInteract} ReqPlayroomInteract
*/
ReqPlayroomInteract.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomInteract)
return object;
var message = new $root.tutorial.ReqPlayroomInteract();
if (object.Id != null)
message.Id = object.Id | 0;
if (object.Type != null)
message.Type = object.Type | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayroomInteract message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {tutorial.ReqPlayroomInteract} message ReqPlayroomInteract
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomInteract.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Id = 0;
object.Type = 0;
}
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
return object;
};
/**
* Converts this ReqPlayroomInteract to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomInteract
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomInteract.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomInteract
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomInteract
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomInteract.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomInteract";
};
return ReqPlayroomInteract;
})();
tutorial.ResPlayroomInteract = (function() {
/**
* Properties of a ResPlayroomInteract.
* @memberof tutorial
* @interface IResPlayroomInteract
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomInteract Code
* @property {string|null} [Msg] ResPlayroomInteract Msg
*/
/**
* Constructs a new ResPlayroomInteract.
* @memberof tutorial
* @classdesc Represents a ResPlayroomInteract.
* @implements IResPlayroomInteract
* @constructor
* @param {tutorial.IResPlayroomInteract=} [properties] Properties to set
*/
function ResPlayroomInteract(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]];
}
/**
* ResPlayroomInteract Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomInteract
* @instance
*/
ResPlayroomInteract.prototype.Code = 0;
/**
* ResPlayroomInteract Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomInteract
* @instance
*/
ResPlayroomInteract.prototype.Msg = "";
/**
* Creates a new ResPlayroomInteract instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {tutorial.IResPlayroomInteract=} [properties] Properties to set
* @returns {tutorial.ResPlayroomInteract} ResPlayroomInteract instance
*/
ResPlayroomInteract.create = function create(properties) {
return new ResPlayroomInteract(properties);
};
/**
* Encodes the specified ResPlayroomInteract message. Does not implicitly {@link tutorial.ResPlayroomInteract.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {tutorial.IResPlayroomInteract} message ResPlayroomInteract message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomInteract.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPlayroomInteract message, length delimited. Does not implicitly {@link tutorial.ResPlayroomInteract.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {tutorial.IResPlayroomInteract} message ResPlayroomInteract message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomInteract.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomInteract message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomInteract} ResPlayroomInteract
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomInteract.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.ResPlayroomInteract();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomInteract message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomInteract} ResPlayroomInteract
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomInteract.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomInteract message.
* @function verify
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomInteract.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPlayroomInteract message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomInteract} ResPlayroomInteract
*/
ResPlayroomInteract.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomInteract)
return object;
var message = new $root.tutorial.ResPlayroomInteract();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomInteract message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {tutorial.ResPlayroomInteract} message ResPlayroomInteract
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomInteract.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPlayroomInteract to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomInteract
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomInteract.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomInteract
* @function getTypeUrl
* @memberof tutorial.ResPlayroomInteract
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomInteract.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomInteract";
};
return ResPlayroomInteract;
})();
tutorial.ReqPlayroomSetRoom = (function() {
/**
* Properties of a ReqPlayroomSetRoom.
* @memberof tutorial
* @interface IReqPlayroomSetRoom
* @property {Object.<string,number>|null} [Playroom] ReqPlayroomSetRoom Playroom
*/
/**
* Constructs a new ReqPlayroomSetRoom.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomSetRoom.
* @implements IReqPlayroomSetRoom
* @constructor
* @param {tutorial.IReqPlayroomSetRoom=} [properties] Properties to set
*/
function ReqPlayroomSetRoom(properties) {
this.Playroom = {};
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]];
}
/**
* ReqPlayroomSetRoom Playroom.
* @member {Object.<string,number>} Playroom
* @memberof tutorial.ReqPlayroomSetRoom
* @instance
*/
ReqPlayroomSetRoom.prototype.Playroom = $util.emptyObject;
/**
* Creates a new ReqPlayroomSetRoom instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {tutorial.IReqPlayroomSetRoom=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomSetRoom} ReqPlayroomSetRoom instance
*/
ReqPlayroomSetRoom.create = function create(properties) {
return new ReqPlayroomSetRoom(properties);
};
/**
* Encodes the specified ReqPlayroomSetRoom message. Does not implicitly {@link tutorial.ReqPlayroomSetRoom.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {tutorial.IReqPlayroomSetRoom} message ReqPlayroomSetRoom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomSetRoom.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Playroom != null && Object.hasOwnProperty.call(message, "Playroom"))
for (var keys = Object.keys(message.Playroom), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Playroom[keys[i]]).ldelim();
return writer;
};
/**
* Encodes the specified ReqPlayroomSetRoom message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomSetRoom.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {tutorial.IReqPlayroomSetRoom} message ReqPlayroomSetRoom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomSetRoom.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomSetRoom message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomSetRoom} ReqPlayroomSetRoom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomSetRoom.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.ReqPlayroomSetRoom(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Playroom === $util.emptyObject)
message.Playroom = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Playroom[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomSetRoom message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomSetRoom} ReqPlayroomSetRoom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomSetRoom.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomSetRoom message.
* @function verify
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomSetRoom.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Playroom != null && message.hasOwnProperty("Playroom")) {
if (!$util.isObject(message.Playroom))
return "Playroom: object expected";
var key = Object.keys(message.Playroom);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Playroom: integer key{k:int32} expected";
if (!$util.isInteger(message.Playroom[key[i]]))
return "Playroom: integer{k:int32} expected";
}
}
return null;
};
/**
* Creates a ReqPlayroomSetRoom message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomSetRoom} ReqPlayroomSetRoom
*/
ReqPlayroomSetRoom.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomSetRoom)
return object;
var message = new $root.tutorial.ReqPlayroomSetRoom();
if (object.Playroom) {
if (typeof object.Playroom !== "object")
throw TypeError(".tutorial.ReqPlayroomSetRoom.Playroom: object expected");
message.Playroom = {};
for (var keys = Object.keys(object.Playroom), i = 0; i < keys.length; ++i)
message.Playroom[keys[i]] = object.Playroom[keys[i]] | 0;
}
return message;
};
/**
* Creates a plain object from a ReqPlayroomSetRoom message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {tutorial.ReqPlayroomSetRoom} message ReqPlayroomSetRoom
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomSetRoom.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Playroom = {};
var keys2;
if (message.Playroom && (keys2 = Object.keys(message.Playroom)).length) {
object.Playroom = {};
for (var j = 0; j < keys2.length; ++j)
object.Playroom[keys2[j]] = message.Playroom[keys2[j]];
}
return object;
};
/**
* Converts this ReqPlayroomSetRoom to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomSetRoom
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomSetRoom.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomSetRoom
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomSetRoom
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomSetRoom.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomSetRoom";
};
return ReqPlayroomSetRoom;
})();
tutorial.ResPlayroomSetRoom = (function() {
/**
* Properties of a ResPlayroomSetRoom.
* @memberof tutorial
* @interface IResPlayroomSetRoom
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomSetRoom Code
* @property {string|null} [Msg] ResPlayroomSetRoom Msg
*/
/**
* Constructs a new ResPlayroomSetRoom.
* @memberof tutorial
* @classdesc Represents a ResPlayroomSetRoom.
* @implements IResPlayroomSetRoom
* @constructor
* @param {tutorial.IResPlayroomSetRoom=} [properties] Properties to set
*/
function ResPlayroomSetRoom(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]];
}
/**
* ResPlayroomSetRoom Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomSetRoom
* @instance
*/
ResPlayroomSetRoom.prototype.Code = 0;
/**
* ResPlayroomSetRoom Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomSetRoom
* @instance
*/
ResPlayroomSetRoom.prototype.Msg = "";
/**
* Creates a new ResPlayroomSetRoom instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {tutorial.IResPlayroomSetRoom=} [properties] Properties to set
* @returns {tutorial.ResPlayroomSetRoom} ResPlayroomSetRoom instance
*/
ResPlayroomSetRoom.create = function create(properties) {
return new ResPlayroomSetRoom(properties);
};
/**
* Encodes the specified ResPlayroomSetRoom message. Does not implicitly {@link tutorial.ResPlayroomSetRoom.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {tutorial.IResPlayroomSetRoom} message ResPlayroomSetRoom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomSetRoom.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPlayroomSetRoom message, length delimited. Does not implicitly {@link tutorial.ResPlayroomSetRoom.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {tutorial.IResPlayroomSetRoom} message ResPlayroomSetRoom message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomSetRoom.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomSetRoom message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomSetRoom} ResPlayroomSetRoom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomSetRoom.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.ResPlayroomSetRoom();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomSetRoom message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomSetRoom} ResPlayroomSetRoom
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomSetRoom.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomSetRoom message.
* @function verify
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomSetRoom.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPlayroomSetRoom message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomSetRoom} ResPlayroomSetRoom
*/
ResPlayroomSetRoom.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomSetRoom)
return object;
var message = new $root.tutorial.ResPlayroomSetRoom();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomSetRoom message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {tutorial.ResPlayroomSetRoom} message ResPlayroomSetRoom
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomSetRoom.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPlayroomSetRoom to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomSetRoom
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomSetRoom.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomSetRoom
* @function getTypeUrl
* @memberof tutorial.ResPlayroomSetRoom
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomSetRoom.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomSetRoom";
};
return ResPlayroomSetRoom;
})();
tutorial.ReqPlayroomSelectReward = (function() {
/**
* Properties of a ReqPlayroomSelectReward.
* @memberof tutorial
* @interface IReqPlayroomSelectReward
* @property {number|null} [Id] ReqPlayroomSelectReward Id
*/
/**
* Constructs a new ReqPlayroomSelectReward.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomSelectReward.
* @implements IReqPlayroomSelectReward
* @constructor
* @param {tutorial.IReqPlayroomSelectReward=} [properties] Properties to set
*/
function ReqPlayroomSelectReward(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]];
}
/**
* ReqPlayroomSelectReward Id.
* @member {number} Id
* @memberof tutorial.ReqPlayroomSelectReward
* @instance
*/
ReqPlayroomSelectReward.prototype.Id = 0;
/**
* Creates a new ReqPlayroomSelectReward instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {tutorial.IReqPlayroomSelectReward=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomSelectReward} ReqPlayroomSelectReward instance
*/
ReqPlayroomSelectReward.create = function create(properties) {
return new ReqPlayroomSelectReward(properties);
};
/**
* Encodes the specified ReqPlayroomSelectReward message. Does not implicitly {@link tutorial.ReqPlayroomSelectReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {tutorial.IReqPlayroomSelectReward} message ReqPlayroomSelectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomSelectReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Id);
return writer;
};
/**
* Encodes the specified ReqPlayroomSelectReward message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomSelectReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {tutorial.IReqPlayroomSelectReward} message ReqPlayroomSelectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomSelectReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomSelectReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomSelectReward} ReqPlayroomSelectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomSelectReward.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.ReqPlayroomSelectReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomSelectReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomSelectReward} ReqPlayroomSelectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomSelectReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomSelectReward message.
* @function verify
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomSelectReward.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))
return "Id: integer expected";
return null;
};
/**
* Creates a ReqPlayroomSelectReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomSelectReward} ReqPlayroomSelectReward
*/
ReqPlayroomSelectReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomSelectReward)
return object;
var message = new $root.tutorial.ReqPlayroomSelectReward();
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayroomSelectReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {tutorial.ReqPlayroomSelectReward} message ReqPlayroomSelectReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomSelectReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Id = 0;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ReqPlayroomSelectReward to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomSelectReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomSelectReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomSelectReward
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomSelectReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomSelectReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomSelectReward";
};
return ReqPlayroomSelectReward;
})();
tutorial.ResPlayroomSelectReward = (function() {
/**
* Properties of a ResPlayroomSelectReward.
* @memberof tutorial
* @interface IResPlayroomSelectReward
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomSelectReward Code
* @property {string|null} [Msg] ResPlayroomSelectReward Msg
*/
/**
* Constructs a new ResPlayroomSelectReward.
* @memberof tutorial
* @classdesc Represents a ResPlayroomSelectReward.
* @implements IResPlayroomSelectReward
* @constructor
* @param {tutorial.IResPlayroomSelectReward=} [properties] Properties to set
*/
function ResPlayroomSelectReward(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]];
}
/**
* ResPlayroomSelectReward Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomSelectReward
* @instance
*/
ResPlayroomSelectReward.prototype.Code = 0;
/**
* ResPlayroomSelectReward Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomSelectReward
* @instance
*/
ResPlayroomSelectReward.prototype.Msg = "";
/**
* Creates a new ResPlayroomSelectReward instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {tutorial.IResPlayroomSelectReward=} [properties] Properties to set
* @returns {tutorial.ResPlayroomSelectReward} ResPlayroomSelectReward instance
*/
ResPlayroomSelectReward.create = function create(properties) {
return new ResPlayroomSelectReward(properties);
};
/**
* Encodes the specified ResPlayroomSelectReward message. Does not implicitly {@link tutorial.ResPlayroomSelectReward.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {tutorial.IResPlayroomSelectReward} message ResPlayroomSelectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomSelectReward.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPlayroomSelectReward message, length delimited. Does not implicitly {@link tutorial.ResPlayroomSelectReward.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {tutorial.IResPlayroomSelectReward} message ResPlayroomSelectReward message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomSelectReward.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomSelectReward message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomSelectReward} ResPlayroomSelectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomSelectReward.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.ResPlayroomSelectReward();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomSelectReward message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomSelectReward} ResPlayroomSelectReward
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomSelectReward.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomSelectReward message.
* @function verify
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomSelectReward.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPlayroomSelectReward message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomSelectReward} ResPlayroomSelectReward
*/
ResPlayroomSelectReward.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomSelectReward)
return object;
var message = new $root.tutorial.ResPlayroomSelectReward();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomSelectReward message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {tutorial.ResPlayroomSelectReward} message ResPlayroomSelectReward
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomSelectReward.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPlayroomSelectReward to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomSelectReward
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomSelectReward.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomSelectReward
* @function getTypeUrl
* @memberof tutorial.ResPlayroomSelectReward
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomSelectReward.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomSelectReward";
};
return ResPlayroomSelectReward;
})();
tutorial.ReqPlayroomLose = (function() {
/**
* Properties of a ReqPlayroomLose.
* @memberof tutorial
* @interface IReqPlayroomLose
*/
/**
* Constructs a new ReqPlayroomLose.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomLose.
* @implements IReqPlayroomLose
* @constructor
* @param {tutorial.IReqPlayroomLose=} [properties] Properties to set
*/
function ReqPlayroomLose(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]];
}
/**
* Creates a new ReqPlayroomLose instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {tutorial.IReqPlayroomLose=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomLose} ReqPlayroomLose instance
*/
ReqPlayroomLose.create = function create(properties) {
return new ReqPlayroomLose(properties);
};
/**
* Encodes the specified ReqPlayroomLose message. Does not implicitly {@link tutorial.ReqPlayroomLose.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {tutorial.IReqPlayroomLose} message ReqPlayroomLose message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomLose.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqPlayroomLose message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomLose.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {tutorial.IReqPlayroomLose} message ReqPlayroomLose message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomLose.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomLose message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomLose} ReqPlayroomLose
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomLose.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.ReqPlayroomLose();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomLose message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomLose} ReqPlayroomLose
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomLose.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomLose message.
* @function verify
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomLose.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqPlayroomLose message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomLose} ReqPlayroomLose
*/
ReqPlayroomLose.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomLose)
return object;
return new $root.tutorial.ReqPlayroomLose();
};
/**
* Creates a plain object from a ReqPlayroomLose message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {tutorial.ReqPlayroomLose} message ReqPlayroomLose
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomLose.toObject = function toObject() {
return {};
};
/**
* Converts this ReqPlayroomLose to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomLose
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomLose.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomLose
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomLose
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomLose.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomLose";
};
return ReqPlayroomLose;
})();
tutorial.ResPlayroomLose = (function() {
/**
* Properties of a ResPlayroomLose.
* @memberof tutorial
* @interface IResPlayroomLose
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomLose Code
* @property {string|null} [Msg] ResPlayroomLose Msg
*/
/**
* Constructs a new ResPlayroomLose.
* @memberof tutorial
* @classdesc Represents a ResPlayroomLose.
* @implements IResPlayroomLose
* @constructor
* @param {tutorial.IResPlayroomLose=} [properties] Properties to set
*/
function ResPlayroomLose(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]];
}
/**
* ResPlayroomLose Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomLose
* @instance
*/
ResPlayroomLose.prototype.Code = 0;
/**
* ResPlayroomLose Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomLose
* @instance
*/
ResPlayroomLose.prototype.Msg = "";
/**
* Creates a new ResPlayroomLose instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomLose
* @static
* @param {tutorial.IResPlayroomLose=} [properties] Properties to set
* @returns {tutorial.ResPlayroomLose} ResPlayroomLose instance
*/
ResPlayroomLose.create = function create(properties) {
return new ResPlayroomLose(properties);
};
/**
* Encodes the specified ResPlayroomLose message. Does not implicitly {@link tutorial.ResPlayroomLose.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomLose
* @static
* @param {tutorial.IResPlayroomLose} message ResPlayroomLose message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomLose.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPlayroomLose message, length delimited. Does not implicitly {@link tutorial.ResPlayroomLose.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomLose
* @static
* @param {tutorial.IResPlayroomLose} message ResPlayroomLose message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomLose.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomLose message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomLose
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomLose} ResPlayroomLose
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomLose.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.ResPlayroomLose();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomLose message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomLose
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomLose} ResPlayroomLose
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomLose.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomLose message.
* @function verify
* @memberof tutorial.ResPlayroomLose
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomLose.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPlayroomLose message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomLose
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomLose} ResPlayroomLose
*/
ResPlayroomLose.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomLose)
return object;
var message = new $root.tutorial.ResPlayroomLose();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomLose message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomLose
* @static
* @param {tutorial.ResPlayroomLose} message ResPlayroomLose
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomLose.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPlayroomLose to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomLose
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomLose.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomLose
* @function getTypeUrl
* @memberof tutorial.ResPlayroomLose
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomLose.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomLose";
};
return ResPlayroomLose;
})();
tutorial.ReqPlayroomWork = (function() {
/**
* Properties of a ReqPlayroomWork.
* @memberof tutorial
* @interface IReqPlayroomWork
*/
/**
* Constructs a new ReqPlayroomWork.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomWork.
* @implements IReqPlayroomWork
* @constructor
* @param {tutorial.IReqPlayroomWork=} [properties] Properties to set
*/
function ReqPlayroomWork(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]];
}
/**
* Creates a new ReqPlayroomWork instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {tutorial.IReqPlayroomWork=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomWork} ReqPlayroomWork instance
*/
ReqPlayroomWork.create = function create(properties) {
return new ReqPlayroomWork(properties);
};
/**
* Encodes the specified ReqPlayroomWork message. Does not implicitly {@link tutorial.ReqPlayroomWork.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {tutorial.IReqPlayroomWork} message ReqPlayroomWork message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomWork.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqPlayroomWork message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomWork.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {tutorial.IReqPlayroomWork} message ReqPlayroomWork message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomWork.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomWork message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomWork} ReqPlayroomWork
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomWork.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.ReqPlayroomWork();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomWork message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomWork} ReqPlayroomWork
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomWork.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomWork message.
* @function verify
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomWork.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqPlayroomWork message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomWork} ReqPlayroomWork
*/
ReqPlayroomWork.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomWork)
return object;
return new $root.tutorial.ReqPlayroomWork();
};
/**
* Creates a plain object from a ReqPlayroomWork message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {tutorial.ReqPlayroomWork} message ReqPlayroomWork
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomWork.toObject = function toObject() {
return {};
};
/**
* Converts this ReqPlayroomWork to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomWork
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomWork.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomWork
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomWork
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomWork.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomWork";
};
return ReqPlayroomWork;
})();
tutorial.ResPlayroomWork = (function() {
/**
* Properties of a ResPlayroomWork.
* @memberof tutorial
* @interface IResPlayroomWork
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomWork Code
* @property {string|null} [Msg] ResPlayroomWork Msg
*/
/**
* Constructs a new ResPlayroomWork.
* @memberof tutorial
* @classdesc Represents a ResPlayroomWork.
* @implements IResPlayroomWork
* @constructor
* @param {tutorial.IResPlayroomWork=} [properties] Properties to set
*/
function ResPlayroomWork(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]];
}
/**
* ResPlayroomWork Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomWork
* @instance
*/
ResPlayroomWork.prototype.Code = 0;
/**
* ResPlayroomWork Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomWork
* @instance
*/
ResPlayroomWork.prototype.Msg = "";
/**
* Creates a new ResPlayroomWork instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomWork
* @static
* @param {tutorial.IResPlayroomWork=} [properties] Properties to set
* @returns {tutorial.ResPlayroomWork} ResPlayroomWork instance
*/
ResPlayroomWork.create = function create(properties) {
return new ResPlayroomWork(properties);
};
/**
* Encodes the specified ResPlayroomWork message. Does not implicitly {@link tutorial.ResPlayroomWork.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomWork
* @static
* @param {tutorial.IResPlayroomWork} message ResPlayroomWork message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomWork.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPlayroomWork message, length delimited. Does not implicitly {@link tutorial.ResPlayroomWork.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomWork
* @static
* @param {tutorial.IResPlayroomWork} message ResPlayroomWork message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomWork.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomWork message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomWork
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomWork} ResPlayroomWork
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomWork.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.ResPlayroomWork();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomWork message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomWork
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomWork} ResPlayroomWork
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomWork.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomWork message.
* @function verify
* @memberof tutorial.ResPlayroomWork
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomWork.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPlayroomWork message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomWork
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomWork} ResPlayroomWork
*/
ResPlayroomWork.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomWork)
return object;
var message = new $root.tutorial.ResPlayroomWork();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomWork message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomWork
* @static
* @param {tutorial.ResPlayroomWork} message ResPlayroomWork
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomWork.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPlayroomWork to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomWork
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomWork.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomWork
* @function getTypeUrl
* @memberof tutorial.ResPlayroomWork
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomWork.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomWork";
};
return ResPlayroomWork;
})();
tutorial.ReqPlayroomRest = (function() {
/**
* Properties of a ReqPlayroomRest.
* @memberof tutorial
* @interface IReqPlayroomRest
*/
/**
* Constructs a new ReqPlayroomRest.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomRest.
* @implements IReqPlayroomRest
* @constructor
* @param {tutorial.IReqPlayroomRest=} [properties] Properties to set
*/
function ReqPlayroomRest(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]];
}
/**
* Creates a new ReqPlayroomRest instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {tutorial.IReqPlayroomRest=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomRest} ReqPlayroomRest instance
*/
ReqPlayroomRest.create = function create(properties) {
return new ReqPlayroomRest(properties);
};
/**
* Encodes the specified ReqPlayroomRest message. Does not implicitly {@link tutorial.ReqPlayroomRest.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {tutorial.IReqPlayroomRest} message ReqPlayroomRest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomRest.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqPlayroomRest message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomRest.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {tutorial.IReqPlayroomRest} message ReqPlayroomRest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomRest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomRest message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomRest} ReqPlayroomRest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomRest.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.ReqPlayroomRest();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomRest message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomRest} ReqPlayroomRest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomRest.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomRest message.
* @function verify
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomRest.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqPlayroomRest message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomRest} ReqPlayroomRest
*/
ReqPlayroomRest.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomRest)
return object;
return new $root.tutorial.ReqPlayroomRest();
};
/**
* Creates a plain object from a ReqPlayroomRest message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {tutorial.ReqPlayroomRest} message ReqPlayroomRest
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomRest.toObject = function toObject() {
return {};
};
/**
* Converts this ReqPlayroomRest to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomRest
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomRest.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomRest
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomRest
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomRest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomRest";
};
return ReqPlayroomRest;
})();
tutorial.ResPlayroomRest = (function() {
/**
* Properties of a ResPlayroomRest.
* @memberof tutorial
* @interface IResPlayroomRest
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomRest Code
* @property {string|null} [Msg] ResPlayroomRest Msg
*/
/**
* Constructs a new ResPlayroomRest.
* @memberof tutorial
* @classdesc Represents a ResPlayroomRest.
* @implements IResPlayroomRest
* @constructor
* @param {tutorial.IResPlayroomRest=} [properties] Properties to set
*/
function ResPlayroomRest(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]];
}
/**
* ResPlayroomRest Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomRest
* @instance
*/
ResPlayroomRest.prototype.Code = 0;
/**
* ResPlayroomRest Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomRest
* @instance
*/
ResPlayroomRest.prototype.Msg = "";
/**
* Creates a new ResPlayroomRest instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomRest
* @static
* @param {tutorial.IResPlayroomRest=} [properties] Properties to set
* @returns {tutorial.ResPlayroomRest} ResPlayroomRest instance
*/
ResPlayroomRest.create = function create(properties) {
return new ResPlayroomRest(properties);
};
/**
* Encodes the specified ResPlayroomRest message. Does not implicitly {@link tutorial.ResPlayroomRest.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomRest
* @static
* @param {tutorial.IResPlayroomRest} message ResPlayroomRest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomRest.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPlayroomRest message, length delimited. Does not implicitly {@link tutorial.ResPlayroomRest.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomRest
* @static
* @param {tutorial.IResPlayroomRest} message ResPlayroomRest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomRest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomRest message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomRest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomRest} ResPlayroomRest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomRest.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.ResPlayroomRest();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomRest message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomRest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomRest} ResPlayroomRest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomRest.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomRest message.
* @function verify
* @memberof tutorial.ResPlayroomRest
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomRest.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPlayroomRest message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomRest
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomRest} ResPlayroomRest
*/
ResPlayroomRest.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomRest)
return object;
var message = new $root.tutorial.ResPlayroomRest();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomRest message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomRest
* @static
* @param {tutorial.ResPlayroomRest} message ResPlayroomRest
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomRest.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPlayroomRest to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomRest
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomRest.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomRest
* @function getTypeUrl
* @memberof tutorial.ResPlayroomRest
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomRest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomRest";
};
return ResPlayroomRest;
})();
tutorial.ReqPlayroomDraw = (function() {
/**
* Properties of a ReqPlayroomDraw.
* @memberof tutorial
* @interface IReqPlayroomDraw
*/
/**
* Constructs a new ReqPlayroomDraw.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomDraw.
* @implements IReqPlayroomDraw
* @constructor
* @param {tutorial.IReqPlayroomDraw=} [properties] Properties to set
*/
function ReqPlayroomDraw(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]];
}
/**
* Creates a new ReqPlayroomDraw instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {tutorial.IReqPlayroomDraw=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomDraw} ReqPlayroomDraw instance
*/
ReqPlayroomDraw.create = function create(properties) {
return new ReqPlayroomDraw(properties);
};
/**
* Encodes the specified ReqPlayroomDraw message. Does not implicitly {@link tutorial.ReqPlayroomDraw.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {tutorial.IReqPlayroomDraw} message ReqPlayroomDraw message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomDraw.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqPlayroomDraw message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomDraw.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {tutorial.IReqPlayroomDraw} message ReqPlayroomDraw message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomDraw.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomDraw message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomDraw} ReqPlayroomDraw
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomDraw.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.ReqPlayroomDraw();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomDraw message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomDraw} ReqPlayroomDraw
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomDraw.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomDraw message.
* @function verify
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomDraw.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqPlayroomDraw message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomDraw} ReqPlayroomDraw
*/
ReqPlayroomDraw.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomDraw)
return object;
return new $root.tutorial.ReqPlayroomDraw();
};
/**
* Creates a plain object from a ReqPlayroomDraw message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {tutorial.ReqPlayroomDraw} message ReqPlayroomDraw
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomDraw.toObject = function toObject() {
return {};
};
/**
* Converts this ReqPlayroomDraw to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomDraw
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomDraw.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomDraw
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomDraw
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomDraw.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomDraw";
};
return ReqPlayroomDraw;
})();
tutorial.ResPlayroomDraw = (function() {
/**
* Properties of a ResPlayroomDraw.
* @memberof tutorial
* @interface IResPlayroomDraw
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomDraw Code
* @property {string|null} [Msg] ResPlayroomDraw Msg
* @property {number|null} [Id] ResPlayroomDraw Id
*/
/**
* Constructs a new ResPlayroomDraw.
* @memberof tutorial
* @classdesc Represents a ResPlayroomDraw.
* @implements IResPlayroomDraw
* @constructor
* @param {tutorial.IResPlayroomDraw=} [properties] Properties to set
*/
function ResPlayroomDraw(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]];
}
/**
* ResPlayroomDraw Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomDraw
* @instance
*/
ResPlayroomDraw.prototype.Code = 0;
/**
* ResPlayroomDraw Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomDraw
* @instance
*/
ResPlayroomDraw.prototype.Msg = "";
/**
* ResPlayroomDraw Id.
* @member {number} Id
* @memberof tutorial.ResPlayroomDraw
* @instance
*/
ResPlayroomDraw.prototype.Id = 0;
/**
* Creates a new ResPlayroomDraw instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {tutorial.IResPlayroomDraw=} [properties] Properties to set
* @returns {tutorial.ResPlayroomDraw} ResPlayroomDraw instance
*/
ResPlayroomDraw.create = function create(properties) {
return new ResPlayroomDraw(properties);
};
/**
* Encodes the specified ResPlayroomDraw message. Does not implicitly {@link tutorial.ResPlayroomDraw.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {tutorial.IResPlayroomDraw} message ResPlayroomDraw message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomDraw.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Id != null && Object.hasOwnProperty.call(message, "Id"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Id);
return writer;
};
/**
* Encodes the specified ResPlayroomDraw message, length delimited. Does not implicitly {@link tutorial.ResPlayroomDraw.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {tutorial.IResPlayroomDraw} message ResPlayroomDraw message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomDraw.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomDraw message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomDraw} ResPlayroomDraw
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomDraw.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.ResPlayroomDraw();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Id = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomDraw message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomDraw} ResPlayroomDraw
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomDraw.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomDraw message.
* @function verify
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomDraw.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Id != null && message.hasOwnProperty("Id"))
if (!$util.isInteger(message.Id))
return "Id: integer expected";
return null;
};
/**
* Creates a ResPlayroomDraw message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomDraw} ResPlayroomDraw
*/
ResPlayroomDraw.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomDraw)
return object;
var message = new $root.tutorial.ResPlayroomDraw();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Id != null)
message.Id = object.Id | 0;
return message;
};
/**
* Creates a plain object from a ResPlayroomDraw message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {tutorial.ResPlayroomDraw} message ResPlayroomDraw
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomDraw.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Id = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Id != null && message.hasOwnProperty("Id"))
object.Id = message.Id;
return object;
};
/**
* Converts this ResPlayroomDraw to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomDraw
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomDraw.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomDraw
* @function getTypeUrl
* @memberof tutorial.ResPlayroomDraw
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomDraw.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomDraw";
};
return ResPlayroomDraw;
})();
tutorial.ReqPlayroomChip = (function() {
/**
* Properties of a ReqPlayroomChip.
* @memberof tutorial
* @interface IReqPlayroomChip
* @property {number|null} [Num] ReqPlayroomChip Num
*/
/**
* Constructs a new ReqPlayroomChip.
* @memberof tutorial
* @classdesc Represents a ReqPlayroomChip.
* @implements IReqPlayroomChip
* @constructor
* @param {tutorial.IReqPlayroomChip=} [properties] Properties to set
*/
function ReqPlayroomChip(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]];
}
/**
* ReqPlayroomChip Num.
* @member {number} Num
* @memberof tutorial.ReqPlayroomChip
* @instance
*/
ReqPlayroomChip.prototype.Num = 0;
/**
* Creates a new ReqPlayroomChip instance using the specified properties.
* @function create
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {tutorial.IReqPlayroomChip=} [properties] Properties to set
* @returns {tutorial.ReqPlayroomChip} ReqPlayroomChip instance
*/
ReqPlayroomChip.create = function create(properties) {
return new ReqPlayroomChip(properties);
};
/**
* Encodes the specified ReqPlayroomChip message. Does not implicitly {@link tutorial.ReqPlayroomChip.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {tutorial.IReqPlayroomChip} message ReqPlayroomChip message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomChip.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Num != null && Object.hasOwnProperty.call(message, "Num"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Num);
return writer;
};
/**
* Encodes the specified ReqPlayroomChip message, length delimited. Does not implicitly {@link tutorial.ReqPlayroomChip.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {tutorial.IReqPlayroomChip} message ReqPlayroomChip message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqPlayroomChip.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqPlayroomChip message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqPlayroomChip} ReqPlayroomChip
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomChip.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.ReqPlayroomChip();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Num = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqPlayroomChip message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqPlayroomChip} ReqPlayroomChip
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqPlayroomChip.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqPlayroomChip message.
* @function verify
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqPlayroomChip.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Num != null && message.hasOwnProperty("Num"))
if (!$util.isInteger(message.Num))
return "Num: integer expected";
return null;
};
/**
* Creates a ReqPlayroomChip message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqPlayroomChip} ReqPlayroomChip
*/
ReqPlayroomChip.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqPlayroomChip)
return object;
var message = new $root.tutorial.ReqPlayroomChip();
if (object.Num != null)
message.Num = object.Num | 0;
return message;
};
/**
* Creates a plain object from a ReqPlayroomChip message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {tutorial.ReqPlayroomChip} message ReqPlayroomChip
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqPlayroomChip.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Num = 0;
if (message.Num != null && message.hasOwnProperty("Num"))
object.Num = message.Num;
return object;
};
/**
* Converts this ReqPlayroomChip to JSON.
* @function toJSON
* @memberof tutorial.ReqPlayroomChip
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqPlayroomChip.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqPlayroomChip
* @function getTypeUrl
* @memberof tutorial.ReqPlayroomChip
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqPlayroomChip.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqPlayroomChip";
};
return ReqPlayroomChip;
})();
tutorial.ResPlayroomChip = (function() {
/**
* Properties of a ResPlayroomChip.
* @memberof tutorial
* @interface IResPlayroomChip
* @property {tutorial.RES_CODE|null} [Code] ResPlayroomChip Code
* @property {string|null} [Msg] ResPlayroomChip Msg
*/
/**
* Constructs a new ResPlayroomChip.
* @memberof tutorial
* @classdesc Represents a ResPlayroomChip.
* @implements IResPlayroomChip
* @constructor
* @param {tutorial.IResPlayroomChip=} [properties] Properties to set
*/
function ResPlayroomChip(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]];
}
/**
* ResPlayroomChip Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResPlayroomChip
* @instance
*/
ResPlayroomChip.prototype.Code = 0;
/**
* ResPlayroomChip Msg.
* @member {string} Msg
* @memberof tutorial.ResPlayroomChip
* @instance
*/
ResPlayroomChip.prototype.Msg = "";
/**
* Creates a new ResPlayroomChip instance using the specified properties.
* @function create
* @memberof tutorial.ResPlayroomChip
* @static
* @param {tutorial.IResPlayroomChip=} [properties] Properties to set
* @returns {tutorial.ResPlayroomChip} ResPlayroomChip instance
*/
ResPlayroomChip.create = function create(properties) {
return new ResPlayroomChip(properties);
};
/**
* Encodes the specified ResPlayroomChip message. Does not implicitly {@link tutorial.ResPlayroomChip.verify|verify} messages.
* @function encode
* @memberof tutorial.ResPlayroomChip
* @static
* @param {tutorial.IResPlayroomChip} message ResPlayroomChip message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomChip.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResPlayroomChip message, length delimited. Does not implicitly {@link tutorial.ResPlayroomChip.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResPlayroomChip
* @static
* @param {tutorial.IResPlayroomChip} message ResPlayroomChip message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResPlayroomChip.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResPlayroomChip message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResPlayroomChip
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResPlayroomChip} ResPlayroomChip
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomChip.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.ResPlayroomChip();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResPlayroomChip message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResPlayroomChip
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResPlayroomChip} ResPlayroomChip
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResPlayroomChip.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResPlayroomChip message.
* @function verify
* @memberof tutorial.ResPlayroomChip
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResPlayroomChip.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResPlayroomChip message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResPlayroomChip
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResPlayroomChip} ResPlayroomChip
*/
ResPlayroomChip.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResPlayroomChip)
return object;
var message = new $root.tutorial.ResPlayroomChip();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResPlayroomChip message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResPlayroomChip
* @static
* @param {tutorial.ResPlayroomChip} message ResPlayroomChip
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResPlayroomChip.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResPlayroomChip to JSON.
* @function toJSON
* @memberof tutorial.ResPlayroomChip
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResPlayroomChip.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResPlayroomChip
* @function getTypeUrl
* @memberof tutorial.ResPlayroomChip
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResPlayroomChip.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResPlayroomChip";
};
return ResPlayroomChip;
})();
tutorial.ReqFriendTreasure = (function() {
/**
* Properties of a ReqFriendTreasure.
* @memberof tutorial
* @interface IReqFriendTreasure
*/
/**
* Constructs a new ReqFriendTreasure.
* @memberof tutorial
* @classdesc Represents a ReqFriendTreasure.
* @implements IReqFriendTreasure
* @constructor
* @param {tutorial.IReqFriendTreasure=} [properties] Properties to set
*/
function ReqFriendTreasure(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]];
}
/**
* Creates a new ReqFriendTreasure instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {tutorial.IReqFriendTreasure=} [properties] Properties to set
* @returns {tutorial.ReqFriendTreasure} ReqFriendTreasure instance
*/
ReqFriendTreasure.create = function create(properties) {
return new ReqFriendTreasure(properties);
};
/**
* Encodes the specified ReqFriendTreasure message. Does not implicitly {@link tutorial.ReqFriendTreasure.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {tutorial.IReqFriendTreasure} message ReqFriendTreasure message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendTreasure.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFriendTreasure message, length delimited. Does not implicitly {@link tutorial.ReqFriendTreasure.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {tutorial.IReqFriendTreasure} message ReqFriendTreasure message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendTreasure.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendTreasure message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendTreasure} ReqFriendTreasure
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendTreasure.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.ReqFriendTreasure();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendTreasure message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendTreasure} ReqFriendTreasure
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendTreasure.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendTreasure message.
* @function verify
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendTreasure.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFriendTreasure message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendTreasure} ReqFriendTreasure
*/
ReqFriendTreasure.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendTreasure)
return object;
return new $root.tutorial.ReqFriendTreasure();
};
/**
* Creates a plain object from a ReqFriendTreasure message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {tutorial.ReqFriendTreasure} message ReqFriendTreasure
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendTreasure.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFriendTreasure to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendTreasure
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendTreasure.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendTreasure
* @function getTypeUrl
* @memberof tutorial.ReqFriendTreasure
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendTreasure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendTreasure";
};
return ReqFriendTreasure;
})();
tutorial.ResFriendTreasure = (function() {
/**
* Properties of a ResFriendTreasure.
* @memberof tutorial
* @interface IResFriendTreasure
* @property {number|null} [Status] ResFriendTreasure Status
* @property {number|null} [Star] ResFriendTreasure Star
* @property {number|null} [Shift] ResFriendTreasure Shift
* @property {Array.<tutorial.ITreasureInfo>|null} [List] ResFriendTreasure List
*/
/**
* Constructs a new ResFriendTreasure.
* @memberof tutorial
* @classdesc Represents a ResFriendTreasure.
* @implements IResFriendTreasure
* @constructor
* @param {tutorial.IResFriendTreasure=} [properties] Properties to set
*/
function ResFriendTreasure(properties) {
this.List = [];
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]];
}
/**
* ResFriendTreasure Status.
* @member {number} Status
* @memberof tutorial.ResFriendTreasure
* @instance
*/
ResFriendTreasure.prototype.Status = 0;
/**
* ResFriendTreasure Star.
* @member {number} Star
* @memberof tutorial.ResFriendTreasure
* @instance
*/
ResFriendTreasure.prototype.Star = 0;
/**
* ResFriendTreasure Shift.
* @member {number} Shift
* @memberof tutorial.ResFriendTreasure
* @instance
*/
ResFriendTreasure.prototype.Shift = 0;
/**
* ResFriendTreasure List.
* @member {Array.<tutorial.ITreasureInfo>} List
* @memberof tutorial.ResFriendTreasure
* @instance
*/
ResFriendTreasure.prototype.List = $util.emptyArray;
/**
* Creates a new ResFriendTreasure instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendTreasure
* @static
* @param {tutorial.IResFriendTreasure=} [properties] Properties to set
* @returns {tutorial.ResFriendTreasure} ResFriendTreasure instance
*/
ResFriendTreasure.create = function create(properties) {
return new ResFriendTreasure(properties);
};
/**
* Encodes the specified ResFriendTreasure message. Does not implicitly {@link tutorial.ResFriendTreasure.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendTreasure
* @static
* @param {tutorial.IResFriendTreasure} message ResFriendTreasure message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTreasure.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Status != null && Object.hasOwnProperty.call(message, "Status"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Status);
if (message.Star != null && Object.hasOwnProperty.call(message, "Star"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Star);
if (message.Shift != null && Object.hasOwnProperty.call(message, "Shift"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Shift);
if (message.List != null && message.List.length)
for (var i = 0; i < message.List.length; ++i)
$root.tutorial.TreasureInfo.encode(message.List[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ResFriendTreasure message, length delimited. Does not implicitly {@link tutorial.ResFriendTreasure.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendTreasure
* @static
* @param {tutorial.IResFriendTreasure} message ResFriendTreasure message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTreasure.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendTreasure message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendTreasure
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendTreasure} ResFriendTreasure
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTreasure.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.ResFriendTreasure();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Status = reader.int32();
break;
}
case 2: {
message.Star = reader.int32();
break;
}
case 3: {
message.Shift = reader.int32();
break;
}
case 4: {
if (!(message.List && message.List.length))
message.List = [];
message.List.push($root.tutorial.TreasureInfo.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendTreasure message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendTreasure
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendTreasure} ResFriendTreasure
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTreasure.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendTreasure message.
* @function verify
* @memberof tutorial.ResFriendTreasure
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendTreasure.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Status != null && message.hasOwnProperty("Status"))
if (!$util.isInteger(message.Status))
return "Status: integer expected";
if (message.Star != null && message.hasOwnProperty("Star"))
if (!$util.isInteger(message.Star))
return "Star: integer expected";
if (message.Shift != null && message.hasOwnProperty("Shift"))
if (!$util.isInteger(message.Shift))
return "Shift: integer expected";
if (message.List != null && message.hasOwnProperty("List")) {
if (!Array.isArray(message.List))
return "List: array expected";
for (var i = 0; i < message.List.length; ++i) {
var error = $root.tutorial.TreasureInfo.verify(message.List[i]);
if (error)
return "List." + error;
}
}
return null;
};
/**
* Creates a ResFriendTreasure message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendTreasure
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendTreasure} ResFriendTreasure
*/
ResFriendTreasure.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendTreasure)
return object;
var message = new $root.tutorial.ResFriendTreasure();
if (object.Status != null)
message.Status = object.Status | 0;
if (object.Star != null)
message.Star = object.Star | 0;
if (object.Shift != null)
message.Shift = object.Shift | 0;
if (object.List) {
if (!Array.isArray(object.List))
throw TypeError(".tutorial.ResFriendTreasure.List: array expected");
message.List = [];
for (var i = 0; i < object.List.length; ++i) {
if (typeof object.List[i] !== "object")
throw TypeError(".tutorial.ResFriendTreasure.List: object expected");
message.List[i] = $root.tutorial.TreasureInfo.fromObject(object.List[i]);
}
}
return message;
};
/**
* Creates a plain object from a ResFriendTreasure message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendTreasure
* @static
* @param {tutorial.ResFriendTreasure} message ResFriendTreasure
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendTreasure.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.List = [];
if (options.defaults) {
object.Status = 0;
object.Star = 0;
object.Shift = 0;
}
if (message.Status != null && message.hasOwnProperty("Status"))
object.Status = message.Status;
if (message.Star != null && message.hasOwnProperty("Star"))
object.Star = message.Star;
if (message.Shift != null && message.hasOwnProperty("Shift"))
object.Shift = message.Shift;
if (message.List && message.List.length) {
object.List = [];
for (var j = 0; j < message.List.length; ++j)
object.List[j] = $root.tutorial.TreasureInfo.toObject(message.List[j], options);
}
return object;
};
/**
* Converts this ResFriendTreasure to JSON.
* @function toJSON
* @memberof tutorial.ResFriendTreasure
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendTreasure.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendTreasure
* @function getTypeUrl
* @memberof tutorial.ResFriendTreasure
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendTreasure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendTreasure";
};
return ResFriendTreasure;
})();
tutorial.TreasureInfo = (function() {
/**
* Properties of a TreasureInfo.
* @memberof tutorial
* @interface ITreasureInfo
* @property {number|null} [Pos] TreasureInfo Pos
* @property {number|null} [Type] TreasureInfo Type
* @property {number|null} [Face] TreasureInfo Face
* @property {number|null} [Avatar] TreasureInfo Avatar
*/
/**
* Constructs a new TreasureInfo.
* @memberof tutorial
* @classdesc Represents a TreasureInfo.
* @implements ITreasureInfo
* @constructor
* @param {tutorial.ITreasureInfo=} [properties] Properties to set
*/
function TreasureInfo(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]];
}
/**
* TreasureInfo Pos.
* @member {number} Pos
* @memberof tutorial.TreasureInfo
* @instance
*/
TreasureInfo.prototype.Pos = 0;
/**
* TreasureInfo Type.
* @member {number} Type
* @memberof tutorial.TreasureInfo
* @instance
*/
TreasureInfo.prototype.Type = 0;
/**
* TreasureInfo Face.
* @member {number} Face
* @memberof tutorial.TreasureInfo
* @instance
*/
TreasureInfo.prototype.Face = 0;
/**
* TreasureInfo Avatar.
* @member {number} Avatar
* @memberof tutorial.TreasureInfo
* @instance
*/
TreasureInfo.prototype.Avatar = 0;
/**
* Creates a new TreasureInfo instance using the specified properties.
* @function create
* @memberof tutorial.TreasureInfo
* @static
* @param {tutorial.ITreasureInfo=} [properties] Properties to set
* @returns {tutorial.TreasureInfo} TreasureInfo instance
*/
TreasureInfo.create = function create(properties) {
return new TreasureInfo(properties);
};
/**
* Encodes the specified TreasureInfo message. Does not implicitly {@link tutorial.TreasureInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.TreasureInfo
* @static
* @param {tutorial.ITreasureInfo} message TreasureInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
TreasureInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Pos != null && Object.hasOwnProperty.call(message, "Pos"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Pos);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Type);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Avatar);
return writer;
};
/**
* Encodes the specified TreasureInfo message, length delimited. Does not implicitly {@link tutorial.TreasureInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.TreasureInfo
* @static
* @param {tutorial.ITreasureInfo} message TreasureInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
TreasureInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a TreasureInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.TreasureInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.TreasureInfo} TreasureInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
TreasureInfo.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.TreasureInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Pos = reader.int32();
break;
}
case 2: {
message.Type = reader.int32();
break;
}
case 3: {
message.Face = reader.int32();
break;
}
case 4: {
message.Avatar = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a TreasureInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.TreasureInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.TreasureInfo} TreasureInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
TreasureInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a TreasureInfo message.
* @function verify
* @memberof tutorial.TreasureInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
TreasureInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Pos != null && message.hasOwnProperty("Pos"))
if (!$util.isInteger(message.Pos))
return "Pos: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
return null;
};
/**
* Creates a TreasureInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.TreasureInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.TreasureInfo} TreasureInfo
*/
TreasureInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.TreasureInfo)
return object;
var message = new $root.tutorial.TreasureInfo();
if (object.Pos != null)
message.Pos = object.Pos | 0;
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
return message;
};
/**
* Creates a plain object from a TreasureInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.TreasureInfo
* @static
* @param {tutorial.TreasureInfo} message TreasureInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
TreasureInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Pos = 0;
object.Type = 0;
object.Face = 0;
object.Avatar = 0;
}
if (message.Pos != null && message.hasOwnProperty("Pos"))
object.Pos = message.Pos;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
return object;
};
/**
* Converts this TreasureInfo to JSON.
* @function toJSON
* @memberof tutorial.TreasureInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
TreasureInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for TreasureInfo
* @function getTypeUrl
* @memberof tutorial.TreasureInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
TreasureInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.TreasureInfo";
};
return TreasureInfo;
})();
tutorial.ReqFriendTreasureStart = (function() {
/**
* Properties of a ReqFriendTreasureStart.
* @memberof tutorial
* @interface IReqFriendTreasureStart
*/
/**
* Constructs a new ReqFriendTreasureStart.
* @memberof tutorial
* @classdesc Represents a ReqFriendTreasureStart.
* @implements IReqFriendTreasureStart
* @constructor
* @param {tutorial.IReqFriendTreasureStart=} [properties] Properties to set
*/
function ReqFriendTreasureStart(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]];
}
/**
* Creates a new ReqFriendTreasureStart instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {tutorial.IReqFriendTreasureStart=} [properties] Properties to set
* @returns {tutorial.ReqFriendTreasureStart} ReqFriendTreasureStart instance
*/
ReqFriendTreasureStart.create = function create(properties) {
return new ReqFriendTreasureStart(properties);
};
/**
* Encodes the specified ReqFriendTreasureStart message. Does not implicitly {@link tutorial.ReqFriendTreasureStart.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {tutorial.IReqFriendTreasureStart} message ReqFriendTreasureStart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendTreasureStart.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFriendTreasureStart message, length delimited. Does not implicitly {@link tutorial.ReqFriendTreasureStart.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {tutorial.IReqFriendTreasureStart} message ReqFriendTreasureStart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendTreasureStart.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendTreasureStart message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendTreasureStart} ReqFriendTreasureStart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendTreasureStart.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.ReqFriendTreasureStart();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendTreasureStart message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendTreasureStart} ReqFriendTreasureStart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendTreasureStart.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendTreasureStart message.
* @function verify
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendTreasureStart.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFriendTreasureStart message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendTreasureStart} ReqFriendTreasureStart
*/
ReqFriendTreasureStart.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendTreasureStart)
return object;
return new $root.tutorial.ReqFriendTreasureStart();
};
/**
* Creates a plain object from a ReqFriendTreasureStart message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {tutorial.ReqFriendTreasureStart} message ReqFriendTreasureStart
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendTreasureStart.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFriendTreasureStart to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendTreasureStart
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendTreasureStart.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendTreasureStart
* @function getTypeUrl
* @memberof tutorial.ReqFriendTreasureStart
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendTreasureStart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendTreasureStart";
};
return ReqFriendTreasureStart;
})();
tutorial.ResFriendTreasureStart = (function() {
/**
* Properties of a ResFriendTreasureStart.
* @memberof tutorial
* @interface IResFriendTreasureStart
* @property {tutorial.RES_CODE|null} [Code] ResFriendTreasureStart Code
* @property {string|null} [Msg] ResFriendTreasureStart Msg
*/
/**
* Constructs a new ResFriendTreasureStart.
* @memberof tutorial
* @classdesc Represents a ResFriendTreasureStart.
* @implements IResFriendTreasureStart
* @constructor
* @param {tutorial.IResFriendTreasureStart=} [properties] Properties to set
*/
function ResFriendTreasureStart(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]];
}
/**
* ResFriendTreasureStart Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResFriendTreasureStart
* @instance
*/
ResFriendTreasureStart.prototype.Code = 0;
/**
* ResFriendTreasureStart Msg.
* @member {string} Msg
* @memberof tutorial.ResFriendTreasureStart
* @instance
*/
ResFriendTreasureStart.prototype.Msg = "";
/**
* Creates a new ResFriendTreasureStart instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {tutorial.IResFriendTreasureStart=} [properties] Properties to set
* @returns {tutorial.ResFriendTreasureStart} ResFriendTreasureStart instance
*/
ResFriendTreasureStart.create = function create(properties) {
return new ResFriendTreasureStart(properties);
};
/**
* Encodes the specified ResFriendTreasureStart message. Does not implicitly {@link tutorial.ResFriendTreasureStart.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {tutorial.IResFriendTreasureStart} message ResFriendTreasureStart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTreasureStart.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
return writer;
};
/**
* Encodes the specified ResFriendTreasureStart message, length delimited. Does not implicitly {@link tutorial.ResFriendTreasureStart.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {tutorial.IResFriendTreasureStart} message ResFriendTreasureStart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTreasureStart.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendTreasureStart message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendTreasureStart} ResFriendTreasureStart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTreasureStart.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.ResFriendTreasureStart();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendTreasureStart message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendTreasureStart} ResFriendTreasureStart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTreasureStart.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendTreasureStart message.
* @function verify
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendTreasureStart.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
return null;
};
/**
* Creates a ResFriendTreasureStart message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendTreasureStart} ResFriendTreasureStart
*/
ResFriendTreasureStart.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendTreasureStart)
return object;
var message = new $root.tutorial.ResFriendTreasureStart();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
return message;
};
/**
* Creates a plain object from a ResFriendTreasureStart message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {tutorial.ResFriendTreasureStart} message ResFriendTreasureStart
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendTreasureStart.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
return object;
};
/**
* Converts this ResFriendTreasureStart to JSON.
* @function toJSON
* @memberof tutorial.ResFriendTreasureStart
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendTreasureStart.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendTreasureStart
* @function getTypeUrl
* @memberof tutorial.ResFriendTreasureStart
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendTreasureStart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendTreasureStart";
};
return ResFriendTreasureStart;
})();
tutorial.ReqFriendTreasureFilp = (function() {
/**
* Properties of a ReqFriendTreasureFilp.
* @memberof tutorial
* @interface IReqFriendTreasureFilp
*/
/**
* Constructs a new ReqFriendTreasureFilp.
* @memberof tutorial
* @classdesc Represents a ReqFriendTreasureFilp.
* @implements IReqFriendTreasureFilp
* @constructor
* @param {tutorial.IReqFriendTreasureFilp=} [properties] Properties to set
*/
function ReqFriendTreasureFilp(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]];
}
/**
* Creates a new ReqFriendTreasureFilp instance using the specified properties.
* @function create
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {tutorial.IReqFriendTreasureFilp=} [properties] Properties to set
* @returns {tutorial.ReqFriendTreasureFilp} ReqFriendTreasureFilp instance
*/
ReqFriendTreasureFilp.create = function create(properties) {
return new ReqFriendTreasureFilp(properties);
};
/**
* Encodes the specified ReqFriendTreasureFilp message. Does not implicitly {@link tutorial.ReqFriendTreasureFilp.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {tutorial.IReqFriendTreasureFilp} message ReqFriendTreasureFilp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendTreasureFilp.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified ReqFriendTreasureFilp message, length delimited. Does not implicitly {@link tutorial.ReqFriendTreasureFilp.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {tutorial.IReqFriendTreasureFilp} message ReqFriendTreasureFilp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqFriendTreasureFilp.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqFriendTreasureFilp message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqFriendTreasureFilp} ReqFriendTreasureFilp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendTreasureFilp.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.ReqFriendTreasureFilp();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqFriendTreasureFilp message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqFriendTreasureFilp} ReqFriendTreasureFilp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqFriendTreasureFilp.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqFriendTreasureFilp message.
* @function verify
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqFriendTreasureFilp.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a ReqFriendTreasureFilp message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqFriendTreasureFilp} ReqFriendTreasureFilp
*/
ReqFriendTreasureFilp.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqFriendTreasureFilp)
return object;
return new $root.tutorial.ReqFriendTreasureFilp();
};
/**
* Creates a plain object from a ReqFriendTreasureFilp message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {tutorial.ReqFriendTreasureFilp} message ReqFriendTreasureFilp
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqFriendTreasureFilp.toObject = function toObject() {
return {};
};
/**
* Converts this ReqFriendTreasureFilp to JSON.
* @function toJSON
* @memberof tutorial.ReqFriendTreasureFilp
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqFriendTreasureFilp.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqFriendTreasureFilp
* @function getTypeUrl
* @memberof tutorial.ReqFriendTreasureFilp
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqFriendTreasureFilp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqFriendTreasureFilp";
};
return ReqFriendTreasureFilp;
})();
tutorial.ResFriendTreasureFilp = (function() {
/**
* Properties of a ResFriendTreasureFilp.
* @memberof tutorial
* @interface IResFriendTreasureFilp
* @property {tutorial.RES_CODE|null} [Code] ResFriendTreasureFilp Code
* @property {string|null} [Msg] ResFriendTreasureFilp Msg
* @property {number|null} [Pos] ResFriendTreasureFilp Pos
* @property {number|null} [Type] ResFriendTreasureFilp Type
* @property {number|null} [Face] ResFriendTreasureFilp Face
* @property {number|null} [Avatar] ResFriendTreasureFilp Avatar
*/
/**
* Constructs a new ResFriendTreasureFilp.
* @memberof tutorial
* @classdesc Represents a ResFriendTreasureFilp.
* @implements IResFriendTreasureFilp
* @constructor
* @param {tutorial.IResFriendTreasureFilp=} [properties] Properties to set
*/
function ResFriendTreasureFilp(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]];
}
/**
* ResFriendTreasureFilp Code.
* @member {tutorial.RES_CODE} Code
* @memberof tutorial.ResFriendTreasureFilp
* @instance
*/
ResFriendTreasureFilp.prototype.Code = 0;
/**
* ResFriendTreasureFilp Msg.
* @member {string} Msg
* @memberof tutorial.ResFriendTreasureFilp
* @instance
*/
ResFriendTreasureFilp.prototype.Msg = "";
/**
* ResFriendTreasureFilp Pos.
* @member {number} Pos
* @memberof tutorial.ResFriendTreasureFilp
* @instance
*/
ResFriendTreasureFilp.prototype.Pos = 0;
/**
* ResFriendTreasureFilp Type.
* @member {number} Type
* @memberof tutorial.ResFriendTreasureFilp
* @instance
*/
ResFriendTreasureFilp.prototype.Type = 0;
/**
* ResFriendTreasureFilp Face.
* @member {number} Face
* @memberof tutorial.ResFriendTreasureFilp
* @instance
*/
ResFriendTreasureFilp.prototype.Face = 0;
/**
* ResFriendTreasureFilp Avatar.
* @member {number} Avatar
* @memberof tutorial.ResFriendTreasureFilp
* @instance
*/
ResFriendTreasureFilp.prototype.Avatar = 0;
/**
* Creates a new ResFriendTreasureFilp instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {tutorial.IResFriendTreasureFilp=} [properties] Properties to set
* @returns {tutorial.ResFriendTreasureFilp} ResFriendTreasureFilp instance
*/
ResFriendTreasureFilp.create = function create(properties) {
return new ResFriendTreasureFilp(properties);
};
/**
* Encodes the specified ResFriendTreasureFilp message. Does not implicitly {@link tutorial.ResFriendTreasureFilp.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {tutorial.IResFriendTreasureFilp} message ResFriendTreasureFilp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTreasureFilp.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Code != null && Object.hasOwnProperty.call(message, "Code"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Code);
if (message.Msg != null && Object.hasOwnProperty.call(message, "Msg"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.Msg);
if (message.Pos != null && Object.hasOwnProperty.call(message, "Pos"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Pos);
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Type);
if (message.Face != null && Object.hasOwnProperty.call(message, "Face"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.Face);
if (message.Avatar != null && Object.hasOwnProperty.call(message, "Avatar"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.Avatar);
return writer;
};
/**
* Encodes the specified ResFriendTreasureFilp message, length delimited. Does not implicitly {@link tutorial.ResFriendTreasureFilp.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {tutorial.IResFriendTreasureFilp} message ResFriendTreasureFilp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTreasureFilp.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendTreasureFilp message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendTreasureFilp} ResFriendTreasureFilp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTreasureFilp.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.ResFriendTreasureFilp();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Code = reader.int32();
break;
}
case 2: {
message.Msg = reader.string();
break;
}
case 3: {
message.Pos = reader.int32();
break;
}
case 4: {
message.Type = reader.int32();
break;
}
case 5: {
message.Face = reader.int32();
break;
}
case 6: {
message.Avatar = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendTreasureFilp message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendTreasureFilp} ResFriendTreasureFilp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTreasureFilp.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendTreasureFilp message.
* @function verify
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendTreasureFilp.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Code != null && message.hasOwnProperty("Code"))
switch (message.Code) {
default:
return "Code: enum value expected";
case 0:
case 1:
break;
}
if (message.Msg != null && message.hasOwnProperty("Msg"))
if (!$util.isString(message.Msg))
return "Msg: string expected";
if (message.Pos != null && message.hasOwnProperty("Pos"))
if (!$util.isInteger(message.Pos))
return "Pos: integer expected";
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Face != null && message.hasOwnProperty("Face"))
if (!$util.isInteger(message.Face))
return "Face: integer expected";
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
if (!$util.isInteger(message.Avatar))
return "Avatar: integer expected";
return null;
};
/**
* Creates a ResFriendTreasureFilp message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendTreasureFilp} ResFriendTreasureFilp
*/
ResFriendTreasureFilp.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendTreasureFilp)
return object;
var message = new $root.tutorial.ResFriendTreasureFilp();
switch (object.Code) {
default:
if (typeof object.Code === "number") {
message.Code = object.Code;
break;
}
break;
case "FAIL":
case 0:
message.Code = 0;
break;
case "SUCCESS":
case 1:
message.Code = 1;
break;
}
if (object.Msg != null)
message.Msg = String(object.Msg);
if (object.Pos != null)
message.Pos = object.Pos | 0;
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Face != null)
message.Face = object.Face | 0;
if (object.Avatar != null)
message.Avatar = object.Avatar | 0;
return message;
};
/**
* Creates a plain object from a ResFriendTreasureFilp message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {tutorial.ResFriendTreasureFilp} message ResFriendTreasureFilp
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendTreasureFilp.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.Code = options.enums === String ? "FAIL" : 0;
object.Msg = "";
object.Pos = 0;
object.Type = 0;
object.Face = 0;
object.Avatar = 0;
}
if (message.Code != null && message.hasOwnProperty("Code"))
object.Code = options.enums === String ? $root.tutorial.RES_CODE[message.Code] === undefined ? message.Code : $root.tutorial.RES_CODE[message.Code] : message.Code;
if (message.Msg != null && message.hasOwnProperty("Msg"))
object.Msg = message.Msg;
if (message.Pos != null && message.hasOwnProperty("Pos"))
object.Pos = message.Pos;
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.Face != null && message.hasOwnProperty("Face"))
object.Face = message.Face;
if (message.Avatar != null && message.hasOwnProperty("Avatar"))
object.Avatar = message.Avatar;
return object;
};
/**
* Converts this ResFriendTreasureFilp to JSON.
* @function toJSON
* @memberof tutorial.ResFriendTreasureFilp
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendTreasureFilp.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendTreasureFilp
* @function getTypeUrl
* @memberof tutorial.ResFriendTreasureFilp
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendTreasureFilp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendTreasureFilp";
};
return ResFriendTreasureFilp;
})();
tutorial.ResFriendTreasureStar = (function() {
/**
* Properties of a ResFriendTreasureStar.
* @memberof tutorial
* @interface IResFriendTreasureStar
* @property {number|null} [Star] ResFriendTreasureStar Star
*/
/**
* Constructs a new ResFriendTreasureStar.
* @memberof tutorial
* @classdesc Represents a ResFriendTreasureStar.
* @implements IResFriendTreasureStar
* @constructor
* @param {tutorial.IResFriendTreasureStar=} [properties] Properties to set
*/
function ResFriendTreasureStar(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]];
}
/**
* ResFriendTreasureStar Star.
* @member {number} Star
* @memberof tutorial.ResFriendTreasureStar
* @instance
*/
ResFriendTreasureStar.prototype.Star = 0;
/**
* Creates a new ResFriendTreasureStar instance using the specified properties.
* @function create
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {tutorial.IResFriendTreasureStar=} [properties] Properties to set
* @returns {tutorial.ResFriendTreasureStar} ResFriendTreasureStar instance
*/
ResFriendTreasureStar.create = function create(properties) {
return new ResFriendTreasureStar(properties);
};
/**
* Encodes the specified ResFriendTreasureStar message. Does not implicitly {@link tutorial.ResFriendTreasureStar.verify|verify} messages.
* @function encode
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {tutorial.IResFriendTreasureStar} message ResFriendTreasureStar message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTreasureStar.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Star != null && Object.hasOwnProperty.call(message, "Star"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Star);
return writer;
};
/**
* Encodes the specified ResFriendTreasureStar message, length delimited. Does not implicitly {@link tutorial.ResFriendTreasureStar.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {tutorial.IResFriendTreasureStar} message ResFriendTreasureStar message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResFriendTreasureStar.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResFriendTreasureStar message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResFriendTreasureStar} ResFriendTreasureStar
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTreasureStar.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.ResFriendTreasureStar();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Star = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResFriendTreasureStar message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResFriendTreasureStar} ResFriendTreasureStar
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResFriendTreasureStar.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResFriendTreasureStar message.
* @function verify
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResFriendTreasureStar.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Star != null && message.hasOwnProperty("Star"))
if (!$util.isInteger(message.Star))
return "Star: integer expected";
return null;
};
/**
* Creates a ResFriendTreasureStar message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResFriendTreasureStar} ResFriendTreasureStar
*/
ResFriendTreasureStar.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResFriendTreasureStar)
return object;
var message = new $root.tutorial.ResFriendTreasureStar();
if (object.Star != null)
message.Star = object.Star | 0;
return message;
};
/**
* Creates a plain object from a ResFriendTreasureStar message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {tutorial.ResFriendTreasureStar} message ResFriendTreasureStar
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResFriendTreasureStar.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Star = 0;
if (message.Star != null && message.hasOwnProperty("Star"))
object.Star = message.Star;
return object;
};
/**
* Converts this ResFriendTreasureStar to JSON.
* @function toJSON
* @memberof tutorial.ResFriendTreasureStar
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResFriendTreasureStar.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResFriendTreasureStar
* @function getTypeUrl
* @memberof tutorial.ResFriendTreasureStar
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResFriendTreasureStar.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResFriendTreasureStar";
};
return ResFriendTreasureStar;
})();
tutorial.ReqAdminInfo = (function() {
/**
* Properties of a ReqAdminInfo.
* @memberof tutorial
* @interface IReqAdminInfo
* @property {number|null} [Uid] ReqAdminInfo Uid
*/
/**
* Constructs a new ReqAdminInfo.
* @memberof tutorial
* @classdesc Represents a ReqAdminInfo.
* @implements IReqAdminInfo
* @constructor
* @param {tutorial.IReqAdminInfo=} [properties] Properties to set
*/
function ReqAdminInfo(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]];
}
/**
* ReqAdminInfo Uid.
* @member {number} Uid
* @memberof tutorial.ReqAdminInfo
* @instance
*/
ReqAdminInfo.prototype.Uid = 0;
/**
* Creates a new ReqAdminInfo instance using the specified properties.
* @function create
* @memberof tutorial.ReqAdminInfo
* @static
* @param {tutorial.IReqAdminInfo=} [properties] Properties to set
* @returns {tutorial.ReqAdminInfo} ReqAdminInfo instance
*/
ReqAdminInfo.create = function create(properties) {
return new ReqAdminInfo(properties);
};
/**
* Encodes the specified ReqAdminInfo message. Does not implicitly {@link tutorial.ReqAdminInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ReqAdminInfo
* @static
* @param {tutorial.IReqAdminInfo} message ReqAdminInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAdminInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Uid);
return writer;
};
/**
* Encodes the specified ReqAdminInfo message, length delimited. Does not implicitly {@link tutorial.ReqAdminInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ReqAdminInfo
* @static
* @param {tutorial.IReqAdminInfo} message ReqAdminInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ReqAdminInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ReqAdminInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ReqAdminInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ReqAdminInfo} ReqAdminInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAdminInfo.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.ReqAdminInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Uid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ReqAdminInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ReqAdminInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ReqAdminInfo} ReqAdminInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ReqAdminInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ReqAdminInfo message.
* @function verify
* @memberof tutorial.ReqAdminInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ReqAdminInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Uid != null && message.hasOwnProperty("Uid"))
if (!$util.isInteger(message.Uid))
return "Uid: integer expected";
return null;
};
/**
* Creates a ReqAdminInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ReqAdminInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ReqAdminInfo} ReqAdminInfo
*/
ReqAdminInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ReqAdminInfo)
return object;
var message = new $root.tutorial.ReqAdminInfo();
if (object.Uid != null)
message.Uid = object.Uid | 0;
return message;
};
/**
* Creates a plain object from a ReqAdminInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ReqAdminInfo
* @static
* @param {tutorial.ReqAdminInfo} message ReqAdminInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ReqAdminInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Uid = 0;
if (message.Uid != null && message.hasOwnProperty("Uid"))
object.Uid = message.Uid;
return object;
};
/**
* Converts this ReqAdminInfo to JSON.
* @function toJSON
* @memberof tutorial.ReqAdminInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ReqAdminInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ReqAdminInfo
* @function getTypeUrl
* @memberof tutorial.ReqAdminInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ReqAdminInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ReqAdminInfo";
};
return ReqAdminInfo;
})();
tutorial.ResAdminInfo = (function() {
/**
* Properties of a ResAdminInfo.
* @memberof tutorial
* @interface IResAdminInfo
* @property {string|null} [info] ResAdminInfo info
*/
/**
* Constructs a new ResAdminInfo.
* @memberof tutorial
* @classdesc Represents a ResAdminInfo.
* @implements IResAdminInfo
* @constructor
* @param {tutorial.IResAdminInfo=} [properties] Properties to set
*/
function ResAdminInfo(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]];
}
/**
* ResAdminInfo info.
* @member {string} info
* @memberof tutorial.ResAdminInfo
* @instance
*/
ResAdminInfo.prototype.info = "";
/**
* Creates a new ResAdminInfo instance using the specified properties.
* @function create
* @memberof tutorial.ResAdminInfo
* @static
* @param {tutorial.IResAdminInfo=} [properties] Properties to set
* @returns {tutorial.ResAdminInfo} ResAdminInfo instance
*/
ResAdminInfo.create = function create(properties) {
return new ResAdminInfo(properties);
};
/**
* Encodes the specified ResAdminInfo message. Does not implicitly {@link tutorial.ResAdminInfo.verify|verify} messages.
* @function encode
* @memberof tutorial.ResAdminInfo
* @static
* @param {tutorial.IResAdminInfo} message ResAdminInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAdminInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.info != null && Object.hasOwnProperty.call(message, "info"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.info);
return writer;
};
/**
* Encodes the specified ResAdminInfo message, length delimited. Does not implicitly {@link tutorial.ResAdminInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof tutorial.ResAdminInfo
* @static
* @param {tutorial.IResAdminInfo} message ResAdminInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResAdminInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResAdminInfo message from the specified reader or buffer.
* @function decode
* @memberof tutorial.ResAdminInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {tutorial.ResAdminInfo} ResAdminInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAdminInfo.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.ResAdminInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.info = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResAdminInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof tutorial.ResAdminInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {tutorial.ResAdminInfo} ResAdminInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResAdminInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResAdminInfo message.
* @function verify
* @memberof tutorial.ResAdminInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResAdminInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.info != null && message.hasOwnProperty("info"))
if (!$util.isString(message.info))
return "info: string expected";
return null;
};
/**
* Creates a ResAdminInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof tutorial.ResAdminInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {tutorial.ResAdminInfo} ResAdminInfo
*/
ResAdminInfo.fromObject = function fromObject(object) {
if (object instanceof $root.tutorial.ResAdminInfo)
return object;
var message = new $root.tutorial.ResAdminInfo();
if (object.info != null)
message.info = String(object.info);
return message;
};
/**
* Creates a plain object from a ResAdminInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof tutorial.ResAdminInfo
* @static
* @param {tutorial.ResAdminInfo} message ResAdminInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResAdminInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.info = "";
if (message.info != null && message.hasOwnProperty("info"))
object.info = message.info;
return object;
};
/**
* Converts this ResAdminInfo to JSON.
* @function toJSON
* @memberof tutorial.ResAdminInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResAdminInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResAdminInfo
* @function getTypeUrl
* @memberof tutorial.ResAdminInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResAdminInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/tutorial.ResAdminInfo";
};
return ResAdminInfo;
})();
return tutorial;
})();
module.exports = $root;