tf2
Version:
Exposes a simple API for interacting with the Team Fortress 2 game coordinator
20,624 lines • 1.07 MB
JavaScript
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
(function(global, factory) { /* global define, require, module */
/* AMD */ if (typeof define === 'function' && define.amd)
define(["protobufjs/minimal"], factory);
/* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
module.exports = factory(require("protobufjs/minimal"));
})(this, function($protobuf) {
"use strict";
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
/**
* LogicalOperation enum.
* @exports LogicalOperation
* @enum {string}
* @property {number} AND=0 AND value
* @property {number} OR=1 OR value
* @property {number} NOT=2 NOT value
*/
$root.LogicalOperation = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "AND"] = 0;
values[valuesById[1] = "OR"] = 1;
values[valuesById[2] = "NOT"] = 2;
return values;
})();
/**
* EValueDefinitionSource enum.
* @exports EValueDefinitionSource
* @enum {string}
* @property {number} REFERENCE_DEFINES=0 REFERENCE_DEFINES value
* @property {number} PARENT_DEFINES=1 PARENT_DEFINES value
* @property {number} THIS_DEFINES=2 THIS_DEFINES value
* @property {number} VARIABLE_DEFINES=3 VARIABLE_DEFINES value
* @property {number} NOT_DEFINED=4 NOT_DEFINED value
*/
$root.EValueDefinitionSource = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "REFERENCE_DEFINES"] = 0;
values[valuesById[1] = "PARENT_DEFINES"] = 1;
values[valuesById[2] = "THIS_DEFINES"] = 2;
values[valuesById[3] = "VARIABLE_DEFINES"] = 3;
values[valuesById[4] = "NOT_DEFINED"] = 4;
return values;
})();
/**
* ProtoDefTypes enum.
* @exports ProtoDefTypes
* @enum {string}
* @property {number} DEF_TYPE_QUEST_MAP_NODE=0 DEF_TYPE_QUEST_MAP_NODE value
* @property {number} DEF_TYPE_QUEST_THEME=2 DEF_TYPE_QUEST_THEME value
* @property {number} DEF_TYPE_QUEST_MAP_REGION=3 DEF_TYPE_QUEST_MAP_REGION value
* @property {number} DEF_TYPE_QUEST=4 DEF_TYPE_QUEST value
* @property {number} DEF_TYPE_QUEST_OBJECTIVE=5 DEF_TYPE_QUEST_OBJECTIVE value
* @property {number} DEF_TYPE_PAINTKIT_VARIABLES=6 DEF_TYPE_PAINTKIT_VARIABLES value
* @property {number} DEF_TYPE_PAINTKIT_OPERATION=7 DEF_TYPE_PAINTKIT_OPERATION value
* @property {number} DEF_TYPE_PAINTKIT_ITEM_DEFINITION=8 DEF_TYPE_PAINTKIT_ITEM_DEFINITION value
* @property {number} DEF_TYPE_PAINTKIT_DEFINITION=9 DEF_TYPE_PAINTKIT_DEFINITION value
* @property {number} DEF_TYPE_HEADER_ONLY=10 DEF_TYPE_HEADER_ONLY value
* @property {number} DEF_TYPE_QUEST_MAP_STORE_ITEM=11 DEF_TYPE_QUEST_MAP_STORE_ITEM value
* @property {number} DEF_TYPE_QUEST_MAP_STAR_TYPE=12 DEF_TYPE_QUEST_MAP_STAR_TYPE value
*/
$root.ProtoDefTypes = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "DEF_TYPE_QUEST_MAP_NODE"] = 0;
values[valuesById[2] = "DEF_TYPE_QUEST_THEME"] = 2;
values[valuesById[3] = "DEF_TYPE_QUEST_MAP_REGION"] = 3;
values[valuesById[4] = "DEF_TYPE_QUEST"] = 4;
values[valuesById[5] = "DEF_TYPE_QUEST_OBJECTIVE"] = 5;
values[valuesById[6] = "DEF_TYPE_PAINTKIT_VARIABLES"] = 6;
values[valuesById[7] = "DEF_TYPE_PAINTKIT_OPERATION"] = 7;
values[valuesById[8] = "DEF_TYPE_PAINTKIT_ITEM_DEFINITION"] = 8;
values[valuesById[9] = "DEF_TYPE_PAINTKIT_DEFINITION"] = 9;
values[valuesById[10] = "DEF_TYPE_HEADER_ONLY"] = 10;
values[valuesById[11] = "DEF_TYPE_QUEST_MAP_STORE_ITEM"] = 11;
values[valuesById[12] = "DEF_TYPE_QUEST_MAP_STAR_TYPE"] = 12;
return values;
})();
/**
* EQuestPoints enum.
* @exports EQuestPoints
* @enum {string}
* @property {number} QUEST_POINTS_NOVICE=0 QUEST_POINTS_NOVICE value
* @property {number} QUEST_POINTS_ADVANCED=1 QUEST_POINTS_ADVANCED value
* @property {number} QUEST_POINTS_EXPERT=2 QUEST_POINTS_EXPERT value
*/
$root.EQuestPoints = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "QUEST_POINTS_NOVICE"] = 0;
values[valuesById[1] = "QUEST_POINTS_ADVANCED"] = 1;
values[valuesById[2] = "QUEST_POINTS_EXPERT"] = 2;
return values;
})();
/**
* EVarFieldType enum.
* @exports EVarFieldType
* @enum {string}
* @property {number} VAR_TYPE_INVALID=1 VAR_TYPE_INVALID value
* @property {number} VAR_TYPE_FLOAT=2 VAR_TYPE_FLOAT value
* @property {number} VAR_TYPE_DOUBLE=3 VAR_TYPE_DOUBLE value
* @property {number} VAR_TYPE_UINT32=4 VAR_TYPE_UINT32 value
* @property {number} VAR_TYPE_UINT64=5 VAR_TYPE_UINT64 value
* @property {number} VAR_TYPE_SINT32=6 VAR_TYPE_SINT32 value
* @property {number} VAR_TYPE_SINT64=7 VAR_TYPE_SINT64 value
* @property {number} VAR_TYPE_BOOL=8 VAR_TYPE_BOOL value
* @property {number} VAR_TYPE_STRING=9 VAR_TYPE_STRING value
*/
$root.EVarFieldType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "VAR_TYPE_INVALID"] = 1;
values[valuesById[2] = "VAR_TYPE_FLOAT"] = 2;
values[valuesById[3] = "VAR_TYPE_DOUBLE"] = 3;
values[valuesById[4] = "VAR_TYPE_UINT32"] = 4;
values[valuesById[5] = "VAR_TYPE_UINT64"] = 5;
values[valuesById[6] = "VAR_TYPE_SINT32"] = 6;
values[valuesById[7] = "VAR_TYPE_SINT64"] = 7;
values[valuesById[8] = "VAR_TYPE_BOOL"] = 8;
values[valuesById[9] = "VAR_TYPE_STRING"] = 9;
return values;
})();
/**
* ENodeCashReward enum.
* @exports ENodeCashReward
* @enum {string}
* @property {number} CASH_REWARD_NONE=1 CASH_REWARD_NONE value
* @property {number} CASH_REWARD_SMALL=2 CASH_REWARD_SMALL value
* @property {number} CASH_REWARD_MEDIUM=3 CASH_REWARD_MEDIUM value
* @property {number} CASH_REWARD_LARGE=4 CASH_REWARD_LARGE value
*/
$root.ENodeCashReward = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "CASH_REWARD_NONE"] = 1;
values[valuesById[2] = "CASH_REWARD_SMALL"] = 2;
values[valuesById[3] = "CASH_REWARD_MEDIUM"] = 3;
values[valuesById[4] = "CASH_REWARD_LARGE"] = 4;
return values;
})();
$root.CMsgFieldID = (function() {
/**
* Properties of a CMsgFieldID.
* @exports ICMsgFieldID
* @interface ICMsgFieldID
* @property {Array.<CMsgFieldID.ICMsgField>|null} [field] CMsgFieldID field
*/
/**
* Constructs a new CMsgFieldID.
* @exports CMsgFieldID
* @classdesc Represents a CMsgFieldID.
* @implements ICMsgFieldID
* @constructor
* @param {ICMsgFieldID=} [properties] Properties to set
*/
function CMsgFieldID(properties) {
this.field = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgFieldID field.
* @member {Array.<CMsgFieldID.ICMsgField>} field
* @memberof CMsgFieldID
* @instance
*/
CMsgFieldID.prototype.field = $util.emptyArray;
/**
* Creates a new CMsgFieldID instance using the specified properties.
* @function create
* @memberof CMsgFieldID
* @static
* @param {ICMsgFieldID=} [properties] Properties to set
* @returns {CMsgFieldID} CMsgFieldID instance
*/
CMsgFieldID.create = function create(properties) {
return new CMsgFieldID(properties);
};
/**
* Encodes the specified CMsgFieldID message. Does not implicitly {@link CMsgFieldID.verify|verify} messages.
* @function encode
* @memberof CMsgFieldID
* @static
* @param {ICMsgFieldID} message CMsgFieldID message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgFieldID.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.field != null && message.field.length)
for (var i = 0; i < message.field.length; ++i)
$root.CMsgFieldID.CMsgField.encode(message.field[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgFieldID message, length delimited. Does not implicitly {@link CMsgFieldID.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgFieldID
* @static
* @param {ICMsgFieldID} message CMsgFieldID message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgFieldID.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgFieldID message from the specified reader or buffer.
* @function decode
* @memberof CMsgFieldID
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgFieldID} CMsgFieldID
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgFieldID.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgFieldID();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.field && message.field.length))
message.field = [];
message.field.push($root.CMsgFieldID.CMsgField.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgFieldID message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgFieldID
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgFieldID} CMsgFieldID
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgFieldID.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgFieldID message.
* @function verify
* @memberof CMsgFieldID
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgFieldID.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.field != null && message.hasOwnProperty("field")) {
if (!Array.isArray(message.field))
return "field: array expected";
for (var i = 0; i < message.field.length; ++i) {
var error = $root.CMsgFieldID.CMsgField.verify(message.field[i]);
if (error)
return "field." + error;
}
}
return null;
};
/**
* Creates a CMsgFieldID message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgFieldID
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgFieldID} CMsgFieldID
*/
CMsgFieldID.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgFieldID)
return object;
var message = new $root.CMsgFieldID();
if (object.field) {
if (!Array.isArray(object.field))
throw TypeError(".CMsgFieldID.field: array expected");
message.field = [];
for (var i = 0; i < object.field.length; ++i) {
if (typeof object.field[i] !== "object")
throw TypeError(".CMsgFieldID.field: object expected");
message.field[i] = $root.CMsgFieldID.CMsgField.fromObject(object.field[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgFieldID message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgFieldID
* @static
* @param {CMsgFieldID} message CMsgFieldID
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgFieldID.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.field = [];
if (message.field && message.field.length) {
object.field = [];
for (var j = 0; j < message.field.length; ++j)
object.field[j] = $root.CMsgFieldID.CMsgField.toObject(message.field[j], options);
}
return object;
};
/**
* Converts this CMsgFieldID to JSON.
* @function toJSON
* @memberof CMsgFieldID
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgFieldID.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
CMsgFieldID.CMsgField = (function() {
/**
* Properties of a CMsgField.
* @memberof CMsgFieldID
* @interface ICMsgField
* @property {number|null} [field_number] CMsgField field_number
* @property {number|null} [repeated_index] CMsgField repeated_index
*/
/**
* Constructs a new CMsgField.
* @memberof CMsgFieldID
* @classdesc Represents a CMsgField.
* @implements ICMsgField
* @constructor
* @param {CMsgFieldID.ICMsgField=} [properties] Properties to set
*/
function CMsgField(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]];
}
/**
* CMsgField field_number.
* @member {number} field_number
* @memberof CMsgFieldID.CMsgField
* @instance
*/
CMsgField.prototype.field_number = 0;
/**
* CMsgField repeated_index.
* @member {number} repeated_index
* @memberof CMsgFieldID.CMsgField
* @instance
*/
CMsgField.prototype.repeated_index = 0;
/**
* Creates a new CMsgField instance using the specified properties.
* @function create
* @memberof CMsgFieldID.CMsgField
* @static
* @param {CMsgFieldID.ICMsgField=} [properties] Properties to set
* @returns {CMsgFieldID.CMsgField} CMsgField instance
*/
CMsgField.create = function create(properties) {
return new CMsgField(properties);
};
/**
* Encodes the specified CMsgField message. Does not implicitly {@link CMsgFieldID.CMsgField.verify|verify} messages.
* @function encode
* @memberof CMsgFieldID.CMsgField
* @static
* @param {CMsgFieldID.ICMsgField} message CMsgField message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgField.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.field_number != null && message.hasOwnProperty("field_number"))
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.field_number);
if (message.repeated_index != null && message.hasOwnProperty("repeated_index"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.repeated_index);
return writer;
};
/**
* Encodes the specified CMsgField message, length delimited. Does not implicitly {@link CMsgFieldID.CMsgField.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgFieldID.CMsgField
* @static
* @param {CMsgFieldID.ICMsgField} message CMsgField message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgField.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgField message from the specified reader or buffer.
* @function decode
* @memberof CMsgFieldID.CMsgField
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgFieldID.CMsgField} CMsgField
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgField.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgFieldID.CMsgField();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.field_number = reader.uint32();
break;
case 2:
message.repeated_index = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgField message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgFieldID.CMsgField
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgFieldID.CMsgField} CMsgField
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgField.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgField message.
* @function verify
* @memberof CMsgFieldID.CMsgField
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgField.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.field_number != null && message.hasOwnProperty("field_number"))
if (!$util.isInteger(message.field_number))
return "field_number: integer expected";
if (message.repeated_index != null && message.hasOwnProperty("repeated_index"))
if (!$util.isInteger(message.repeated_index))
return "repeated_index: integer expected";
return null;
};
/**
* Creates a CMsgField message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgFieldID.CMsgField
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgFieldID.CMsgField} CMsgField
*/
CMsgField.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgFieldID.CMsgField)
return object;
var message = new $root.CMsgFieldID.CMsgField();
if (object.field_number != null)
message.field_number = object.field_number >>> 0;
if (object.repeated_index != null)
message.repeated_index = object.repeated_index >>> 0;
return message;
};
/**
* Creates a plain object from a CMsgField message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgFieldID.CMsgField
* @static
* @param {CMsgFieldID.CMsgField} message CMsgField
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgField.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.field_number = 0;
object.repeated_index = 0;
}
if (message.field_number != null && message.hasOwnProperty("field_number"))
object.field_number = message.field_number;
if (message.repeated_index != null && message.hasOwnProperty("repeated_index"))
object.repeated_index = message.repeated_index;
return object;
};
/**
* Converts this CMsgField to JSON.
* @function toJSON
* @memberof CMsgFieldID.CMsgField
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgField.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgField;
})();
return CMsgFieldID;
})();
$root.CMsgUniversalFieldID = (function() {
/**
* Properties of a CMsgUniversalFieldID.
* @exports ICMsgUniversalFieldID
* @interface ICMsgUniversalFieldID
* @property {EValueDefinitionSource|null} [source_type] CMsgUniversalFieldID source_type
* @property {ICMsgProtoDefID|null} [defining_obj_id] CMsgUniversalFieldID defining_obj_id
* @property {ICMsgFieldID|null} [field_id] CMsgUniversalFieldID field_id
*/
/**
* Constructs a new CMsgUniversalFieldID.
* @exports CMsgUniversalFieldID
* @classdesc Represents a CMsgUniversalFieldID.
* @implements ICMsgUniversalFieldID
* @constructor
* @param {ICMsgUniversalFieldID=} [properties] Properties to set
*/
function CMsgUniversalFieldID(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]];
}
/**
* CMsgUniversalFieldID source_type.
* @member {EValueDefinitionSource} source_type
* @memberof CMsgUniversalFieldID
* @instance
*/
CMsgUniversalFieldID.prototype.source_type = 0;
/**
* CMsgUniversalFieldID defining_obj_id.
* @member {ICMsgProtoDefID|null|undefined} defining_obj_id
* @memberof CMsgUniversalFieldID
* @instance
*/
CMsgUniversalFieldID.prototype.defining_obj_id = null;
/**
* CMsgUniversalFieldID field_id.
* @member {ICMsgFieldID|null|undefined} field_id
* @memberof CMsgUniversalFieldID
* @instance
*/
CMsgUniversalFieldID.prototype.field_id = null;
/**
* Creates a new CMsgUniversalFieldID instance using the specified properties.
* @function create
* @memberof CMsgUniversalFieldID
* @static
* @param {ICMsgUniversalFieldID=} [properties] Properties to set
* @returns {CMsgUniversalFieldID} CMsgUniversalFieldID instance
*/
CMsgUniversalFieldID.create = function create(properties) {
return new CMsgUniversalFieldID(properties);
};
/**
* Encodes the specified CMsgUniversalFieldID message. Does not implicitly {@link CMsgUniversalFieldID.verify|verify} messages.
* @function encode
* @memberof CMsgUniversalFieldID
* @static
* @param {ICMsgUniversalFieldID} message CMsgUniversalFieldID message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgUniversalFieldID.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.source_type != null && message.hasOwnProperty("source_type"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.source_type);
if (message.defining_obj_id != null && message.hasOwnProperty("defining_obj_id"))
$root.CMsgProtoDefID.encode(message.defining_obj_id, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.field_id != null && message.hasOwnProperty("field_id"))
$root.CMsgFieldID.encode(message.field_id, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgUniversalFieldID message, length delimited. Does not implicitly {@link CMsgUniversalFieldID.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgUniversalFieldID
* @static
* @param {ICMsgUniversalFieldID} message CMsgUniversalFieldID message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgUniversalFieldID.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgUniversalFieldID message from the specified reader or buffer.
* @function decode
* @memberof CMsgUniversalFieldID
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgUniversalFieldID} CMsgUniversalFieldID
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgUniversalFieldID.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgUniversalFieldID();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.source_type = reader.int32();
break;
case 2:
message.defining_obj_id = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 3:
message.field_id = $root.CMsgFieldID.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgUniversalFieldID message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgUniversalFieldID
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgUniversalFieldID} CMsgUniversalFieldID
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgUniversalFieldID.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgUniversalFieldID message.
* @function verify
* @memberof CMsgUniversalFieldID
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgUniversalFieldID.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.source_type != null && message.hasOwnProperty("source_type"))
switch (message.source_type) {
default:
return "source_type: enum value expected";
case 0:
case 1:
case 2:
case 3:
case 4:
break;
}
if (message.defining_obj_id != null && message.hasOwnProperty("defining_obj_id")) {
var error = $root.CMsgProtoDefID.verify(message.defining_obj_id);
if (error)
return "defining_obj_id." + error;
}
if (message.field_id != null && message.hasOwnProperty("field_id")) {
var error = $root.CMsgFieldID.verify(message.field_id);
if (error)
return "field_id." + error;
}
return null;
};
/**
* Creates a CMsgUniversalFieldID message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgUniversalFieldID
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgUniversalFieldID} CMsgUniversalFieldID
*/
CMsgUniversalFieldID.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgUniversalFieldID)
return object;
var message = new $root.CMsgUniversalFieldID();
switch (object.source_type) {
case "REFERENCE_DEFINES":
case 0:
message.source_type = 0;
break;
case "PARENT_DEFINES":
case 1:
message.source_type = 1;
break;
case "THIS_DEFINES":
case 2:
message.source_type = 2;
break;
case "VARIABLE_DEFINES":
case 3:
message.source_type = 3;
break;
case "NOT_DEFINED":
case 4:
message.source_type = 4;
break;
}
if (object.defining_obj_id != null) {
if (typeof object.defining_obj_id !== "object")
throw TypeError(".CMsgUniversalFieldID.defining_obj_id: object expected");
message.defining_obj_id = $root.CMsgProtoDefID.fromObject(object.defining_obj_id);
}
if (object.field_id != null) {
if (typeof object.field_id !== "object")
throw TypeError(".CMsgUniversalFieldID.field_id: object expected");
message.field_id = $root.CMsgFieldID.fromObject(object.field_id);
}
return message;
};
/**
* Creates a plain object from a CMsgUniversalFieldID message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgUniversalFieldID
* @static
* @param {CMsgUniversalFieldID} message CMsgUniversalFieldID
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgUniversalFieldID.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.source_type = options.enums === String ? "REFERENCE_DEFINES" : 0;
object.defining_obj_id = null;
object.field_id = null;
}
if (message.source_type != null && message.hasOwnProperty("source_type"))
object.source_type = options.enums === String ? $root.EValueDefinitionSource[message.source_type] : message.source_type;
if (message.defining_obj_id != null && message.hasOwnProperty("defining_obj_id"))
object.defining_obj_id = $root.CMsgProtoDefID.toObject(message.defining_obj_id, options);
if (message.field_id != null && message.hasOwnProperty("field_id"))
object.field_id = $root.CMsgFieldID.toObject(message.field_id, options);
return object;
};
/**
* Converts this CMsgUniversalFieldID to JSON.
* @function toJSON
* @memberof CMsgUniversalFieldID
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgUniversalFieldID.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgUniversalFieldID;
})();
$root.CMsgVariableDefinition = (function() {
/**
* Properties of a CMsgVariableDefinition.
* @exports ICMsgVariableDefinition
* @interface ICMsgVariableDefinition
* @property {string|null} [name] CMsgVariableDefinition name
* @property {boolean|null} [inherit] CMsgVariableDefinition inherit
* @property {string|null} [value] CMsgVariableDefinition value
*/
/**
* Constructs a new CMsgVariableDefinition.
* @exports CMsgVariableDefinition
* @classdesc Represents a CMsgVariableDefinition.
* @implements ICMsgVariableDefinition
* @constructor
* @param {ICMsgVariableDefinition=} [properties] Properties to set
*/
function CMsgVariableDefinition(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]];
}
/**
* CMsgVariableDefinition name.
* @member {string} name
* @memberof CMsgVariableDefinition
* @instance
*/
CMsgVariableDefinition.prototype.name = "";
/**
* CMsgVariableDefinition inherit.
* @member {boolean} inherit
* @memberof CMsgVariableDefinition
* @instance
*/
CMsgVariableDefinition.prototype.inherit = true;
/**
* CMsgVariableDefinition value.
* @member {string} value
* @memberof CMsgVariableDefinition
* @instance
*/
CMsgVariableDefinition.prototype.value = "";
/**
* Creates a new CMsgVariableDefinition instance using the specified properties.
* @function create
* @memberof CMsgVariableDefinition
* @static
* @param {ICMsgVariableDefinition=} [properties] Properties to set
* @returns {CMsgVariableDefinition} CMsgVariableDefinition instance
*/
CMsgVariableDefinition.create = function create(properties) {
return new CMsgVariableDefinition(properties);
};
/**
* Encodes the specified CMsgVariableDefinition message. Does not implicitly {@link CMsgVariableDefinition.verify|verify} messages.
* @function encode
* @memberof CMsgVariableDefinition
* @static
* @param {ICMsgVariableDefinition} message CMsgVariableDefinition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgVariableDefinition.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.inherit != null && message.hasOwnProperty("inherit"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.inherit);
if (message.value != null && message.hasOwnProperty("value"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.value);
return writer;
};
/**
* Encodes the specified CMsgVariableDefinition message, length delimited. Does not implicitly {@link CMsgVariableDefinition.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgVariableDefinition
* @static
* @param {ICMsgVariableDefinition} message CMsgVariableDefinition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgVariableDefinition.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgVariableDefinition message from the specified reader or buffer.
* @function decode
* @memberof CMsgVariableDefinition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgVariableDefinition} CMsgVariableDefinition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgVariableDefinition.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgVariableDefinition();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
message.inherit = reader.bool();
break;
case 3:
message.value = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgVariableDefinition message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgVariableDefinition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgVariableDefinition} CMsgVariableDefinition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgVariableDefinition.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgVariableDefinition message.
* @function verify
* @memberof CMsgVariableDefinition
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgVariableDefinition.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.inherit != null && message.hasOwnProperty("inherit"))
if (typeof message.inherit !== "boolean")
return "inherit: boolean expected";
if (message.value != null && message.hasOwnProperty("value"))
if (!$util.isString(message.value))
return "value: string expected";
return null;
};
/**
* Creates a CMsgVariableDefinition message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgVariableDefinition
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgVariableDefinition} CMsgVariableDefinition
*/
CMsgVariableDefinition.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgVariableDefinition)
return object;
var message = new $root.CMsgVariableDefinition();
if (object.name != null)
message.name = String(object.name);
if (object.inherit != null)
message.inherit = Boolean(object.inherit);
if (object.value != null)
message.value = String(object.value);
return message;
};
/**
* Creates a plain object from a CMsgVariableDefinition message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgVariableDefinition
* @static
* @param {CMsgVariableDefinition} message CMsgVariableDefinition
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgVariableDefinition.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.name = "";
object.inherit = true;
object.value = "";
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.inherit != null && message.hasOwnProperty("inherit"))
object.inherit = message.inherit;
if (message.value != null && message.hasOwnProperty("value"))
object.value = message.value;
return object;
};
/**
* Converts this CMsgVariableDefinition to JSON.
* @function toJSON
* @memberof CMsgVariableDefinition
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgVariableDefinition.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgVariableDefinition;
})();
$root.CMsgProtoDefHeader = (function() {
/**
* Properties of a CMsgProtoDefHeader.
* @exports ICMsgProtoDefHeader
* @interface ICMsgProtoDefHeader
* @property {number} defindex CMsgProtoDefHeader defindex
* @property {string|null} [name] CMsgProtoDefHeader name
* @property {Array.<ICMsgProtoDefID>|null} [prefabs] CMsgProtoDefHeader prefabs
* @property {Array.<string>|null} [tags] CMsgProtoDefHeader tags
* @property {boolean|null} [prefab_only] CMsgProtoDefHeader prefab_only
* @property {Array.<ICMsgVariableDefinition>|null} [variables] CMsgProtoDefHeader variables
*/
/**
* Constructs a new CMsgProtoDefHeader.
* @exports CMsgProtoDefHeader
* @classdesc Represents a CMsgProtoDefHeader.
* @implements ICMsgProtoDefHeader
* @constructor
* @param {ICMsgProtoDefHeader=} [properties] Properties to set
*/
function CMsgProtoDefHeader(properties) {
this.prefabs = [];
this.tags = [];
this.variables = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgProtoDefHeader defindex.
* @member {number} defindex
* @memberof CMsgProtoDefHeader
* @instance
*/
CMsgProtoDefHeader.prototype.defindex = 0;
/**
* CMsgProtoDefHeader name.
* @member {string} name
* @memberof CMsgProtoDefHeader
* @instance
*/
CMsgProtoDefHeader.prototype.name = "";
/**
* CMsgProtoDefHeader prefabs.
* @member {Array.<ICMsgProtoDefID>} prefabs
* @memberof CMsgProtoDefHeader
* @instance
*/
CMsgProtoDefHeader.prototype.prefabs = $util.emptyArray;
/**
* CMsgProtoDefHeader tags.
* @member {Array.<string>} tags
* @memberof CMsgProtoDefHeader
* @instance
*/
CMsgProtoDefHeader.prototype.tags = $util.emptyArray;
/**
* CMsgProtoDefHeader prefab_only.
* @member {boolean} prefab_only
* @memberof CMsgProtoDefHeader
* @instance
*/
CMsgProtoDefHeader.prototype.prefab_only = false;
/**
* CMsgProtoDefHeader variables.
* @member {Array.<ICMsgVariableDefinition>} variables
* @memberof CMsgProtoDefHeader
* @instance
*/
CMsgProtoDefHeader.prototype.variables = $util.emptyArray;
/**
* Creates a new CMsgProtoDefHeader instance using the specified properties.
* @function create
* @memberof CMsgProtoDefHeader
* @static
* @param {ICMsgProtoDefHeader=} [properties] Properties to set
* @returns {CMsgProtoDefHeader} CMsgProtoDefHeader instance
*/
CMsgProtoDefHeader.create = function create(properties) {
return new CMsgProtoDefHeader(properties);
};
/**
* Encodes the specified CMsgProtoDefHeader message. Does not implicitly {@link CMsgProtoDefHeader.verify|verify} messages.
* @function encode
* @memberof CMsgProtoDefHeader
* @static
* @param {ICMsgProtoDefHeader} message CMsgProtoDefHeader message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgProtoDefHeader.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.defindex);
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
if (message.prefabs != null && message.prefabs.length)
for (var i = 0; i < message.prefabs.length; ++i)
$root.CMsgProtoDefID.encode(message.prefabs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.tags != null && message.tags.length)
for (var i = 0; i < message.tags.length; ++i)
writer.uint32(/* id 4, wireType 2 =*/34).string(message.tags[i]);
if (message.prefab_only != null && message.hasOwnProperty("prefab_only"))
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prefab_only);
if (message.variables != null && message.variables.length)
for (var i = 0; i < message.variables.length; ++i)
$root.CMsgVariableDefinition.encode(message.variables[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgProtoDefHeader message, length delimited. Does not implicitly {@link CMsgProtoDefHeader.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgProtoDefHeader
* @static
* @param {ICMsgProtoDefHeader} message CMsgProtoDefHeader message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgProtoDefHeader.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgProtoDefHeader message from the specified reader or buffer.
* @function decode
* @memberof CMsgProtoDefHeader
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgProtoDefHeader} CMsgProtoDefHeader
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgProtoDefHeader.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgProtoDefHeader();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.defindex = reader.uint32();
break;
case 2:
message.name = reader.string();
break;
case 3:
if (!(message.prefabs && message.prefabs.length))
message.prefabs = [];
message.prefabs.push($root.CMsgProtoDefID.decode(reader, reader.uint32()));
break;
case 4:
if (!(message.tags && message.tags.length))
message.tags = [];
message.tags.push(reader.string());
break;
case 5:
message.prefab_only = reader.bool();
break;
case 6:
if (!(message.variables && message.variables.length))
message.variables = [];
message.variables.push($root.CMsgVariableDefinition.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("defindex"))
throw $util.ProtocolError("missing required 'defindex'", { instance: message });
return message;
};
/**
* Decodes a CMsgProtoDefHeader message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgProtoDefHeader
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgProtoDefHeader} CMsgProtoDefHeader
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgProtoDefHeader.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgProtoDefHeader message.
* @function verify
* @memberof CMsgProtoDefHeader
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgProtoDefHeader.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isInteger(message.defindex))
return "defindex: integer expected";
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
if (message.prefabs != null && message.hasOwnProperty("prefabs")) {
if (!Array.isArray(message.prefabs))
return "prefabs: array expected";
for (var i = 0; i < message.prefabs.length; ++i) {
var error = $root.CMsgProtoDefID.verify(message.prefabs[i]);
if (error)
return "prefabs." + error;
}
}
if (message.tags != null && message.hasOwnProperty("tags")) {
if (!Array.isArray(message.tags))
return "tags: array expected";
for (var i = 0; i < message.tags.length; ++i)
if (!$util.isString(message.tags[i]))
return "tags: string[] expected";
}
if (message.prefab_only != null && message.hasOwnProperty("prefab_only"))
if (typeof message.prefab_only !== "boolean")
return "prefab_only: boolean expected";
if (message.variables != null && message.hasOwnProperty("variables")) {
if (!Array.isArray(message.variables))
return "variables: array expected";
for (var i = 0; i < message.variables.length; ++i) {
var error = $root.CMsgVariableDefinition.verify(message.variables[i]);
if (error)
return "variables." + error;
}
}
return null;
};
/**
* Creates a CMsgProtoDefHeader message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgProtoDefHeader
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgProtoDefHeader} CMsgProtoDefHeader
*/
CMsgProtoDefHeader.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgProtoDefHeader)
return object;
var message = new $root.CMsgProtoDefHeader();
if (object.defindex != null)
message.defindex = object.defindex >>> 0;
if (object.name != null)
message.name = String(object.name);
if (object.prefabs) {
if (!Array.isArray(object.prefabs))
throw TypeError(".CMsgProtoDefHeader.prefabs: array expected");
message.prefabs = [];
for (var i = 0; i < object.prefabs.length; ++i) {
if (typeof object.prefabs[i] !== "object")
throw TypeError(".CMsgProtoDefHeader.prefabs: object expected");
message.prefabs[i] = $root.CMsgProtoDefID.fromObject(object.prefabs[i]);
}
}
if (object.tags) {
if (!Array.isArray(object.tags))
throw TypeError(".CMsgProtoDefHeader.tags: array expected");
message.tags = [];
for (var i = 0; i < object.tags.length; ++i)
message.tags[i] = String(object.tags[i]);
}
if (object.prefab_only != null)
message.prefab_only = Boolean(object.prefab_only);
if (object.variables) {
if (!Array.isArray(object.variables))
throw TypeError(".CMsgProtoDefHeader.variables: array expected");
message.variables = [];
for (var i = 0; i < object.variables.length; ++i) {
if (typeof object.variables[i] !== "object")
throw TypeError(".CMsgProtoDefHeader.variables: object expected");
message.variables[i] = $root.CMsgVariableDefinition.fromObject(object.variables[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgProtoDefHeader message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgProtoDefHeader
* @static
* @param {CMsgProtoDefHeader} message CMsgProtoDefHeader
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgProtoDefHeader.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.prefabs = [];
object.tags = [];
object.variables = [];
}
if (options.defaults) {
object.defindex = 0;
object.name = "";
object.prefab_only = false;
}
if (message.defindex != null && message.hasOwnProperty("defindex"))
object.defindex = message.defindex;
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.prefabs && message.prefabs.length) {
object.prefabs = [];
for (var j = 0; j < message.prefabs.length; ++j)
object.prefabs[j] = $root.CMsgProtoDefID.toObject(message.prefabs[j], options);
}
if (message.tags && message.tags.length) {
object.tags = [];
for (var j = 0; j < message.tags.length; ++j)
object.tags[j] = message.tags[j];
}
if (message.prefab_only != null && message.hasOwnProperty("prefab_only"))
object.prefab_only = message.prefab_only;
if (message.variables && message.variables.length) {
object.variables = [];
for (var j = 0; j < message.variables.length; ++j)
object.variables[j] = $root.CMsgVariableDefinition.toObject(message.variables[j], options);
}
return object;
};
/**
* Converts this CMsgProtoDefHeader to JSON.
* @function toJSON
* @memberof CMsgProtoDefHeader
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgProtoDefHeader.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgProtoDefHeader;
})();
$root.CMsgValidTypes = (function() {
/**
* Properties of a CMsgValidTypes.
* @exports ICMsgValidTypes
* @interface ICMsgValidTypes
* @property {Array.<ProtoDefTypes>|null} [types] CMsgValidTypes types
*/
/**
* Constructs a new CMsgValidTypes.
* @exports CMsgValidTypes
* @classdesc Represents a CMsgValidTypes.
* @implements ICMsgValidTypes
* @constructor
* @param {ICMsgValidTypes=} [properties] Properties to set
*/
function CMsgValidTypes(properties) {
this.types = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgValidTypes types.
* @member {Array.<ProtoDefTypes>} types
* @memberof CMsgValidTypes
* @instance
*/
CMsgValidTypes.prototype.types = $util.emptyArray;
/**
* Creates a new CMsgValidTypes instance using the specified properties.
* @function create
* @memberof CMsgValidTypes
* @static
* @param {ICMsgValidTypes=} [properties] Properties to set
* @returns {CMsgValidTypes} CMsgValidTypes instance
*/
CMsgValidTypes.create = function create(properties) {
return new CMsgValidTypes(properties);
};
/**
* Encodes the specified CMsgValidTypes message. Does not implicitly {@link CMsgValidTypes.verify|verify} messages.
* @function encode
* @memberof CMsgValidTypes
* @static
* @param {ICMsgValidTypes} message CMsgValidTypes message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgValidTypes.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.types != null && message.types.length)
for (var i = 0; i < message.types.length; ++i)
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.types[i]);
return writer;
};
/**
* Encodes the specified CMsgValidTypes message, length delimited. Does not implicitly {@link CMsgValidTypes.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgValidTypes
* @static
* @param {ICMsgValidTypes} message CMsgValidTypes message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgValidTypes.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgValidTypes message from the specified reader or buffer.
* @function decode
* @memberof CMsgValidTypes
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgValidTypes} CMsgValidTypes
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgValidTypes.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgValidTypes();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.types && message.types.length))
message.types = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.types.push(reader.int32());
} else
message.types.push(reader.int32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgValidTypes message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgValidTypes
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgValidTypes} CMsgValidTypes
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgValidTypes.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgValidTypes message.
* @function verify
* @memberof CMsgValidTypes
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgValidTypes.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.types != null && message.hasOwnProperty("types")) {
if (!Array.isArray(message.types))
return "types: array expected";
for (var i = 0; i < message.types.length; ++i)
switch (message.types[i]) {
default:
return "types: enum value[] expected";
case 0:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
break;
}
}
return null;
};
/**
* Creates a CMsgValidTypes message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgValidTypes
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgValidTypes} CMsgValidTypes
*/
CMsgValidTypes.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgValidTypes)
return object;
var message = new $root.CMsgValidTypes();
if (object.types) {
if (!Array.isArray(object.types))
throw TypeError(".CMsgValidTypes.types: array expected");
message.types = [];
for (var i = 0; i < object.types.length; ++i)
switch (object.types[i]) {
default:
case "DEF_TYPE_QUEST_MAP_NODE":
case 0:
message.types[i] = 0;
break;
case "DEF_TYPE_QUEST_THEME":
case 2:
message.types[i] = 2;
break;
case "DEF_TYPE_QUEST_MAP_REGION":
case 3:
message.types[i] = 3;
break;
case "DEF_TYPE_QUEST":
case 4:
message.types[i] = 4;
break;
case "DEF_TYPE_QUEST_OBJECTIVE":
case 5:
message.types[i] = 5;
break;
case "DEF_TYPE_PAINTKIT_VARIABLES":
case 6:
message.types[i] = 6;
break;
case "DEF_TYPE_PAINTKIT_OPERATION":
case 7:
message.types[i] = 7;
break;
case "DEF_TYPE_PAINTKIT_ITEM_DEFINITION":
case 8:
message.types[i] = 8;
break;
case "DEF_TYPE_PAINTKIT_DEFINITION":
case 9:
message.types[i] = 9;
break;
case "DEF_TYPE_HEADER_ONLY":
case 10:
message.types[i] = 10;
break;
case "DEF_TYPE_QUEST_MAP_STORE_ITEM":
case 11:
message.types[i] = 11;
break;
case "DEF_TYPE_QUEST_MAP_STAR_TYPE":
case 12:
message.types[i] = 12;
break;
}
}
return message;
};
/**
* Creates a plain object from a CMsgValidTypes message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgValidTypes
* @static
* @param {CMsgValidTypes} message CMsgValidTypes
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgValidTypes.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.types = [];
if (message.types && message.types.length) {
object.types = [];
for (var j = 0; j < message.types.length; ++j)
object.types[j] = options.enums === String ? $root.ProtoDefTypes[message.types[j]] : message.types[j];
}
return object;
};
/**
* Converts this CMsgValidTypes to JSON.
* @function toJSON
* @memberof CMsgValidTypes
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgValidTypes.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgValidTypes;
})();
$root.CMsgProtoDefID = (function() {
/**
* Properties of a CMsgProtoDefID.
* @exports ICMsgProtoDefID
* @interface ICMsgProtoDefID
* @property {number|null} [defindex] CMsgProtoDefID defindex
* @property {ProtoDefTypes|null} [type] CMsgProtoDefID type
* @property {ICMsgQuestMapNodeDef|null} [instance_def_type_quest_map_node] CMsgProtoDefID instance_def_type_quest_map_node
* @property {ICMsgQuestTheme|null} [instance_def_type_quest_theme] CMsgProtoDefID instance_def_type_quest_theme
* @property {ICMsgQuestMapRegionDef|null} [instance_def_type_quest_map_region] CMsgProtoDefID instance_def_type_quest_map_region
* @property {ICMsgQuestDef|null} [instance_def_type_quest] CMsgProtoDefID instance_def_type_quest
* @property {ICMsgQuestObjectiveDef|null} [instance_def_type_quest_objective] CMsgProtoDefID instance_def_type_quest_objective
* @property {ICMsgPaintKit_Variables|null} [instance_def_type_paintkit_variables] CMsgProtoDefID instance_def_type_paintkit_variables
* @property {ICMsgPaintKit_Operation|null} [instance_def_type_paintkit_operation] CMsgProtoDefID instance_def_type_paintkit_operation
* @property {ICMsgPaintKit_ItemDefinition|null} [instance_def_type_paintkit_item_definition] CMsgProtoDefID instance_def_type_paintkit_item_definition
* @property {ICMsgPaintKit_Definition|null} [instance_def_type_paintkit_definition] CMsgProtoDefID instance_def_type_paintkit_definition
* @property {ICMsgHeaderOnly|null} [instance_def_type_header_only] CMsgProtoDefID instance_def_type_header_only
*/
/**
* Constructs a new CMsgProtoDefID.
* @exports CMsgProtoDefID
* @classdesc Represents a CMsgProtoDefID.
* @implements ICMsgProtoDefID
* @constructor
* @param {ICMsgProtoDefID=} [properties] Properties to set
*/
function CMsgProtoDefID(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]];
}
/**
* CMsgProtoDefID defindex.
* @member {number} defindex
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.defindex = 0;
/**
* CMsgProtoDefID type.
* @member {ProtoDefTypes} type
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.type = 0;
/**
* CMsgProtoDefID instance_def_type_quest_map_node.
* @member {ICMsgQuestMapNodeDef|null|undefined} instance_def_type_quest_map_node
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_quest_map_node = null;
/**
* CMsgProtoDefID instance_def_type_quest_theme.
* @member {ICMsgQuestTheme|null|undefined} instance_def_type_quest_theme
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_quest_theme = null;
/**
* CMsgProtoDefID instance_def_type_quest_map_region.
* @member {ICMsgQuestMapRegionDef|null|undefined} instance_def_type_quest_map_region
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_quest_map_region = null;
/**
* CMsgProtoDefID instance_def_type_quest.
* @member {ICMsgQuestDef|null|undefined} instance_def_type_quest
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_quest = null;
/**
* CMsgProtoDefID instance_def_type_quest_objective.
* @member {ICMsgQuestObjectiveDef|null|undefined} instance_def_type_quest_objective
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_quest_objective = null;
/**
* CMsgProtoDefID instance_def_type_paintkit_variables.
* @member {ICMsgPaintKit_Variables|null|undefined} instance_def_type_paintkit_variables
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_paintkit_variables = null;
/**
* CMsgProtoDefID instance_def_type_paintkit_operation.
* @member {ICMsgPaintKit_Operation|null|undefined} instance_def_type_paintkit_operation
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_paintkit_operation = null;
/**
* CMsgProtoDefID instance_def_type_paintkit_item_definition.
* @member {ICMsgPaintKit_ItemDefinition|null|undefined} instance_def_type_paintkit_item_definition
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_paintkit_item_definition = null;
/**
* CMsgProtoDefID instance_def_type_paintkit_definition.
* @member {ICMsgPaintKit_Definition|null|undefined} instance_def_type_paintkit_definition
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_paintkit_definition = null;
/**
* CMsgProtoDefID instance_def_type_header_only.
* @member {ICMsgHeaderOnly|null|undefined} instance_def_type_header_only
* @memberof CMsgProtoDefID
* @instance
*/
CMsgProtoDefID.prototype.instance_def_type_header_only = null;
// OneOf field names bound to virtual getters and setters
var $oneOfFields;
/**
* CMsgProtoDefID instance.
* @member {"instance_def_type_quest_map_node"|"instance_def_type_quest_theme"|"instance_def_type_quest_map_region"|"instance_def_type_quest"|"instance_def_type_quest_objective"|"instance_def_type_paintkit_variables"|"instance_def_type_paintkit_operation"|"instance_def_type_paintkit_item_definition"|"instance_def_type_paintkit_definition"|"instance_def_type_header_only"|undefined} instance
* @memberof CMsgProtoDefID
* @instance
*/
Object.defineProperty(CMsgProtoDefID.prototype, "instance", {
get: $util.oneOfGetter($oneOfFields = ["instance_def_type_quest_map_node", "instance_def_type_quest_theme", "instance_def_type_quest_map_region", "instance_def_type_quest", "instance_def_type_quest_objective", "instance_def_type_paintkit_variables", "instance_def_type_paintkit_operation", "instance_def_type_paintkit_item_definition", "instance_def_type_paintkit_definition", "instance_def_type_header_only"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Creates a new CMsgProtoDefID instance using the specified properties.
* @function create
* @memberof CMsgProtoDefID
* @static
* @param {ICMsgProtoDefID=} [properties] Properties to set
* @returns {CMsgProtoDefID} CMsgProtoDefID instance
*/
CMsgProtoDefID.create = function create(properties) {
return new CMsgProtoDefID(properties);
};
/**
* Encodes the specified CMsgProtoDefID message. Does not implicitly {@link CMsgProtoDefID.verify|verify} messages.
* @function encode
* @memberof CMsgProtoDefID
* @static
* @param {ICMsgProtoDefID} message CMsgProtoDefID message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgProtoDefID.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.defindex != null && message.hasOwnProperty("defindex"))
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.defindex);
if (message.type != null && message.hasOwnProperty("type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
if (message.instance_def_type_quest_map_node != null && message.hasOwnProperty("instance_def_type_quest_map_node"))
$root.CMsgQuestMapNodeDef.encode(message.instance_def_type_quest_map_node, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.instance_def_type_quest_theme != null && message.hasOwnProperty("instance_def_type_quest_theme"))
$root.CMsgQuestTheme.encode(message.instance_def_type_quest_theme, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.instance_def_type_quest_map_region != null && message.hasOwnProperty("instance_def_type_quest_map_region"))
$root.CMsgQuestMapRegionDef.encode(message.instance_def_type_quest_map_region, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.instance_def_type_quest != null && message.hasOwnProperty("instance_def_type_quest"))
$root.CMsgQuestDef.encode(message.instance_def_type_quest, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.instance_def_type_quest_objective != null && message.hasOwnProperty("instance_def_type_quest_objective"))
$root.CMsgQuestObjectiveDef.encode(message.instance_def_type_quest_objective, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
if (message.instance_def_type_paintkit_variables != null && message.hasOwnProperty("instance_def_type_paintkit_variables"))
$root.CMsgPaintKit_Variables.encode(message.instance_def_type_paintkit_variables, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.instance_def_type_paintkit_operation != null && message.hasOwnProperty("instance_def_type_paintkit_operation"))
$root.CMsgPaintKit_Operation.encode(message.instance_def_type_paintkit_operation, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
if (message.instance_def_type_paintkit_item_definition != null && message.hasOwnProperty("instance_def_type_paintkit_item_definition"))
$root.CMsgPaintKit_ItemDefinition.encode(message.instance_def_type_paintkit_item_definition, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
if (message.instance_def_type_paintkit_definition != null && message.hasOwnProperty("instance_def_type_paintkit_definition"))
$root.CMsgPaintKit_Definition.encode(message.instance_def_type_paintkit_definition, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
if (message.instance_def_type_header_only != null && message.hasOwnProperty("instance_def_type_header_only"))
$root.CMsgHeaderOnly.encode(message.instance_def_type_header_only, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgProtoDefID message, length delimited. Does not implicitly {@link CMsgProtoDefID.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgProtoDefID
* @static
* @param {ICMsgProtoDefID} message CMsgProtoDefID message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgProtoDefID.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgProtoDefID message from the specified reader or buffer.
* @function decode
* @memberof CMsgProtoDefID
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgProtoDefID} CMsgProtoDefID
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgProtoDefID.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgProtoDefID();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.defindex = reader.uint32();
break;
case 2:
message.type = reader.int32();
break;
case 3:
message.instance_def_type_quest_map_node = $root.CMsgQuestMapNodeDef.decode(reader, reader.uint32());
break;
case 5:
message.instance_def_type_quest_theme = $root.CMsgQuestTheme.decode(reader, reader.uint32());
break;
case 6:
message.instance_def_type_quest_map_region = $root.CMsgQuestMapRegionDef.decode(reader, reader.uint32());
break;
case 7:
message.instance_def_type_quest = $root.CMsgQuestDef.decode(reader, reader.uint32());
break;
case 8:
message.instance_def_type_quest_objective = $root.CMsgQuestObjectiveDef.decode(reader, reader.uint32());
break;
case 9:
message.instance_def_type_paintkit_variables = $root.CMsgPaintKit_Variables.decode(reader, reader.uint32());
break;
case 10:
message.instance_def_type_paintkit_operation = $root.CMsgPaintKit_Operation.decode(reader, reader.uint32());
break;
case 11:
message.instance_def_type_paintkit_item_definition = $root.CMsgPaintKit_ItemDefinition.decode(reader, reader.uint32());
break;
case 12:
message.instance_def_type_paintkit_definition = $root.CMsgPaintKit_Definition.decode(reader, reader.uint32());
break;
case 13:
message.instance_def_type_header_only = $root.CMsgHeaderOnly.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgProtoDefID message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgProtoDefID
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgProtoDefID} CMsgProtoDefID
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgProtoDefID.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgProtoDefID message.
* @function verify
* @memberof CMsgProtoDefID
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgProtoDefID.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
var properties = {};
if (message.defindex != null && message.hasOwnProperty("defindex"))
if (!$util.isInteger(message.defindex))
return "defindex: integer expected";
if (message.type != null && message.hasOwnProperty("type"))
switch (message.type) {
default:
return "type: enum value expected";
case 0:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
break;
}
if (message.instance_def_type_quest_map_node != null && message.hasOwnProperty("instance_def_type_quest_map_node")) {
properties.instance = 1;
{
var error = $root.CMsgQuestMapNodeDef.verify(message.instance_def_type_quest_map_node);
if (error)
return "instance_def_type_quest_map_node." + error;
}
}
if (message.instance_def_type_quest_theme != null && message.hasOwnProperty("instance_def_type_quest_theme")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgQuestTheme.verify(message.instance_def_type_quest_theme);
if (error)
return "instance_def_type_quest_theme." + error;
}
}
if (message.instance_def_type_quest_map_region != null && message.hasOwnProperty("instance_def_type_quest_map_region")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgQuestMapRegionDef.verify(message.instance_def_type_quest_map_region);
if (error)
return "instance_def_type_quest_map_region." + error;
}
}
if (message.instance_def_type_quest != null && message.hasOwnProperty("instance_def_type_quest")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgQuestDef.verify(message.instance_def_type_quest);
if (error)
return "instance_def_type_quest." + error;
}
}
if (message.instance_def_type_quest_objective != null && message.hasOwnProperty("instance_def_type_quest_objective")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgQuestObjectiveDef.verify(message.instance_def_type_quest_objective);
if (error)
return "instance_def_type_quest_objective." + error;
}
}
if (message.instance_def_type_paintkit_variables != null && message.hasOwnProperty("instance_def_type_paintkit_variables")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgPaintKit_Variables.verify(message.instance_def_type_paintkit_variables);
if (error)
return "instance_def_type_paintkit_variables." + error;
}
}
if (message.instance_def_type_paintkit_operation != null && message.hasOwnProperty("instance_def_type_paintkit_operation")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgPaintKit_Operation.verify(message.instance_def_type_paintkit_operation);
if (error)
return "instance_def_type_paintkit_operation." + error;
}
}
if (message.instance_def_type_paintkit_item_definition != null && message.hasOwnProperty("instance_def_type_paintkit_item_definition")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgPaintKit_ItemDefinition.verify(message.instance_def_type_paintkit_item_definition);
if (error)
return "instance_def_type_paintkit_item_definition." + error;
}
}
if (message.instance_def_type_paintkit_definition != null && message.hasOwnProperty("instance_def_type_paintkit_definition")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgPaintKit_Definition.verify(message.instance_def_type_paintkit_definition);
if (error)
return "instance_def_type_paintkit_definition." + error;
}
}
if (message.instance_def_type_header_only != null && message.hasOwnProperty("instance_def_type_header_only")) {
if (properties.instance === 1)
return "instance: multiple values";
properties.instance = 1;
{
var error = $root.CMsgHeaderOnly.verify(message.instance_def_type_header_only);
if (error)
return "instance_def_type_header_only." + error;
}
}
return null;
};
/**
* Creates a CMsgProtoDefID message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgProtoDefID
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgProtoDefID} CMsgProtoDefID
*/
CMsgProtoDefID.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgProtoDefID)
return object;
var message = new $root.CMsgProtoDefID();
if (object.defindex != null)
message.defindex = object.defindex >>> 0;
switch (object.type) {
case "DEF_TYPE_QUEST_MAP_NODE":
case 0:
message.type = 0;
break;
case "DEF_TYPE_QUEST_THEME":
case 2:
message.type = 2;
break;
case "DEF_TYPE_QUEST_MAP_REGION":
case 3:
message.type = 3;
break;
case "DEF_TYPE_QUEST":
case 4:
message.type = 4;
break;
case "DEF_TYPE_QUEST_OBJECTIVE":
case 5:
message.type = 5;
break;
case "DEF_TYPE_PAINTKIT_VARIABLES":
case 6:
message.type = 6;
break;
case "DEF_TYPE_PAINTKIT_OPERATION":
case 7:
message.type = 7;
break;
case "DEF_TYPE_PAINTKIT_ITEM_DEFINITION":
case 8:
message.type = 8;
break;
case "DEF_TYPE_PAINTKIT_DEFINITION":
case 9:
message.type = 9;
break;
case "DEF_TYPE_HEADER_ONLY":
case 10:
message.type = 10;
break;
case "DEF_TYPE_QUEST_MAP_STORE_ITEM":
case 11:
message.type = 11;
break;
case "DEF_TYPE_QUEST_MAP_STAR_TYPE":
case 12:
message.type = 12;
break;
}
if (object.instance_def_type_quest_map_node != null) {
if (typeof object.instance_def_type_quest_map_node !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_quest_map_node: object expected");
message.instance_def_type_quest_map_node = $root.CMsgQuestMapNodeDef.fromObject(object.instance_def_type_quest_map_node);
}
if (object.instance_def_type_quest_theme != null) {
if (typeof object.instance_def_type_quest_theme !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_quest_theme: object expected");
message.instance_def_type_quest_theme = $root.CMsgQuestTheme.fromObject(object.instance_def_type_quest_theme);
}
if (object.instance_def_type_quest_map_region != null) {
if (typeof object.instance_def_type_quest_map_region !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_quest_map_region: object expected");
message.instance_def_type_quest_map_region = $root.CMsgQuestMapRegionDef.fromObject(object.instance_def_type_quest_map_region);
}
if (object.instance_def_type_quest != null) {
if (typeof object.instance_def_type_quest !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_quest: object expected");
message.instance_def_type_quest = $root.CMsgQuestDef.fromObject(object.instance_def_type_quest);
}
if (object.instance_def_type_quest_objective != null) {
if (typeof object.instance_def_type_quest_objective !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_quest_objective: object expected");
message.instance_def_type_quest_objective = $root.CMsgQuestObjectiveDef.fromObject(object.instance_def_type_quest_objective);
}
if (object.instance_def_type_paintkit_variables != null) {
if (typeof object.instance_def_type_paintkit_variables !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_paintkit_variables: object expected");
message.instance_def_type_paintkit_variables = $root.CMsgPaintKit_Variables.fromObject(object.instance_def_type_paintkit_variables);
}
if (object.instance_def_type_paintkit_operation != null) {
if (typeof object.instance_def_type_paintkit_operation !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_paintkit_operation: object expected");
message.instance_def_type_paintkit_operation = $root.CMsgPaintKit_Operation.fromObject(object.instance_def_type_paintkit_operation);
}
if (object.instance_def_type_paintkit_item_definition != null) {
if (typeof object.instance_def_type_paintkit_item_definition !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_paintkit_item_definition: object expected");
message.instance_def_type_paintkit_item_definition = $root.CMsgPaintKit_ItemDefinition.fromObject(object.instance_def_type_paintkit_item_definition);
}
if (object.instance_def_type_paintkit_definition != null) {
if (typeof object.instance_def_type_paintkit_definition !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_paintkit_definition: object expected");
message.instance_def_type_paintkit_definition = $root.CMsgPaintKit_Definition.fromObject(object.instance_def_type_paintkit_definition);
}
if (object.instance_def_type_header_only != null) {
if (typeof object.instance_def_type_header_only !== "object")
throw TypeError(".CMsgProtoDefID.instance_def_type_header_only: object expected");
message.instance_def_type_header_only = $root.CMsgHeaderOnly.fromObject(object.instance_def_type_header_only);
}
return message;
};
/**
* Creates a plain object from a CMsgProtoDefID message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgProtoDefID
* @static
* @param {CMsgProtoDefID} message CMsgProtoDefID
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgProtoDefID.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.defindex = 0;
object.type = options.enums === String ? "DEF_TYPE_QUEST_MAP_NODE" : 0;
}
if (message.defindex != null && message.hasOwnProperty("defindex"))
object.defindex = message.defindex;
if (message.type != null && message.hasOwnProperty("type"))
object.type = options.enums === String ? $root.ProtoDefTypes[message.type] : message.type;
if (message.instance_def_type_quest_map_node != null && message.hasOwnProperty("instance_def_type_quest_map_node")) {
object.instance_def_type_quest_map_node = $root.CMsgQuestMapNodeDef.toObject(message.instance_def_type_quest_map_node, options);
if (options.oneofs)
object.instance = "instance_def_type_quest_map_node";
}
if (message.instance_def_type_quest_theme != null && message.hasOwnProperty("instance_def_type_quest_theme")) {
object.instance_def_type_quest_theme = $root.CMsgQuestTheme.toObject(message.instance_def_type_quest_theme, options);
if (options.oneofs)
object.instance = "instance_def_type_quest_theme";
}
if (message.instance_def_type_quest_map_region != null && message.hasOwnProperty("instance_def_type_quest_map_region")) {
object.instance_def_type_quest_map_region = $root.CMsgQuestMapRegionDef.toObject(message.instance_def_type_quest_map_region, options);
if (options.oneofs)
object.instance = "instance_def_type_quest_map_region";
}
if (message.instance_def_type_quest != null && message.hasOwnProperty("instance_def_type_quest")) {
object.instance_def_type_quest = $root.CMsgQuestDef.toObject(message.instance_def_type_quest, options);
if (options.oneofs)
object.instance = "instance_def_type_quest";
}
if (message.instance_def_type_quest_objective != null && message.hasOwnProperty("instance_def_type_quest_objective")) {
object.instance_def_type_quest_objective = $root.CMsgQuestObjectiveDef.toObject(message.instance_def_type_quest_objective, options);
if (options.oneofs)
object.instance = "instance_def_type_quest_objective";
}
if (message.instance_def_type_paintkit_variables != null && message.hasOwnProperty("instance_def_type_paintkit_variables")) {
object.instance_def_type_paintkit_variables = $root.CMsgPaintKit_Variables.toObject(message.instance_def_type_paintkit_variables, options);
if (options.oneofs)
object.instance = "instance_def_type_paintkit_variables";
}
if (message.instance_def_type_paintkit_operation != null && message.hasOwnProperty("instance_def_type_paintkit_operation")) {
object.instance_def_type_paintkit_operation = $root.CMsgPaintKit_Operation.toObject(message.instance_def_type_paintkit_operation, options);
if (options.oneofs)
object.instance = "instance_def_type_paintkit_operation";
}
if (message.instance_def_type_paintkit_item_definition != null && message.hasOwnProperty("instance_def_type_paintkit_item_definition")) {
object.instance_def_type_paintkit_item_definition = $root.CMsgPaintKit_ItemDefinition.toObject(message.instance_def_type_paintkit_item_definition, options);
if (options.oneofs)
object.instance = "instance_def_type_paintkit_item_definition";
}
if (message.instance_def_type_paintkit_definition != null && message.hasOwnProperty("instance_def_type_paintkit_definition")) {
object.instance_def_type_paintkit_definition = $root.CMsgPaintKit_Definition.toObject(message.instance_def_type_paintkit_definition, options);
if (options.oneofs)
object.instance = "instance_def_type_paintkit_definition";
}
if (message.instance_def_type_header_only != null && message.hasOwnProperty("instance_def_type_header_only")) {
object.instance_def_type_header_only = $root.CMsgHeaderOnly.toObject(message.instance_def_type_header_only, options);
if (options.oneofs)
object.instance = "instance_def_type_header_only";
}
return object;
};
/**
* Converts this CMsgProtoDefID to JSON.
* @function toJSON
* @memberof CMsgProtoDefID
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgProtoDefID.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgProtoDefID;
})();
$root.CMsgQuestObjectiveDef = (function() {
/**
* Properties of a CMsgQuestObjectiveDef.
* @exports ICMsgQuestObjectiveDef
* @interface ICMsgQuestObjectiveDef
* @property {ICMsgProtoDefHeader} header CMsgQuestObjectiveDef header
* @property {string|null} [loc_desctoken] CMsgQuestObjectiveDef loc_desctoken
* @property {number|null} [points] CMsgQuestObjectiveDef points
* @property {number|null} [conditions_defindex] CMsgQuestObjectiveDef conditions_defindex
* @property {Array.<string>|null} [map] CMsgQuestObjectiveDef map
* @property {Array.<CMsgQuestObjectiveDef.ETF2GameModes>|null} [game_mode] CMsgQuestObjectiveDef game_mode
* @property {CMsgQuestObjectiveDef.ETF2Team|null} [team] CMsgQuestObjectiveDef team
* @property {Array.<ICMsgVarField>|null} [condition_vars] CMsgQuestObjectiveDef condition_vars
* @property {Array.<ICMsgVarField>|null} [classes_vars] CMsgQuestObjectiveDef classes_vars
* @property {Array.<CMsgQuestObjectiveDef.ETF2Conditions>|null} [conditions] CMsgQuestObjectiveDef conditions
* @property {LogicalOperation|null} [condition_logic] CMsgQuestObjectiveDef condition_logic
* @property {Array.<string>|null} [item_name] CMsgQuestObjectiveDef item_name
* @property {LogicalOperation|null} [item_logic] CMsgQuestObjectiveDef item_logic
* @property {number|null} [jump_state] CMsgQuestObjectiveDef jump_state
*/
/**
* Constructs a new CMsgQuestObjectiveDef.
* @exports CMsgQuestObjectiveDef
* @classdesc Represents a CMsgQuestObjectiveDef.
* @implements ICMsgQuestObjectiveDef
* @constructor
* @param {ICMsgQuestObjectiveDef=} [properties] Properties to set
*/
function CMsgQuestObjectiveDef(properties) {
this.map = [];
this.game_mode = [];
this.condition_vars = [];
this.classes_vars = [];
this.conditions = [];
this.item_name = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgQuestObjectiveDef header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.header = null;
/**
* CMsgQuestObjectiveDef loc_desctoken.
* @member {string} loc_desctoken
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.loc_desctoken = "";
/**
* CMsgQuestObjectiveDef points.
* @member {number} points
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.points = 0;
/**
* CMsgQuestObjectiveDef conditions_defindex.
* @member {number} conditions_defindex
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.conditions_defindex = 0;
/**
* CMsgQuestObjectiveDef map.
* @member {Array.<string>} map
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.map = $util.emptyArray;
/**
* CMsgQuestObjectiveDef game_mode.
* @member {Array.<CMsgQuestObjectiveDef.ETF2GameModes>} game_mode
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.game_mode = $util.emptyArray;
/**
* CMsgQuestObjectiveDef team.
* @member {CMsgQuestObjectiveDef.ETF2Team} team
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.team = 2;
/**
* CMsgQuestObjectiveDef condition_vars.
* @member {Array.<ICMsgVarField>} condition_vars
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.condition_vars = $util.emptyArray;
/**
* CMsgQuestObjectiveDef classes_vars.
* @member {Array.<ICMsgVarField>} classes_vars
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.classes_vars = $util.emptyArray;
/**
* CMsgQuestObjectiveDef conditions.
* @member {Array.<CMsgQuestObjectiveDef.ETF2Conditions>} conditions
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.conditions = $util.emptyArray;
/**
* CMsgQuestObjectiveDef condition_logic.
* @member {LogicalOperation} condition_logic
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.condition_logic = 0;
/**
* CMsgQuestObjectiveDef item_name.
* @member {Array.<string>} item_name
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.item_name = $util.emptyArray;
/**
* CMsgQuestObjectiveDef item_logic.
* @member {LogicalOperation} item_logic
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.item_logic = 0;
/**
* CMsgQuestObjectiveDef jump_state.
* @member {number} jump_state
* @memberof CMsgQuestObjectiveDef
* @instance
*/
CMsgQuestObjectiveDef.prototype.jump_state = 0;
/**
* Creates a new CMsgQuestObjectiveDef instance using the specified properties.
* @function create
* @memberof CMsgQuestObjectiveDef
* @static
* @param {ICMsgQuestObjectiveDef=} [properties] Properties to set
* @returns {CMsgQuestObjectiveDef} CMsgQuestObjectiveDef instance
*/
CMsgQuestObjectiveDef.create = function create(properties) {
return new CMsgQuestObjectiveDef(properties);
};
/**
* Encodes the specified CMsgQuestObjectiveDef message. Does not implicitly {@link CMsgQuestObjectiveDef.verify|verify} messages.
* @function encode
* @memberof CMsgQuestObjectiveDef
* @static
* @param {ICMsgQuestObjectiveDef} message CMsgQuestObjectiveDef message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestObjectiveDef.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.loc_desctoken != null && message.hasOwnProperty("loc_desctoken"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.loc_desctoken);
if (message.points != null && message.hasOwnProperty("points"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.points);
if (message.conditions_defindex != null && message.hasOwnProperty("conditions_defindex"))
writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.conditions_defindex);
if (message.map != null && message.map.length)
for (var i = 0; i < message.map.length; ++i)
writer.uint32(/* id 8, wireType 2 =*/66).string(message.map[i]);
if (message.game_mode != null && message.game_mode.length)
for (var i = 0; i < message.game_mode.length; ++i)
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.game_mode[i]);
if (message.team != null && message.hasOwnProperty("team"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.team);
if (message.condition_vars != null && message.condition_vars.length)
for (var i = 0; i < message.condition_vars.length; ++i)
$root.CMsgVarField.encode(message.condition_vars[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
if (message.classes_vars != null && message.classes_vars.length)
for (var i = 0; i < message.classes_vars.length; ++i)
$root.CMsgVarField.encode(message.classes_vars[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
if (message.conditions != null && message.conditions.length)
for (var i = 0; i < message.conditions.length; ++i)
writer.uint32(/* id 13, wireType 0 =*/104).int32(message.conditions[i]);
if (message.condition_logic != null && message.hasOwnProperty("condition_logic"))
writer.uint32(/* id 14, wireType 0 =*/112).int32(message.condition_logic);
if (message.item_name != null && message.item_name.length)
for (var i = 0; i < message.item_name.length; ++i)
writer.uint32(/* id 15, wireType 2 =*/122).string(message.item_name[i]);
if (message.item_logic != null && message.hasOwnProperty("item_logic"))
writer.uint32(/* id 16, wireType 0 =*/128).int32(message.item_logic);
if (message.jump_state != null && message.hasOwnProperty("jump_state"))
writer.uint32(/* id 17, wireType 0 =*/136).uint32(message.jump_state);
return writer;
};
/**
* Encodes the specified CMsgQuestObjectiveDef message, length delimited. Does not implicitly {@link CMsgQuestObjectiveDef.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestObjectiveDef
* @static
* @param {ICMsgQuestObjectiveDef} message CMsgQuestObjectiveDef message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestObjectiveDef.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestObjectiveDef message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestObjectiveDef
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestObjectiveDef} CMsgQuestObjectiveDef
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestObjectiveDef.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestObjectiveDef();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
message.loc_desctoken = reader.string();
break;
case 3:
message.points = reader.uint32();
break;
case 5:
message.conditions_defindex = reader.uint32();
break;
case 8:
if (!(message.map && message.map.length))
message.map = [];
message.map.push(reader.string());
break;
case 9:
if (!(message.game_mode && message.game_mode.length))
message.game_mode = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.game_mode.push(reader.int32());
} else
message.game_mode.push(reader.int32());
break;
case 10:
message.team = reader.int32();
break;
case 11:
if (!(message.condition_vars && message.condition_vars.length))
message.condition_vars = [];
message.condition_vars.push($root.CMsgVarField.decode(reader, reader.uint32()));
break;
case 12:
if (!(message.classes_vars && message.classes_vars.length))
message.classes_vars = [];
message.classes_vars.push($root.CMsgVarField.decode(reader, reader.uint32()));
break;
case 13:
if (!(message.conditions && message.conditions.length))
message.conditions = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.conditions.push(reader.int32());
} else
message.conditions.push(reader.int32());
break;
case 14:
message.condition_logic = reader.int32();
break;
case 15:
if (!(message.item_name && message.item_name.length))
message.item_name = [];
message.item_name.push(reader.string());
break;
case 16:
message.item_logic = reader.int32();
break;
case 17:
message.jump_state = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestObjectiveDef message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestObjectiveDef
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestObjectiveDef} CMsgQuestObjectiveDef
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestObjectiveDef.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestObjectiveDef message.
* @function verify
* @memberof CMsgQuestObjectiveDef
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestObjectiveDef.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.loc_desctoken != null && message.hasOwnProperty("loc_desctoken"))
if (!$util.isString(message.loc_desctoken))
return "loc_desctoken: string expected";
if (message.points != null && message.hasOwnProperty("points"))
if (!$util.isInteger(message.points))
return "points: integer expected";
if (message.conditions_defindex != null && message.hasOwnProperty("conditions_defindex"))
if (!$util.isInteger(message.conditions_defindex))
return "conditions_defindex: integer expected";
if (message.map != null && message.hasOwnProperty("map")) {
if (!Array.isArray(message.map))
return "map: array expected";
for (var i = 0; i < message.map.length; ++i)
if (!$util.isString(message.map[i]))
return "map: string[] expected";
}
if (message.game_mode != null && message.hasOwnProperty("game_mode")) {
if (!Array.isArray(message.game_mode))
return "game_mode: array expected";
for (var i = 0; i < message.game_mode.length; ++i)
switch (message.game_mode[i]) {
default:
return "game_mode: enum value[] expected";
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
break;
}
}
if (message.team != null && message.hasOwnProperty("team"))
switch (message.team) {
default:
return "team: enum value expected";
case 2:
case 3:
break;
}
if (message.condition_vars != null && message.hasOwnProperty("condition_vars")) {
if (!Array.isArray(message.condition_vars))
return "condition_vars: array expected";
for (var i = 0; i < message.condition_vars.length; ++i) {
var error = $root.CMsgVarField.verify(message.condition_vars[i]);
if (error)
return "condition_vars." + error;
}
}
if (message.classes_vars != null && message.hasOwnProperty("classes_vars")) {
if (!Array.isArray(message.classes_vars))
return "classes_vars: array expected";
for (var i = 0; i < message.classes_vars.length; ++i) {
var error = $root.CMsgVarField.verify(message.classes_vars[i]);
if (error)
return "classes_vars." + error;
}
}
if (message.conditions != null && message.hasOwnProperty("conditions")) {
if (!Array.isArray(message.conditions))
return "conditions: array expected";
for (var i = 0; i < message.conditions.length; ++i)
switch (message.conditions[i]) {
default:
return "conditions: enum value[] expected";
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
case 58:
case 59:
case 60:
case 61:
case 62:
case 63:
case 64:
case 65:
case 66:
case 67:
case 68:
case 69:
case 70:
case 71:
case 72:
case 73:
case 74:
case 75:
case 76:
case 77:
case 78:
case 79:
case 80:
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
case 90:
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 97:
case 98:
case 99:
case 100:
case 101:
case 102:
case 103:
case 104:
case 105:
case 106:
case 107:
case 108:
case 109:
case 110:
case 111:
case 112:
case 113:
case 114:
case 115:
case 116:
case 117:
case 118:
case 119:
case 120:
case 121:
case 122:
case 123:
case 126:
case 127:
case 128:
case 129:
case 130:
case 131:
break;
}
}
if (message.condition_logic != null && message.hasOwnProperty("condition_logic"))
switch (message.condition_logic) {
default:
return "condition_logic: enum value expected";
case 0:
case 1:
case 2:
break;
}
if (message.item_name != null && message.hasOwnProperty("item_name")) {
if (!Array.isArray(message.item_name))
return "item_name: array expected";
for (var i = 0; i < message.item_name.length; ++i)
if (!$util.isString(message.item_name[i]))
return "item_name: string[] expected";
}
if (message.item_logic != null && message.hasOwnProperty("item_logic"))
switch (message.item_logic) {
default:
return "item_logic: enum value expected";
case 0:
case 1:
case 2:
break;
}
if (message.jump_state != null && message.hasOwnProperty("jump_state"))
if (!$util.isInteger(message.jump_state))
return "jump_state: integer expected";
return null;
};
/**
* Creates a CMsgQuestObjectiveDef message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestObjectiveDef
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestObjectiveDef} CMsgQuestObjectiveDef
*/
CMsgQuestObjectiveDef.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestObjectiveDef)
return object;
var message = new $root.CMsgQuestObjectiveDef();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgQuestObjectiveDef.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.loc_desctoken != null)
message.loc_desctoken = String(object.loc_desctoken);
if (object.points != null)
message.points = object.points >>> 0;
if (object.conditions_defindex != null)
message.conditions_defindex = object.conditions_defindex >>> 0;
if (object.map) {
if (!Array.isArray(object.map))
throw TypeError(".CMsgQuestObjectiveDef.map: array expected");
message.map = [];
for (var i = 0; i < object.map.length; ++i)
message.map[i] = String(object.map[i]);
}
if (object.game_mode) {
if (!Array.isArray(object.game_mode))
throw TypeError(".CMsgQuestObjectiveDef.game_mode: array expected");
message.game_mode = [];
for (var i = 0; i < object.game_mode.length; ++i)
switch (object.game_mode[i]) {
default:
case "kGameCategory_Escort":
case 0:
message.game_mode[i] = 0;
break;
case "kGameCategory_CTF":
case 1:
message.game_mode[i] = 1;
break;
case "kGameCategory_AttackDefense":
case 2:
message.game_mode[i] = 2;
break;
case "kGameCategory_Koth":
case 3:
message.game_mode[i] = 3;
break;
case "kGameCategory_CP":
case 4:
message.game_mode[i] = 4;
break;
case "kGameCategory_EscortRace":
case 5:
message.game_mode[i] = 5;
break;
case "kGameCategory_EventMix":
case 6:
message.game_mode[i] = 6;
break;
case "kGameCategory_SD":
case 7:
message.game_mode[i] = 7;
break;
case "kGameCategory_Quickplay":
case 8:
message.game_mode[i] = 8;
break;
case "kGameCategory_Event247":
case 9:
message.game_mode[i] = 9;
break;
case "kGameCategory_Arena":
case 10:
message.game_mode[i] = 10;
break;
case "kGameCategory_RobotDestruction":
case 11:
message.game_mode[i] = 11;
break;
case "kGameCategory_Powerup":
case 12:
message.game_mode[i] = 12;
break;
case "kGameCategory_Featured":
case 13:
message.game_mode[i] = 13;
break;
case "kGameCategory_Passtime":
case 14:
message.game_mode[i] = 14;
break;
case "kGameCategory_Community_Update":
case 15:
message.game_mode[i] = 15;
break;
case "kGameCategory_Misc":
case 16:
message.game_mode[i] = 16;
break;
case "kGameCategory_Competitive_6v6":
case 17:
message.game_mode[i] = 17;
break;
case "kGameCategory_Other":
case 18:
message.game_mode[i] = 18;
break;
case "kGameCategory_Halloween":
case 19:
message.game_mode[i] = 19;
break;
}
}
switch (object.team) {
case "TF_TEAM_RED":
case 2:
message.team = 2;
break;
case "TF_TEAM_BLUE":
case 3:
message.team = 3;
break;
}
if (object.condition_vars) {
if (!Array.isArray(object.condition_vars))
throw TypeError(".CMsgQuestObjectiveDef.condition_vars: array expected");
message.condition_vars = [];
for (var i = 0; i < object.condition_vars.length; ++i) {
if (typeof object.condition_vars[i] !== "object")
throw TypeError(".CMsgQuestObjectiveDef.condition_vars: object expected");
message.condition_vars[i] = $root.CMsgVarField.fromObject(object.condition_vars[i]);
}
}
if (object.classes_vars) {
if (!Array.isArray(object.classes_vars))
throw TypeError(".CMsgQuestObjectiveDef.classes_vars: array expected");
message.classes_vars = [];
for (var i = 0; i < object.classes_vars.length; ++i) {
if (typeof object.classes_vars[i] !== "object")
throw TypeError(".CMsgQuestObjectiveDef.classes_vars: object expected");
message.classes_vars[i] = $root.CMsgVarField.fromObject(object.classes_vars[i]);
}
}
if (object.conditions) {
if (!Array.isArray(object.conditions))
throw TypeError(".CMsgQuestObjectiveDef.conditions: array expected");
message.conditions = [];
for (var i = 0; i < object.conditions.length; ++i)
switch (object.conditions[i]) {
default:
case "TF_COND_AIMING":
case 0:
message.conditions[i] = 0;
break;
case "TF_COND_ZOOMED":
case 1:
message.conditions[i] = 1;
break;
case "TF_COND_DISGUISING":
case 2:
message.conditions[i] = 2;
break;
case "TF_COND_DISGUISED":
case 3:
message.conditions[i] = 3;
break;
case "TF_COND_STEALTHED":
case 4:
message.conditions[i] = 4;
break;
case "TF_COND_INVULNERABLE":
case 5:
message.conditions[i] = 5;
break;
case "TF_COND_TELEPORTED":
case 6:
message.conditions[i] = 6;
break;
case "TF_COND_TAUNTING":
case 7:
message.conditions[i] = 7;
break;
case "TF_COND_INVULNERABLE_WEARINGOFF":
case 8:
message.conditions[i] = 8;
break;
case "TF_COND_STEALTHED_BLINK":
case 9:
message.conditions[i] = 9;
break;
case "TF_COND_SELECTED_TO_TELEPORT":
case 10:
message.conditions[i] = 10;
break;
case "TF_COND_CRITBOOSTED":
case 11:
message.conditions[i] = 11;
break;
case "TF_COND_TMPDAMAGEBONUS":
case 12:
message.conditions[i] = 12;
break;
case "TF_COND_FEIGN_DEATH":
case 13:
message.conditions[i] = 13;
break;
case "TF_COND_PHASE":
case 14:
message.conditions[i] = 14;
break;
case "TF_COND_STUNNED":
case 15:
message.conditions[i] = 15;
break;
case "TF_COND_OFFENSEBUFF":
case 16:
message.conditions[i] = 16;
break;
case "TF_COND_SHIELD_CHARGE":
case 17:
message.conditions[i] = 17;
break;
case "TF_COND_DEMO_BUFF":
case 18:
message.conditions[i] = 18;
break;
case "TF_COND_ENERGY_BUFF":
case 19:
message.conditions[i] = 19;
break;
case "TF_COND_RADIUSHEAL":
case 20:
message.conditions[i] = 20;
break;
case "TF_COND_HEALTH_BUFF":
case 21:
message.conditions[i] = 21;
break;
case "TF_COND_BURNING":
case 22:
message.conditions[i] = 22;
break;
case "TF_COND_HEALTH_OVERHEALED":
case 23:
message.conditions[i] = 23;
break;
case "TF_COND_URINE":
case 24:
message.conditions[i] = 24;
break;
case "TF_COND_BLEEDING":
case 25:
message.conditions[i] = 25;
break;
case "TF_COND_DEFENSEBUFF":
case 26:
message.conditions[i] = 26;
break;
case "TF_COND_MAD_MILK":
case 27:
message.conditions[i] = 27;
break;
case "TF_COND_MEGAHEAL":
case 28:
message.conditions[i] = 28;
break;
case "TF_COND_REGENONDAMAGEBUFF":
case 29:
message.conditions[i] = 29;
break;
case "TF_COND_MARKEDFORDEATH":
case 30:
message.conditions[i] = 30;
break;
case "TF_COND_NOHEALINGDAMAGEBUFF":
case 31:
message.conditions[i] = 31;
break;
case "TF_COND_SPEED_BOOST":
case 32:
message.conditions[i] = 32;
break;
case "TF_COND_CRITBOOSTED_PUMPKIN":
case 33:
message.conditions[i] = 33;
break;
case "TF_COND_CRITBOOSTED_USER_BUFF":
case 34:
message.conditions[i] = 34;
break;
case "TF_COND_CRITBOOSTED_DEMO_CHARGE":
case 35:
message.conditions[i] = 35;
break;
case "TF_COND_SODAPOPPER_HYPE":
case 36:
message.conditions[i] = 36;
break;
case "TF_COND_CRITBOOSTED_FIRST_BLOOD":
case 37:
message.conditions[i] = 37;
break;
case "TF_COND_CRITBOOSTED_BONUS_TIME":
case 38:
message.conditions[i] = 38;
break;
case "TF_COND_CRITBOOSTED_CTF_CAPTURE":
case 39:
message.conditions[i] = 39;
break;
case "TF_COND_CRITBOOSTED_ON_KILL":
case 40:
message.conditions[i] = 40;
break;
case "TF_COND_CANNOT_SWITCH_FROM_MELEE":
case 41:
message.conditions[i] = 41;
break;
case "TF_COND_DEFENSEBUFF_NO_CRIT_BLOCK":
case 42:
message.conditions[i] = 42;
break;
case "TF_COND_REPROGRAMMED":
case 43:
message.conditions[i] = 43;
break;
case "TF_COND_CRITBOOSTED_RAGE_BUFF":
case 44:
message.conditions[i] = 44;
break;
case "TF_COND_DEFENSEBUFF_HIGH":
case 45:
message.conditions[i] = 45;
break;
case "TF_COND_SNIPERCHARGE_RAGE_BUFF":
case 46:
message.conditions[i] = 46;
break;
case "TF_COND_DISGUISE_WEARINGOFF":
case 47:
message.conditions[i] = 47;
break;
case "TF_COND_MARKEDFORDEATH_SILENT":
case 48:
message.conditions[i] = 48;
break;
case "TF_COND_DISGUISED_AS_DISPENSER":
case 49:
message.conditions[i] = 49;
break;
case "TF_COND_SAPPED":
case 50:
message.conditions[i] = 50;
break;
case "TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED":
case 51:
message.conditions[i] = 51;
break;
case "TF_COND_INVULNERABLE_USER_BUFF":
case 52:
message.conditions[i] = 52;
break;
case "TF_COND_HALLOWEEN_BOMB_HEAD":
case 53:
message.conditions[i] = 53;
break;
case "TF_COND_HALLOWEEN_THRILLER":
case 54:
message.conditions[i] = 54;
break;
case "TF_COND_RADIUSHEAL_ON_DAMAGE":
case 55:
message.conditions[i] = 55;
break;
case "TF_COND_CRITBOOSTED_CARD_EFFECT":
case 56:
message.conditions[i] = 56;
break;
case "TF_COND_INVULNERABLE_CARD_EFFECT":
case 57:
message.conditions[i] = 57;
break;
case "TF_COND_MEDIGUN_UBER_BULLET_RESIST":
case 58:
message.conditions[i] = 58;
break;
case "TF_COND_MEDIGUN_UBER_BLAST_RESIST":
case 59:
message.conditions[i] = 59;
break;
case "TF_COND_MEDIGUN_UBER_FIRE_RESIST":
case 60:
message.conditions[i] = 60;
break;
case "TF_COND_MEDIGUN_SMALL_BULLET_RESIST":
case 61:
message.conditions[i] = 61;
break;
case "TF_COND_MEDIGUN_SMALL_BLAST_RESIST":
case 62:
message.conditions[i] = 62;
break;
case "TF_COND_MEDIGUN_SMALL_FIRE_RESIST":
case 63:
message.conditions[i] = 63;
break;
case "TF_COND_STEALTHED_USER_BUFF":
case 64:
message.conditions[i] = 64;
break;
case "TF_COND_MEDIGUN_DEBUFF":
case 65:
message.conditions[i] = 65;
break;
case "TF_COND_STEALTHED_USER_BUFF_FADING":
case 66:
message.conditions[i] = 66;
break;
case "TF_COND_BULLET_IMMUNE":
case 67:
message.conditions[i] = 67;
break;
case "TF_COND_BLAST_IMMUNE":
case 68:
message.conditions[i] = 68;
break;
case "TF_COND_FIRE_IMMUNE":
case 69:
message.conditions[i] = 69;
break;
case "TF_COND_PREVENT_DEATH":
case 70:
message.conditions[i] = 70;
break;
case "TF_COND_MVM_BOT_STUN_RADIOWAVE":
case 71:
message.conditions[i] = 71;
break;
case "TF_COND_HALLOWEEN_SPEED_BOOST":
case 72:
message.conditions[i] = 72;
break;
case "TF_COND_HALLOWEEN_QUICK_HEAL":
case 73:
message.conditions[i] = 73;
break;
case "TF_COND_HALLOWEEN_GIANT":
case 74:
message.conditions[i] = 74;
break;
case "TF_COND_HALLOWEEN_TINY":
case 75:
message.conditions[i] = 75;
break;
case "TF_COND_HALLOWEEN_IN_HELL":
case 76:
message.conditions[i] = 76;
break;
case "TF_COND_HALLOWEEN_GHOST_MODE":
case 77:
message.conditions[i] = 77;
break;
case "TF_COND_MINICRITBOOSTED_ON_KILL":
case 78:
message.conditions[i] = 78;
break;
case "TF_COND_OBSCURED_SMOKE":
case 79:
message.conditions[i] = 79;
break;
case "TF_COND_PARACHUTE_ACTIVE":
case 80:
message.conditions[i] = 80;
break;
case "TF_COND_BLASTJUMPING":
case 81:
message.conditions[i] = 81;
break;
case "TF_COND_HALLOWEEN_KART":
case 82:
message.conditions[i] = 82;
break;
case "TF_COND_HALLOWEEN_KART_DASH":
case 83:
message.conditions[i] = 83;
break;
case "TF_COND_BALLOON_HEAD":
case 84:
message.conditions[i] = 84;
break;
case "TF_COND_MELEE_ONLY":
case 85:
message.conditions[i] = 85;
break;
case "TF_COND_SWIMMING_CURSE":
case 86:
message.conditions[i] = 86;
break;
case "TF_COND_FREEZE_INPUT":
case 87:
message.conditions[i] = 87;
break;
case "TF_COND_HALLOWEEN_KART_CAGE":
case 88:
message.conditions[i] = 88;
break;
case "TF_COND_DONOTUSE_0":
case 89:
message.conditions[i] = 89;
break;
case "TF_COND_RUNE_STRENGTH":
case 90:
message.conditions[i] = 90;
break;
case "TF_COND_RUNE_HASTE":
case 91:
message.conditions[i] = 91;
break;
case "TF_COND_RUNE_REGEN":
case 92:
message.conditions[i] = 92;
break;
case "TF_COND_RUNE_RESIST":
case 93:
message.conditions[i] = 93;
break;
case "TF_COND_RUNE_VAMPIRE":
case 94:
message.conditions[i] = 94;
break;
case "TF_COND_RUNE_REFLECT":
case 95:
message.conditions[i] = 95;
break;
case "TF_COND_RUNE_PRECISION":
case 96:
message.conditions[i] = 96;
break;
case "TF_COND_RUNE_AGILITY":
case 97:
message.conditions[i] = 97;
break;
case "TF_COND_GRAPPLINGHOOK":
case 98:
message.conditions[i] = 98;
break;
case "TF_COND_GRAPPLINGHOOK_SAFEFALL":
case 99:
message.conditions[i] = 99;
break;
case "TF_COND_GRAPPLINGHOOK_LATCHED":
case 100:
message.conditions[i] = 100;
break;
case "TF_COND_GRAPPLINGHOOK_BLEEDING":
case 101:
message.conditions[i] = 101;
break;
case "TF_COND_AFTERBURN_IMMUNE":
case 102:
message.conditions[i] = 102;
break;
case "TF_COND_RUNE_KNOCKOUT":
case 103:
message.conditions[i] = 103;
break;
case "TF_COND_RUNE_IMBALANCE":
case 104:
message.conditions[i] = 104;
break;
case "TF_COND_CRITBOOSTED_RUNE_TEMP":
case 105:
message.conditions[i] = 105;
break;
case "TF_COND_PASSTIME_INTERCEPTION":
case 106:
message.conditions[i] = 106;
break;
case "TF_COND_SWIMMING_NO_EFFECTS":
case 107:
message.conditions[i] = 107;
break;
case "TF_COND_PURGATORY":
case 108:
message.conditions[i] = 108;
break;
case "TF_COND_RUNE_KING":
case 109:
message.conditions[i] = 109;
break;
case "TF_COND_RUNE_PLAGUE":
case 110:
message.conditions[i] = 110;
break;
case "TF_COND_RUNE_SUPERNOVA":
case 111:
message.conditions[i] = 111;
break;
case "TF_COND_PLAGUE":
case 112:
message.conditions[i] = 112;
break;
case "TF_COND_KING_BUFFED":
case 113:
message.conditions[i] = 113;
break;
case "TF_COND_TEAM_GLOWS":
case 114:
message.conditions[i] = 114;
break;
case "TF_COND_KNOCKED_INTO_AIR":
case 115:
message.conditions[i] = 115;
break;
case "TF_COND_COMPETITIVE_WINNER":
case 116:
message.conditions[i] = 116;
break;
case "TF_COND_COMPETITIVE_LOSER":
case 117:
message.conditions[i] = 117;
break;
case "TF_COND_HEALING_DEBUFF":
case 118:
message.conditions[i] = 118;
break;
case "TF_COND_PASSTIME_PENALTY_DEBUFF":
case 119:
message.conditions[i] = 119;
break;
case "TF_COND_PARACHUTE_DEPLOYED":
case 120:
message.conditions[i] = 120;
break;
case "TF_COND_NO_COMBAT_SPEED_BOOST":
case 121:
message.conditions[i] = 121;
break;
case "TF_COND_TRANQ_SPY_BOOST":
case 122:
message.conditions[i] = 122;
break;
case "TF_COND_TRANQ_MARKED":
case 123:
message.conditions[i] = 123;
break;
case "TF_COND_ROCKETPACK":
case 126:
message.conditions[i] = 126;
break;
case "TF_COND_ROCKETPACK_PASSENGER":
case 127:
message.conditions[i] = 127;
break;
case "TF_COND_STEALTHED_PHASE":
case 128:
message.conditions[i] = 128;
break;
case "TF_COND_CLIP_OVERLOAD":
case 129:
message.conditions[i] = 129;
break;
case "TF_COND_SPY_CLASS_STEAL":
case 130:
message.conditions[i] = 130;
break;
case "TF_COND_GAS":
case 131:
message.conditions[i] = 131;
break;
}
}
switch (object.condition_logic) {
case "AND":
case 0:
message.condition_logic = 0;
break;
case "OR":
case 1:
message.condition_logic = 1;
break;
case "NOT":
case 2:
message.condition_logic = 2;
break;
}
if (object.item_name) {
if (!Array.isArray(object.item_name))
throw TypeError(".CMsgQuestObjectiveDef.item_name: array expected");
message.item_name = [];
for (var i = 0; i < object.item_name.length; ++i)
message.item_name[i] = String(object.item_name[i]);
}
switch (object.item_logic) {
case "AND":
case 0:
message.item_logic = 0;
break;
case "OR":
case 1:
message.item_logic = 1;
break;
case "NOT":
case 2:
message.item_logic = 2;
break;
}
if (object.jump_state != null)
message.jump_state = object.jump_state >>> 0;
return message;
};
/**
* Creates a plain object from a CMsgQuestObjectiveDef message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestObjectiveDef
* @static
* @param {CMsgQuestObjectiveDef} message CMsgQuestObjectiveDef
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestObjectiveDef.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.map = [];
object.game_mode = [];
object.condition_vars = [];
object.classes_vars = [];
object.conditions = [];
object.item_name = [];
}
if (options.defaults) {
object.header = null;
object.loc_desctoken = "";
object.points = 0;
object.conditions_defindex = 0;
object.team = options.enums === String ? "TF_TEAM_RED" : 2;
object.condition_logic = options.enums === String ? "AND" : 0;
object.item_logic = options.enums === String ? "AND" : 0;
object.jump_state = 0;
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.loc_desctoken != null && message.hasOwnProperty("loc_desctoken"))
object.loc_desctoken = message.loc_desctoken;
if (message.points != null && message.hasOwnProperty("points"))
object.points = message.points;
if (message.conditions_defindex != null && message.hasOwnProperty("conditions_defindex"))
object.conditions_defindex = message.conditions_defindex;
if (message.map && message.map.length) {
object.map = [];
for (var j = 0; j < message.map.length; ++j)
object.map[j] = message.map[j];
}
if (message.game_mode && message.game_mode.length) {
object.game_mode = [];
for (var j = 0; j < message.game_mode.length; ++j)
object.game_mode[j] = options.enums === String ? $root.CMsgQuestObjectiveDef.ETF2GameModes[message.game_mode[j]] : message.game_mode[j];
}
if (message.team != null && message.hasOwnProperty("team"))
object.team = options.enums === String ? $root.CMsgQuestObjectiveDef.ETF2Team[message.team] : message.team;
if (message.condition_vars && message.condition_vars.length) {
object.condition_vars = [];
for (var j = 0; j < message.condition_vars.length; ++j)
object.condition_vars[j] = $root.CMsgVarField.toObject(message.condition_vars[j], options);
}
if (message.classes_vars && message.classes_vars.length) {
object.classes_vars = [];
for (var j = 0; j < message.classes_vars.length; ++j)
object.classes_vars[j] = $root.CMsgVarField.toObject(message.classes_vars[j], options);
}
if (message.conditions && message.conditions.length) {
object.conditions = [];
for (var j = 0; j < message.conditions.length; ++j)
object.conditions[j] = options.enums === String ? $root.CMsgQuestObjectiveDef.ETF2Conditions[message.conditions[j]] : message.conditions[j];
}
if (message.condition_logic != null && message.hasOwnProperty("condition_logic"))
object.condition_logic = options.enums === String ? $root.LogicalOperation[message.condition_logic] : message.condition_logic;
if (message.item_name && message.item_name.length) {
object.item_name = [];
for (var j = 0; j < message.item_name.length; ++j)
object.item_name[j] = message.item_name[j];
}
if (message.item_logic != null && message.hasOwnProperty("item_logic"))
object.item_logic = options.enums === String ? $root.LogicalOperation[message.item_logic] : message.item_logic;
if (message.jump_state != null && message.hasOwnProperty("jump_state"))
object.jump_state = message.jump_state;
return object;
};
/**
* Converts this CMsgQuestObjectiveDef to JSON.
* @function toJSON
* @memberof CMsgQuestObjectiveDef
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestObjectiveDef.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* ETF2GameModes enum.
* @name CMsgQuestObjectiveDef.ETF2GameModes
* @enum {string}
* @property {number} kGameCategory_Escort=0 kGameCategory_Escort value
* @property {number} kGameCategory_CTF=1 kGameCategory_CTF value
* @property {number} kGameCategory_AttackDefense=2 kGameCategory_AttackDefense value
* @property {number} kGameCategory_Koth=3 kGameCategory_Koth value
* @property {number} kGameCategory_CP=4 kGameCategory_CP value
* @property {number} kGameCategory_EscortRace=5 kGameCategory_EscortRace value
* @property {number} kGameCategory_EventMix=6 kGameCategory_EventMix value
* @property {number} kGameCategory_SD=7 kGameCategory_SD value
* @property {number} kGameCategory_Quickplay=8 kGameCategory_Quickplay value
* @property {number} kGameCategory_Event247=9 kGameCategory_Event247 value
* @property {number} kGameCategory_Arena=10 kGameCategory_Arena value
* @property {number} kGameCategory_RobotDestruction=11 kGameCategory_RobotDestruction value
* @property {number} kGameCategory_Powerup=12 kGameCategory_Powerup value
* @property {number} kGameCategory_Featured=13 kGameCategory_Featured value
* @property {number} kGameCategory_Passtime=14 kGameCategory_Passtime value
* @property {number} kGameCategory_Community_Update=15 kGameCategory_Community_Update value
* @property {number} kGameCategory_Misc=16 kGameCategory_Misc value
* @property {number} kGameCategory_Competitive_6v6=17 kGameCategory_Competitive_6v6 value
* @property {number} kGameCategory_Other=18 kGameCategory_Other value
* @property {number} kGameCategory_Halloween=19 kGameCategory_Halloween value
*/
CMsgQuestObjectiveDef.ETF2GameModes = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "kGameCategory_Escort"] = 0;
values[valuesById[1] = "kGameCategory_CTF"] = 1;
values[valuesById[2] = "kGameCategory_AttackDefense"] = 2;
values[valuesById[3] = "kGameCategory_Koth"] = 3;
values[valuesById[4] = "kGameCategory_CP"] = 4;
values[valuesById[5] = "kGameCategory_EscortRace"] = 5;
values[valuesById[6] = "kGameCategory_EventMix"] = 6;
values[valuesById[7] = "kGameCategory_SD"] = 7;
values[valuesById[8] = "kGameCategory_Quickplay"] = 8;
values[valuesById[9] = "kGameCategory_Event247"] = 9;
values[valuesById[10] = "kGameCategory_Arena"] = 10;
values[valuesById[11] = "kGameCategory_RobotDestruction"] = 11;
values[valuesById[12] = "kGameCategory_Powerup"] = 12;
values[valuesById[13] = "kGameCategory_Featured"] = 13;
values[valuesById[14] = "kGameCategory_Passtime"] = 14;
values[valuesById[15] = "kGameCategory_Community_Update"] = 15;
values[valuesById[16] = "kGameCategory_Misc"] = 16;
values[valuesById[17] = "kGameCategory_Competitive_6v6"] = 17;
values[valuesById[18] = "kGameCategory_Other"] = 18;
values[valuesById[19] = "kGameCategory_Halloween"] = 19;
return values;
})();
/**
* ETF2Conditions enum.
* @name CMsgQuestObjectiveDef.ETF2Conditions
* @enum {string}
* @property {number} TF_COND_AIMING=0 TF_COND_AIMING value
* @property {number} TF_COND_ZOOMED=1 TF_COND_ZOOMED value
* @property {number} TF_COND_DISGUISING=2 TF_COND_DISGUISING value
* @property {number} TF_COND_DISGUISED=3 TF_COND_DISGUISED value
* @property {number} TF_COND_STEALTHED=4 TF_COND_STEALTHED value
* @property {number} TF_COND_INVULNERABLE=5 TF_COND_INVULNERABLE value
* @property {number} TF_COND_TELEPORTED=6 TF_COND_TELEPORTED value
* @property {number} TF_COND_TAUNTING=7 TF_COND_TAUNTING value
* @property {number} TF_COND_INVULNERABLE_WEARINGOFF=8 TF_COND_INVULNERABLE_WEARINGOFF value
* @property {number} TF_COND_STEALTHED_BLINK=9 TF_COND_STEALTHED_BLINK value
* @property {number} TF_COND_SELECTED_TO_TELEPORT=10 TF_COND_SELECTED_TO_TELEPORT value
* @property {number} TF_COND_CRITBOOSTED=11 TF_COND_CRITBOOSTED value
* @property {number} TF_COND_TMPDAMAGEBONUS=12 TF_COND_TMPDAMAGEBONUS value
* @property {number} TF_COND_FEIGN_DEATH=13 TF_COND_FEIGN_DEATH value
* @property {number} TF_COND_PHASE=14 TF_COND_PHASE value
* @property {number} TF_COND_STUNNED=15 TF_COND_STUNNED value
* @property {number} TF_COND_OFFENSEBUFF=16 TF_COND_OFFENSEBUFF value
* @property {number} TF_COND_SHIELD_CHARGE=17 TF_COND_SHIELD_CHARGE value
* @property {number} TF_COND_DEMO_BUFF=18 TF_COND_DEMO_BUFF value
* @property {number} TF_COND_ENERGY_BUFF=19 TF_COND_ENERGY_BUFF value
* @property {number} TF_COND_RADIUSHEAL=20 TF_COND_RADIUSHEAL value
* @property {number} TF_COND_HEALTH_BUFF=21 TF_COND_HEALTH_BUFF value
* @property {number} TF_COND_BURNING=22 TF_COND_BURNING value
* @property {number} TF_COND_HEALTH_OVERHEALED=23 TF_COND_HEALTH_OVERHEALED value
* @property {number} TF_COND_URINE=24 TF_COND_URINE value
* @property {number} TF_COND_BLEEDING=25 TF_COND_BLEEDING value
* @property {number} TF_COND_DEFENSEBUFF=26 TF_COND_DEFENSEBUFF value
* @property {number} TF_COND_MAD_MILK=27 TF_COND_MAD_MILK value
* @property {number} TF_COND_MEGAHEAL=28 TF_COND_MEGAHEAL value
* @property {number} TF_COND_REGENONDAMAGEBUFF=29 TF_COND_REGENONDAMAGEBUFF value
* @property {number} TF_COND_MARKEDFORDEATH=30 TF_COND_MARKEDFORDEATH value
* @property {number} TF_COND_NOHEALINGDAMAGEBUFF=31 TF_COND_NOHEALINGDAMAGEBUFF value
* @property {number} TF_COND_SPEED_BOOST=32 TF_COND_SPEED_BOOST value
* @property {number} TF_COND_CRITBOOSTED_PUMPKIN=33 TF_COND_CRITBOOSTED_PUMPKIN value
* @property {number} TF_COND_CRITBOOSTED_USER_BUFF=34 TF_COND_CRITBOOSTED_USER_BUFF value
* @property {number} TF_COND_CRITBOOSTED_DEMO_CHARGE=35 TF_COND_CRITBOOSTED_DEMO_CHARGE value
* @property {number} TF_COND_SODAPOPPER_HYPE=36 TF_COND_SODAPOPPER_HYPE value
* @property {number} TF_COND_CRITBOOSTED_FIRST_BLOOD=37 TF_COND_CRITBOOSTED_FIRST_BLOOD value
* @property {number} TF_COND_CRITBOOSTED_BONUS_TIME=38 TF_COND_CRITBOOSTED_BONUS_TIME value
* @property {number} TF_COND_CRITBOOSTED_CTF_CAPTURE=39 TF_COND_CRITBOOSTED_CTF_CAPTURE value
* @property {number} TF_COND_CRITBOOSTED_ON_KILL=40 TF_COND_CRITBOOSTED_ON_KILL value
* @property {number} TF_COND_CANNOT_SWITCH_FROM_MELEE=41 TF_COND_CANNOT_SWITCH_FROM_MELEE value
* @property {number} TF_COND_DEFENSEBUFF_NO_CRIT_BLOCK=42 TF_COND_DEFENSEBUFF_NO_CRIT_BLOCK value
* @property {number} TF_COND_REPROGRAMMED=43 TF_COND_REPROGRAMMED value
* @property {number} TF_COND_CRITBOOSTED_RAGE_BUFF=44 TF_COND_CRITBOOSTED_RAGE_BUFF value
* @property {number} TF_COND_DEFENSEBUFF_HIGH=45 TF_COND_DEFENSEBUFF_HIGH value
* @property {number} TF_COND_SNIPERCHARGE_RAGE_BUFF=46 TF_COND_SNIPERCHARGE_RAGE_BUFF value
* @property {number} TF_COND_DISGUISE_WEARINGOFF=47 TF_COND_DISGUISE_WEARINGOFF value
* @property {number} TF_COND_MARKEDFORDEATH_SILENT=48 TF_COND_MARKEDFORDEATH_SILENT value
* @property {number} TF_COND_DISGUISED_AS_DISPENSER=49 TF_COND_DISGUISED_AS_DISPENSER value
* @property {number} TF_COND_SAPPED=50 TF_COND_SAPPED value
* @property {number} TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED=51 TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED value
* @property {number} TF_COND_INVULNERABLE_USER_BUFF=52 TF_COND_INVULNERABLE_USER_BUFF value
* @property {number} TF_COND_HALLOWEEN_BOMB_HEAD=53 TF_COND_HALLOWEEN_BOMB_HEAD value
* @property {number} TF_COND_HALLOWEEN_THRILLER=54 TF_COND_HALLOWEEN_THRILLER value
* @property {number} TF_COND_RADIUSHEAL_ON_DAMAGE=55 TF_COND_RADIUSHEAL_ON_DAMAGE value
* @property {number} TF_COND_CRITBOOSTED_CARD_EFFECT=56 TF_COND_CRITBOOSTED_CARD_EFFECT value
* @property {number} TF_COND_INVULNERABLE_CARD_EFFECT=57 TF_COND_INVULNERABLE_CARD_EFFECT value
* @property {number} TF_COND_MEDIGUN_UBER_BULLET_RESIST=58 TF_COND_MEDIGUN_UBER_BULLET_RESIST value
* @property {number} TF_COND_MEDIGUN_UBER_BLAST_RESIST=59 TF_COND_MEDIGUN_UBER_BLAST_RESIST value
* @property {number} TF_COND_MEDIGUN_UBER_FIRE_RESIST=60 TF_COND_MEDIGUN_UBER_FIRE_RESIST value
* @property {number} TF_COND_MEDIGUN_SMALL_BULLET_RESIST=61 TF_COND_MEDIGUN_SMALL_BULLET_RESIST value
* @property {number} TF_COND_MEDIGUN_SMALL_BLAST_RESIST=62 TF_COND_MEDIGUN_SMALL_BLAST_RESIST value
* @property {number} TF_COND_MEDIGUN_SMALL_FIRE_RESIST=63 TF_COND_MEDIGUN_SMALL_FIRE_RESIST value
* @property {number} TF_COND_STEALTHED_USER_BUFF=64 TF_COND_STEALTHED_USER_BUFF value
* @property {number} TF_COND_MEDIGUN_DEBUFF=65 TF_COND_MEDIGUN_DEBUFF value
* @property {number} TF_COND_STEALTHED_USER_BUFF_FADING=66 TF_COND_STEALTHED_USER_BUFF_FADING value
* @property {number} TF_COND_BULLET_IMMUNE=67 TF_COND_BULLET_IMMUNE value
* @property {number} TF_COND_BLAST_IMMUNE=68 TF_COND_BLAST_IMMUNE value
* @property {number} TF_COND_FIRE_IMMUNE=69 TF_COND_FIRE_IMMUNE value
* @property {number} TF_COND_PREVENT_DEATH=70 TF_COND_PREVENT_DEATH value
* @property {number} TF_COND_MVM_BOT_STUN_RADIOWAVE=71 TF_COND_MVM_BOT_STUN_RADIOWAVE value
* @property {number} TF_COND_HALLOWEEN_SPEED_BOOST=72 TF_COND_HALLOWEEN_SPEED_BOOST value
* @property {number} TF_COND_HALLOWEEN_QUICK_HEAL=73 TF_COND_HALLOWEEN_QUICK_HEAL value
* @property {number} TF_COND_HALLOWEEN_GIANT=74 TF_COND_HALLOWEEN_GIANT value
* @property {number} TF_COND_HALLOWEEN_TINY=75 TF_COND_HALLOWEEN_TINY value
* @property {number} TF_COND_HALLOWEEN_IN_HELL=76 TF_COND_HALLOWEEN_IN_HELL value
* @property {number} TF_COND_HALLOWEEN_GHOST_MODE=77 TF_COND_HALLOWEEN_GHOST_MODE value
* @property {number} TF_COND_MINICRITBOOSTED_ON_KILL=78 TF_COND_MINICRITBOOSTED_ON_KILL value
* @property {number} TF_COND_OBSCURED_SMOKE=79 TF_COND_OBSCURED_SMOKE value
* @property {number} TF_COND_PARACHUTE_ACTIVE=80 TF_COND_PARACHUTE_ACTIVE value
* @property {number} TF_COND_BLASTJUMPING=81 TF_COND_BLASTJUMPING value
* @property {number} TF_COND_HALLOWEEN_KART=82 TF_COND_HALLOWEEN_KART value
* @property {number} TF_COND_HALLOWEEN_KART_DASH=83 TF_COND_HALLOWEEN_KART_DASH value
* @property {number} TF_COND_BALLOON_HEAD=84 TF_COND_BALLOON_HEAD value
* @property {number} TF_COND_MELEE_ONLY=85 TF_COND_MELEE_ONLY value
* @property {number} TF_COND_SWIMMING_CURSE=86 TF_COND_SWIMMING_CURSE value
* @property {number} TF_COND_FREEZE_INPUT=87 TF_COND_FREEZE_INPUT value
* @property {number} TF_COND_HALLOWEEN_KART_CAGE=88 TF_COND_HALLOWEEN_KART_CAGE value
* @property {number} TF_COND_DONOTUSE_0=89 TF_COND_DONOTUSE_0 value
* @property {number} TF_COND_RUNE_STRENGTH=90 TF_COND_RUNE_STRENGTH value
* @property {number} TF_COND_RUNE_HASTE=91 TF_COND_RUNE_HASTE value
* @property {number} TF_COND_RUNE_REGEN=92 TF_COND_RUNE_REGEN value
* @property {number} TF_COND_RUNE_RESIST=93 TF_COND_RUNE_RESIST value
* @property {number} TF_COND_RUNE_VAMPIRE=94 TF_COND_RUNE_VAMPIRE value
* @property {number} TF_COND_RUNE_REFLECT=95 TF_COND_RUNE_REFLECT value
* @property {number} TF_COND_RUNE_PRECISION=96 TF_COND_RUNE_PRECISION value
* @property {number} TF_COND_RUNE_AGILITY=97 TF_COND_RUNE_AGILITY value
* @property {number} TF_COND_GRAPPLINGHOOK=98 TF_COND_GRAPPLINGHOOK value
* @property {number} TF_COND_GRAPPLINGHOOK_SAFEFALL=99 TF_COND_GRAPPLINGHOOK_SAFEFALL value
* @property {number} TF_COND_GRAPPLINGHOOK_LATCHED=100 TF_COND_GRAPPLINGHOOK_LATCHED value
* @property {number} TF_COND_GRAPPLINGHOOK_BLEEDING=101 TF_COND_GRAPPLINGHOOK_BLEEDING value
* @property {number} TF_COND_AFTERBURN_IMMUNE=102 TF_COND_AFTERBURN_IMMUNE value
* @property {number} TF_COND_RUNE_KNOCKOUT=103 TF_COND_RUNE_KNOCKOUT value
* @property {number} TF_COND_RUNE_IMBALANCE=104 TF_COND_RUNE_IMBALANCE value
* @property {number} TF_COND_CRITBOOSTED_RUNE_TEMP=105 TF_COND_CRITBOOSTED_RUNE_TEMP value
* @property {number} TF_COND_PASSTIME_INTERCEPTION=106 TF_COND_PASSTIME_INTERCEPTION value
* @property {number} TF_COND_SWIMMING_NO_EFFECTS=107 TF_COND_SWIMMING_NO_EFFECTS value
* @property {number} TF_COND_PURGATORY=108 TF_COND_PURGATORY value
* @property {number} TF_COND_RUNE_KING=109 TF_COND_RUNE_KING value
* @property {number} TF_COND_RUNE_PLAGUE=110 TF_COND_RUNE_PLAGUE value
* @property {number} TF_COND_RUNE_SUPERNOVA=111 TF_COND_RUNE_SUPERNOVA value
* @property {number} TF_COND_PLAGUE=112 TF_COND_PLAGUE value
* @property {number} TF_COND_KING_BUFFED=113 TF_COND_KING_BUFFED value
* @property {number} TF_COND_TEAM_GLOWS=114 TF_COND_TEAM_GLOWS value
* @property {number} TF_COND_KNOCKED_INTO_AIR=115 TF_COND_KNOCKED_INTO_AIR value
* @property {number} TF_COND_COMPETITIVE_WINNER=116 TF_COND_COMPETITIVE_WINNER value
* @property {number} TF_COND_COMPETITIVE_LOSER=117 TF_COND_COMPETITIVE_LOSER value
* @property {number} TF_COND_HEALING_DEBUFF=118 TF_COND_HEALING_DEBUFF value
* @property {number} TF_COND_PASSTIME_PENALTY_DEBUFF=119 TF_COND_PASSTIME_PENALTY_DEBUFF value
* @property {number} TF_COND_PARACHUTE_DEPLOYED=120 TF_COND_PARACHUTE_DEPLOYED value
* @property {number} TF_COND_NO_COMBAT_SPEED_BOOST=121 TF_COND_NO_COMBAT_SPEED_BOOST value
* @property {number} TF_COND_TRANQ_SPY_BOOST=122 TF_COND_TRANQ_SPY_BOOST value
* @property {number} TF_COND_TRANQ_MARKED=123 TF_COND_TRANQ_MARKED value
* @property {number} TF_COND_ROCKETPACK=126 TF_COND_ROCKETPACK value
* @property {number} TF_COND_ROCKETPACK_PASSENGER=127 TF_COND_ROCKETPACK_PASSENGER value
* @property {number} TF_COND_STEALTHED_PHASE=128 TF_COND_STEALTHED_PHASE value
* @property {number} TF_COND_CLIP_OVERLOAD=129 TF_COND_CLIP_OVERLOAD value
* @property {number} TF_COND_SPY_CLASS_STEAL=130 TF_COND_SPY_CLASS_STEAL value
* @property {number} TF_COND_GAS=131 TF_COND_GAS value
*/
CMsgQuestObjectiveDef.ETF2Conditions = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "TF_COND_AIMING"] = 0;
values[valuesById[1] = "TF_COND_ZOOMED"] = 1;
values[valuesById[2] = "TF_COND_DISGUISING"] = 2;
values[valuesById[3] = "TF_COND_DISGUISED"] = 3;
values[valuesById[4] = "TF_COND_STEALTHED"] = 4;
values[valuesById[5] = "TF_COND_INVULNERABLE"] = 5;
values[valuesById[6] = "TF_COND_TELEPORTED"] = 6;
values[valuesById[7] = "TF_COND_TAUNTING"] = 7;
values[valuesById[8] = "TF_COND_INVULNERABLE_WEARINGOFF"] = 8;
values[valuesById[9] = "TF_COND_STEALTHED_BLINK"] = 9;
values[valuesById[10] = "TF_COND_SELECTED_TO_TELEPORT"] = 10;
values[valuesById[11] = "TF_COND_CRITBOOSTED"] = 11;
values[valuesById[12] = "TF_COND_TMPDAMAGEBONUS"] = 12;
values[valuesById[13] = "TF_COND_FEIGN_DEATH"] = 13;
values[valuesById[14] = "TF_COND_PHASE"] = 14;
values[valuesById[15] = "TF_COND_STUNNED"] = 15;
values[valuesById[16] = "TF_COND_OFFENSEBUFF"] = 16;
values[valuesById[17] = "TF_COND_SHIELD_CHARGE"] = 17;
values[valuesById[18] = "TF_COND_DEMO_BUFF"] = 18;
values[valuesById[19] = "TF_COND_ENERGY_BUFF"] = 19;
values[valuesById[20] = "TF_COND_RADIUSHEAL"] = 20;
values[valuesById[21] = "TF_COND_HEALTH_BUFF"] = 21;
values[valuesById[22] = "TF_COND_BURNING"] = 22;
values[valuesById[23] = "TF_COND_HEALTH_OVERHEALED"] = 23;
values[valuesById[24] = "TF_COND_URINE"] = 24;
values[valuesById[25] = "TF_COND_BLEEDING"] = 25;
values[valuesById[26] = "TF_COND_DEFENSEBUFF"] = 26;
values[valuesById[27] = "TF_COND_MAD_MILK"] = 27;
values[valuesById[28] = "TF_COND_MEGAHEAL"] = 28;
values[valuesById[29] = "TF_COND_REGENONDAMAGEBUFF"] = 29;
values[valuesById[30] = "TF_COND_MARKEDFORDEATH"] = 30;
values[valuesById[31] = "TF_COND_NOHEALINGDAMAGEBUFF"] = 31;
values[valuesById[32] = "TF_COND_SPEED_BOOST"] = 32;
values[valuesById[33] = "TF_COND_CRITBOOSTED_PUMPKIN"] = 33;
values[valuesById[34] = "TF_COND_CRITBOOSTED_USER_BUFF"] = 34;
values[valuesById[35] = "TF_COND_CRITBOOSTED_DEMO_CHARGE"] = 35;
values[valuesById[36] = "TF_COND_SODAPOPPER_HYPE"] = 36;
values[valuesById[37] = "TF_COND_CRITBOOSTED_FIRST_BLOOD"] = 37;
values[valuesById[38] = "TF_COND_CRITBOOSTED_BONUS_TIME"] = 38;
values[valuesById[39] = "TF_COND_CRITBOOSTED_CTF_CAPTURE"] = 39;
values[valuesById[40] = "TF_COND_CRITBOOSTED_ON_KILL"] = 40;
values[valuesById[41] = "TF_COND_CANNOT_SWITCH_FROM_MELEE"] = 41;
values[valuesById[42] = "TF_COND_DEFENSEBUFF_NO_CRIT_BLOCK"] = 42;
values[valuesById[43] = "TF_COND_REPROGRAMMED"] = 43;
values[valuesById[44] = "TF_COND_CRITBOOSTED_RAGE_BUFF"] = 44;
values[valuesById[45] = "TF_COND_DEFENSEBUFF_HIGH"] = 45;
values[valuesById[46] = "TF_COND_SNIPERCHARGE_RAGE_BUFF"] = 46;
values[valuesById[47] = "TF_COND_DISGUISE_WEARINGOFF"] = 47;
values[valuesById[48] = "TF_COND_MARKEDFORDEATH_SILENT"] = 48;
values[valuesById[49] = "TF_COND_DISGUISED_AS_DISPENSER"] = 49;
values[valuesById[50] = "TF_COND_SAPPED"] = 50;
values[valuesById[51] = "TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED"] = 51;
values[valuesById[52] = "TF_COND_INVULNERABLE_USER_BUFF"] = 52;
values[valuesById[53] = "TF_COND_HALLOWEEN_BOMB_HEAD"] = 53;
values[valuesById[54] = "TF_COND_HALLOWEEN_THRILLER"] = 54;
values[valuesById[55] = "TF_COND_RADIUSHEAL_ON_DAMAGE"] = 55;
values[valuesById[56] = "TF_COND_CRITBOOSTED_CARD_EFFECT"] = 56;
values[valuesById[57] = "TF_COND_INVULNERABLE_CARD_EFFECT"] = 57;
values[valuesById[58] = "TF_COND_MEDIGUN_UBER_BULLET_RESIST"] = 58;
values[valuesById[59] = "TF_COND_MEDIGUN_UBER_BLAST_RESIST"] = 59;
values[valuesById[60] = "TF_COND_MEDIGUN_UBER_FIRE_RESIST"] = 60;
values[valuesById[61] = "TF_COND_MEDIGUN_SMALL_BULLET_RESIST"] = 61;
values[valuesById[62] = "TF_COND_MEDIGUN_SMALL_BLAST_RESIST"] = 62;
values[valuesById[63] = "TF_COND_MEDIGUN_SMALL_FIRE_RESIST"] = 63;
values[valuesById[64] = "TF_COND_STEALTHED_USER_BUFF"] = 64;
values[valuesById[65] = "TF_COND_MEDIGUN_DEBUFF"] = 65;
values[valuesById[66] = "TF_COND_STEALTHED_USER_BUFF_FADING"] = 66;
values[valuesById[67] = "TF_COND_BULLET_IMMUNE"] = 67;
values[valuesById[68] = "TF_COND_BLAST_IMMUNE"] = 68;
values[valuesById[69] = "TF_COND_FIRE_IMMUNE"] = 69;
values[valuesById[70] = "TF_COND_PREVENT_DEATH"] = 70;
values[valuesById[71] = "TF_COND_MVM_BOT_STUN_RADIOWAVE"] = 71;
values[valuesById[72] = "TF_COND_HALLOWEEN_SPEED_BOOST"] = 72;
values[valuesById[73] = "TF_COND_HALLOWEEN_QUICK_HEAL"] = 73;
values[valuesById[74] = "TF_COND_HALLOWEEN_GIANT"] = 74;
values[valuesById[75] = "TF_COND_HALLOWEEN_TINY"] = 75;
values[valuesById[76] = "TF_COND_HALLOWEEN_IN_HELL"] = 76;
values[valuesById[77] = "TF_COND_HALLOWEEN_GHOST_MODE"] = 77;
values[valuesById[78] = "TF_COND_MINICRITBOOSTED_ON_KILL"] = 78;
values[valuesById[79] = "TF_COND_OBSCURED_SMOKE"] = 79;
values[valuesById[80] = "TF_COND_PARACHUTE_ACTIVE"] = 80;
values[valuesById[81] = "TF_COND_BLASTJUMPING"] = 81;
values[valuesById[82] = "TF_COND_HALLOWEEN_KART"] = 82;
values[valuesById[83] = "TF_COND_HALLOWEEN_KART_DASH"] = 83;
values[valuesById[84] = "TF_COND_BALLOON_HEAD"] = 84;
values[valuesById[85] = "TF_COND_MELEE_ONLY"] = 85;
values[valuesById[86] = "TF_COND_SWIMMING_CURSE"] = 86;
values[valuesById[87] = "TF_COND_FREEZE_INPUT"] = 87;
values[valuesById[88] = "TF_COND_HALLOWEEN_KART_CAGE"] = 88;
values[valuesById[89] = "TF_COND_DONOTUSE_0"] = 89;
values[valuesById[90] = "TF_COND_RUNE_STRENGTH"] = 90;
values[valuesById[91] = "TF_COND_RUNE_HASTE"] = 91;
values[valuesById[92] = "TF_COND_RUNE_REGEN"] = 92;
values[valuesById[93] = "TF_COND_RUNE_RESIST"] = 93;
values[valuesById[94] = "TF_COND_RUNE_VAMPIRE"] = 94;
values[valuesById[95] = "TF_COND_RUNE_REFLECT"] = 95;
values[valuesById[96] = "TF_COND_RUNE_PRECISION"] = 96;
values[valuesById[97] = "TF_COND_RUNE_AGILITY"] = 97;
values[valuesById[98] = "TF_COND_GRAPPLINGHOOK"] = 98;
values[valuesById[99] = "TF_COND_GRAPPLINGHOOK_SAFEFALL"] = 99;
values[valuesById[100] = "TF_COND_GRAPPLINGHOOK_LATCHED"] = 100;
values[valuesById[101] = "TF_COND_GRAPPLINGHOOK_BLEEDING"] = 101;
values[valuesById[102] = "TF_COND_AFTERBURN_IMMUNE"] = 102;
values[valuesById[103] = "TF_COND_RUNE_KNOCKOUT"] = 103;
values[valuesById[104] = "TF_COND_RUNE_IMBALANCE"] = 104;
values[valuesById[105] = "TF_COND_CRITBOOSTED_RUNE_TEMP"] = 105;
values[valuesById[106] = "TF_COND_PASSTIME_INTERCEPTION"] = 106;
values[valuesById[107] = "TF_COND_SWIMMING_NO_EFFECTS"] = 107;
values[valuesById[108] = "TF_COND_PURGATORY"] = 108;
values[valuesById[109] = "TF_COND_RUNE_KING"] = 109;
values[valuesById[110] = "TF_COND_RUNE_PLAGUE"] = 110;
values[valuesById[111] = "TF_COND_RUNE_SUPERNOVA"] = 111;
values[valuesById[112] = "TF_COND_PLAGUE"] = 112;
values[valuesById[113] = "TF_COND_KING_BUFFED"] = 113;
values[valuesById[114] = "TF_COND_TEAM_GLOWS"] = 114;
values[valuesById[115] = "TF_COND_KNOCKED_INTO_AIR"] = 115;
values[valuesById[116] = "TF_COND_COMPETITIVE_WINNER"] = 116;
values[valuesById[117] = "TF_COND_COMPETITIVE_LOSER"] = 117;
values[valuesById[118] = "TF_COND_HEALING_DEBUFF"] = 118;
values[valuesById[119] = "TF_COND_PASSTIME_PENALTY_DEBUFF"] = 119;
values[valuesById[120] = "TF_COND_PARACHUTE_DEPLOYED"] = 120;
values[valuesById[121] = "TF_COND_NO_COMBAT_SPEED_BOOST"] = 121;
values[valuesById[122] = "TF_COND_TRANQ_SPY_BOOST"] = 122;
values[valuesById[123] = "TF_COND_TRANQ_MARKED"] = 123;
values[valuesById[126] = "TF_COND_ROCKETPACK"] = 126;
values[valuesById[127] = "TF_COND_ROCKETPACK_PASSENGER"] = 127;
values[valuesById[128] = "TF_COND_STEALTHED_PHASE"] = 128;
values[valuesById[129] = "TF_COND_CLIP_OVERLOAD"] = 129;
values[valuesById[130] = "TF_COND_SPY_CLASS_STEAL"] = 130;
values[valuesById[131] = "TF_COND_GAS"] = 131;
return values;
})();
/**
* ETF2Team enum.
* @name CMsgQuestObjectiveDef.ETF2Team
* @enum {string}
* @property {number} TF_TEAM_RED=2 TF_TEAM_RED value
* @property {number} TF_TEAM_BLUE=3 TF_TEAM_BLUE value
*/
CMsgQuestObjectiveDef.ETF2Team = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[2] = "TF_TEAM_RED"] = 2;
values[valuesById[3] = "TF_TEAM_BLUE"] = 3;
return values;
})();
return CMsgQuestObjectiveDef;
})();
$root.CMsgQuestDef = (function() {
/**
* Properties of a CMsgQuestDef.
* @exports ICMsgQuestDef
* @interface ICMsgQuestDef
* @property {ICMsgProtoDefHeader} header CMsgQuestDef header
* @property {number|null} [max_points_0] CMsgQuestDef max_points_0
* @property {number|null} [max_points_1] CMsgQuestDef max_points_1
* @property {number|null} [max_points_2] CMsgQuestDef max_points_2
* @property {string|null} [name_loctoken] CMsgQuestDef name_loctoken
* @property {string|null} [operation] CMsgQuestDef operation
* @property {CMsgQuestDef.IMMCriteria|null} [mm_criteria] CMsgQuestDef mm_criteria
* @property {string|null} [node_image] CMsgQuestDef node_image
* @property {string|null} [icon_image] CMsgQuestDef icon_image
* @property {ICMsgProtoDefID|null} [theme] CMsgQuestDef theme
* @property {Array.<string>|null} [loaner_names] CMsgQuestDef loaner_names
* @property {Array.<CMsgQuestDef.IObjectiveInstance>|null} [objectives] CMsgQuestDef objectives
* @property {Array.<string>|null} [map] CMsgQuestDef map
*/
/**
* Constructs a new CMsgQuestDef.
* @exports CMsgQuestDef
* @classdesc Represents a CMsgQuestDef.
* @implements ICMsgQuestDef
* @constructor
* @param {ICMsgQuestDef=} [properties] Properties to set
*/
function CMsgQuestDef(properties) {
this.loaner_names = [];
this.objectives = [];
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]];
}
/**
* CMsgQuestDef header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.header = null;
/**
* CMsgQuestDef max_points_0.
* @member {number} max_points_0
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.max_points_0 = 0;
/**
* CMsgQuestDef max_points_1.
* @member {number} max_points_1
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.max_points_1 = 0;
/**
* CMsgQuestDef max_points_2.
* @member {number} max_points_2
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.max_points_2 = 0;
/**
* CMsgQuestDef name_loctoken.
* @member {string} name_loctoken
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.name_loctoken = "";
/**
* CMsgQuestDef operation.
* @member {string} operation
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.operation = "";
/**
* CMsgQuestDef mm_criteria.
* @member {CMsgQuestDef.IMMCriteria|null|undefined} mm_criteria
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.mm_criteria = null;
/**
* CMsgQuestDef node_image.
* @member {string} node_image
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.node_image = "";
/**
* CMsgQuestDef icon_image.
* @member {string} icon_image
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.icon_image = "";
/**
* CMsgQuestDef theme.
* @member {ICMsgProtoDefID|null|undefined} theme
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.theme = null;
/**
* CMsgQuestDef loaner_names.
* @member {Array.<string>} loaner_names
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.loaner_names = $util.emptyArray;
/**
* CMsgQuestDef objectives.
* @member {Array.<CMsgQuestDef.IObjectiveInstance>} objectives
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.objectives = $util.emptyArray;
/**
* CMsgQuestDef map.
* @member {Array.<string>} map
* @memberof CMsgQuestDef
* @instance
*/
CMsgQuestDef.prototype.map = $util.emptyArray;
/**
* Creates a new CMsgQuestDef instance using the specified properties.
* @function create
* @memberof CMsgQuestDef
* @static
* @param {ICMsgQuestDef=} [properties] Properties to set
* @returns {CMsgQuestDef} CMsgQuestDef instance
*/
CMsgQuestDef.create = function create(properties) {
return new CMsgQuestDef(properties);
};
/**
* Encodes the specified CMsgQuestDef message. Does not implicitly {@link CMsgQuestDef.verify|verify} messages.
* @function encode
* @memberof CMsgQuestDef
* @static
* @param {ICMsgQuestDef} message CMsgQuestDef message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestDef.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.max_points_0 != null && message.hasOwnProperty("max_points_0"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.max_points_0);
if (message.max_points_1 != null && message.hasOwnProperty("max_points_1"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.max_points_1);
if (message.max_points_2 != null && message.hasOwnProperty("max_points_2"))
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.max_points_2);
if (message.name_loctoken != null && message.hasOwnProperty("name_loctoken"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.name_loctoken);
if (message.operation != null && message.hasOwnProperty("operation"))
writer.uint32(/* id 7, wireType 2 =*/58).string(message.operation);
if (message.mm_criteria != null && message.hasOwnProperty("mm_criteria"))
$root.CMsgQuestDef.MMCriteria.encode(message.mm_criteria, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
if (message.node_image != null && message.hasOwnProperty("node_image"))
writer.uint32(/* id 12, wireType 2 =*/98).string(message.node_image);
if (message.icon_image != null && message.hasOwnProperty("icon_image"))
writer.uint32(/* id 13, wireType 2 =*/106).string(message.icon_image);
if (message.theme != null && message.hasOwnProperty("theme"))
$root.CMsgProtoDefID.encode(message.theme, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
if (message.loaner_names != null && message.loaner_names.length)
for (var i = 0; i < message.loaner_names.length; ++i)
writer.uint32(/* id 15, wireType 2 =*/122).string(message.loaner_names[i]);
if (message.objectives != null && message.objectives.length)
for (var i = 0; i < message.objectives.length; ++i)
$root.CMsgQuestDef.ObjectiveInstance.encode(message.objectives[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim();
if (message.map != null && message.map.length)
for (var i = 0; i < message.map.length; ++i)
writer.uint32(/* id 17, wireType 2 =*/138).string(message.map[i]);
return writer;
};
/**
* Encodes the specified CMsgQuestDef message, length delimited. Does not implicitly {@link CMsgQuestDef.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestDef
* @static
* @param {ICMsgQuestDef} message CMsgQuestDef message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestDef.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestDef message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestDef
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestDef} CMsgQuestDef
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestDef.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestDef();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
message.max_points_0 = reader.uint32();
break;
case 3:
message.max_points_1 = reader.uint32();
break;
case 4:
message.max_points_2 = reader.uint32();
break;
case 5:
message.name_loctoken = reader.string();
break;
case 7:
message.operation = reader.string();
break;
case 8:
message.mm_criteria = $root.CMsgQuestDef.MMCriteria.decode(reader, reader.uint32());
break;
case 12:
message.node_image = reader.string();
break;
case 13:
message.icon_image = reader.string();
break;
case 14:
message.theme = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 15:
if (!(message.loaner_names && message.loaner_names.length))
message.loaner_names = [];
message.loaner_names.push(reader.string());
break;
case 16:
if (!(message.objectives && message.objectives.length))
message.objectives = [];
message.objectives.push($root.CMsgQuestDef.ObjectiveInstance.decode(reader, reader.uint32()));
break;
case 17:
if (!(message.map && message.map.length))
message.map = [];
message.map.push(reader.string());
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestDef message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestDef
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestDef} CMsgQuestDef
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestDef.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestDef message.
* @function verify
* @memberof CMsgQuestDef
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestDef.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.max_points_0 != null && message.hasOwnProperty("max_points_0"))
if (!$util.isInteger(message.max_points_0))
return "max_points_0: integer expected";
if (message.max_points_1 != null && message.hasOwnProperty("max_points_1"))
if (!$util.isInteger(message.max_points_1))
return "max_points_1: integer expected";
if (message.max_points_2 != null && message.hasOwnProperty("max_points_2"))
if (!$util.isInteger(message.max_points_2))
return "max_points_2: integer expected";
if (message.name_loctoken != null && message.hasOwnProperty("name_loctoken"))
if (!$util.isString(message.name_loctoken))
return "name_loctoken: string expected";
if (message.operation != null && message.hasOwnProperty("operation"))
if (!$util.isString(message.operation))
return "operation: string expected";
if (message.mm_criteria != null && message.hasOwnProperty("mm_criteria")) {
var error = $root.CMsgQuestDef.MMCriteria.verify(message.mm_criteria);
if (error)
return "mm_criteria." + error;
}
if (message.node_image != null && message.hasOwnProperty("node_image"))
if (!$util.isString(message.node_image))
return "node_image: string expected";
if (message.icon_image != null && message.hasOwnProperty("icon_image"))
if (!$util.isString(message.icon_image))
return "icon_image: string expected";
if (message.theme != null && message.hasOwnProperty("theme")) {
var error = $root.CMsgProtoDefID.verify(message.theme);
if (error)
return "theme." + error;
}
if (message.loaner_names != null && message.hasOwnProperty("loaner_names")) {
if (!Array.isArray(message.loaner_names))
return "loaner_names: array expected";
for (var i = 0; i < message.loaner_names.length; ++i)
if (!$util.isString(message.loaner_names[i]))
return "loaner_names: string[] expected";
}
if (message.objectives != null && message.hasOwnProperty("objectives")) {
if (!Array.isArray(message.objectives))
return "objectives: array expected";
for (var i = 0; i < message.objectives.length; ++i) {
var error = $root.CMsgQuestDef.ObjectiveInstance.verify(message.objectives[i]);
if (error)
return "objectives." + error;
}
}
if (message.map != null && message.hasOwnProperty("map")) {
if (!Array.isArray(message.map))
return "map: array expected";
for (var i = 0; i < message.map.length; ++i)
if (!$util.isString(message.map[i]))
return "map: string[] expected";
}
return null;
};
/**
* Creates a CMsgQuestDef message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestDef
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestDef} CMsgQuestDef
*/
CMsgQuestDef.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestDef)
return object;
var message = new $root.CMsgQuestDef();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgQuestDef.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.max_points_0 != null)
message.max_points_0 = object.max_points_0 >>> 0;
if (object.max_points_1 != null)
message.max_points_1 = object.max_points_1 >>> 0;
if (object.max_points_2 != null)
message.max_points_2 = object.max_points_2 >>> 0;
if (object.name_loctoken != null)
message.name_loctoken = String(object.name_loctoken);
if (object.operation != null)
message.operation = String(object.operation);
if (object.mm_criteria != null) {
if (typeof object.mm_criteria !== "object")
throw TypeError(".CMsgQuestDef.mm_criteria: object expected");
message.mm_criteria = $root.CMsgQuestDef.MMCriteria.fromObject(object.mm_criteria);
}
if (object.node_image != null)
message.node_image = String(object.node_image);
if (object.icon_image != null)
message.icon_image = String(object.icon_image);
if (object.theme != null) {
if (typeof object.theme !== "object")
throw TypeError(".CMsgQuestDef.theme: object expected");
message.theme = $root.CMsgProtoDefID.fromObject(object.theme);
}
if (object.loaner_names) {
if (!Array.isArray(object.loaner_names))
throw TypeError(".CMsgQuestDef.loaner_names: array expected");
message.loaner_names = [];
for (var i = 0; i < object.loaner_names.length; ++i)
message.loaner_names[i] = String(object.loaner_names[i]);
}
if (object.objectives) {
if (!Array.isArray(object.objectives))
throw TypeError(".CMsgQuestDef.objectives: array expected");
message.objectives = [];
for (var i = 0; i < object.objectives.length; ++i) {
if (typeof object.objectives[i] !== "object")
throw TypeError(".CMsgQuestDef.objectives: object expected");
message.objectives[i] = $root.CMsgQuestDef.ObjectiveInstance.fromObject(object.objectives[i]);
}
}
if (object.map) {
if (!Array.isArray(object.map))
throw TypeError(".CMsgQuestDef.map: array expected");
message.map = [];
for (var i = 0; i < object.map.length; ++i)
message.map[i] = String(object.map[i]);
}
return message;
};
/**
* Creates a plain object from a CMsgQuestDef message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestDef
* @static
* @param {CMsgQuestDef} message CMsgQuestDef
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestDef.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.loaner_names = [];
object.objectives = [];
object.map = [];
}
if (options.defaults) {
object.header = null;
object.max_points_0 = 0;
object.max_points_1 = 0;
object.max_points_2 = 0;
object.name_loctoken = "";
object.operation = "";
object.mm_criteria = null;
object.node_image = "";
object.icon_image = "";
object.theme = null;
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.max_points_0 != null && message.hasOwnProperty("max_points_0"))
object.max_points_0 = message.max_points_0;
if (message.max_points_1 != null && message.hasOwnProperty("max_points_1"))
object.max_points_1 = message.max_points_1;
if (message.max_points_2 != null && message.hasOwnProperty("max_points_2"))
object.max_points_2 = message.max_points_2;
if (message.name_loctoken != null && message.hasOwnProperty("name_loctoken"))
object.name_loctoken = message.name_loctoken;
if (message.operation != null && message.hasOwnProperty("operation"))
object.operation = message.operation;
if (message.mm_criteria != null && message.hasOwnProperty("mm_criteria"))
object.mm_criteria = $root.CMsgQuestDef.MMCriteria.toObject(message.mm_criteria, options);
if (message.node_image != null && message.hasOwnProperty("node_image"))
object.node_image = message.node_image;
if (message.icon_image != null && message.hasOwnProperty("icon_image"))
object.icon_image = message.icon_image;
if (message.theme != null && message.hasOwnProperty("theme"))
object.theme = $root.CMsgProtoDefID.toObject(message.theme, options);
if (message.loaner_names && message.loaner_names.length) {
object.loaner_names = [];
for (var j = 0; j < message.loaner_names.length; ++j)
object.loaner_names[j] = message.loaner_names[j];
}
if (message.objectives && message.objectives.length) {
object.objectives = [];
for (var j = 0; j < message.objectives.length; ++j)
object.objectives[j] = $root.CMsgQuestDef.ObjectiveInstance.toObject(message.objectives[j], options);
}
if (message.map && message.map.length) {
object.map = [];
for (var j = 0; j < message.map.length; ++j)
object.map[j] = message.map[j];
}
return object;
};
/**
* Converts this CMsgQuestDef to JSON.
* @function toJSON
* @memberof CMsgQuestDef
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestDef.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
CMsgQuestDef.MMCriteria = (function() {
/**
* Properties of a MMCriteria.
* @memberof CMsgQuestDef
* @interface IMMCriteria
* @property {string|null} [group_name] MMCriteria group_name
* @property {string|null} [category_name] MMCriteria category_name
* @property {string|null} [map_name] MMCriteria map_name
*/
/**
* Constructs a new MMCriteria.
* @memberof CMsgQuestDef
* @classdesc Represents a MMCriteria.
* @implements IMMCriteria
* @constructor
* @param {CMsgQuestDef.IMMCriteria=} [properties] Properties to set
*/
function MMCriteria(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]];
}
/**
* MMCriteria group_name.
* @member {string} group_name
* @memberof CMsgQuestDef.MMCriteria
* @instance
*/
MMCriteria.prototype.group_name = "";
/**
* MMCriteria category_name.
* @member {string} category_name
* @memberof CMsgQuestDef.MMCriteria
* @instance
*/
MMCriteria.prototype.category_name = "";
/**
* MMCriteria map_name.
* @member {string} map_name
* @memberof CMsgQuestDef.MMCriteria
* @instance
*/
MMCriteria.prototype.map_name = "";
/**
* Creates a new MMCriteria instance using the specified properties.
* @function create
* @memberof CMsgQuestDef.MMCriteria
* @static
* @param {CMsgQuestDef.IMMCriteria=} [properties] Properties to set
* @returns {CMsgQuestDef.MMCriteria} MMCriteria instance
*/
MMCriteria.create = function create(properties) {
return new MMCriteria(properties);
};
/**
* Encodes the specified MMCriteria message. Does not implicitly {@link CMsgQuestDef.MMCriteria.verify|verify} messages.
* @function encode
* @memberof CMsgQuestDef.MMCriteria
* @static
* @param {CMsgQuestDef.IMMCriteria} message MMCriteria message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MMCriteria.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.group_name != null && message.hasOwnProperty("group_name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.group_name);
if (message.category_name != null && message.hasOwnProperty("category_name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.category_name);
if (message.map_name != null && message.hasOwnProperty("map_name"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.map_name);
return writer;
};
/**
* Encodes the specified MMCriteria message, length delimited. Does not implicitly {@link CMsgQuestDef.MMCriteria.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestDef.MMCriteria
* @static
* @param {CMsgQuestDef.IMMCriteria} message MMCriteria message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MMCriteria.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MMCriteria message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestDef.MMCriteria
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestDef.MMCriteria} MMCriteria
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MMCriteria.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestDef.MMCriteria();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.group_name = reader.string();
break;
case 2:
message.category_name = reader.string();
break;
case 3:
message.map_name = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MMCriteria message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestDef.MMCriteria
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestDef.MMCriteria} MMCriteria
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MMCriteria.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MMCriteria message.
* @function verify
* @memberof CMsgQuestDef.MMCriteria
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MMCriteria.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.group_name != null && message.hasOwnProperty("group_name"))
if (!$util.isString(message.group_name))
return "group_name: string expected";
if (message.category_name != null && message.hasOwnProperty("category_name"))
if (!$util.isString(message.category_name))
return "category_name: string expected";
if (message.map_name != null && message.hasOwnProperty("map_name"))
if (!$util.isString(message.map_name))
return "map_name: string expected";
return null;
};
/**
* Creates a MMCriteria message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestDef.MMCriteria
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestDef.MMCriteria} MMCriteria
*/
MMCriteria.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestDef.MMCriteria)
return object;
var message = new $root.CMsgQuestDef.MMCriteria();
if (object.group_name != null)
message.group_name = String(object.group_name);
if (object.category_name != null)
message.category_name = String(object.category_name);
if (object.map_name != null)
message.map_name = String(object.map_name);
return message;
};
/**
* Creates a plain object from a MMCriteria message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestDef.MMCriteria
* @static
* @param {CMsgQuestDef.MMCriteria} message MMCriteria
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
MMCriteria.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.group_name = "";
object.category_name = "";
object.map_name = "";
}
if (message.group_name != null && message.hasOwnProperty("group_name"))
object.group_name = message.group_name;
if (message.category_name != null && message.hasOwnProperty("category_name"))
object.category_name = message.category_name;
if (message.map_name != null && message.hasOwnProperty("map_name"))
object.map_name = message.map_name;
return object;
};
/**
* Converts this MMCriteria to JSON.
* @function toJSON
* @memberof CMsgQuestDef.MMCriteria
* @instance
* @returns {Object.<string,*>} JSON object
*/
MMCriteria.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return MMCriteria;
})();
CMsgQuestDef.ObjectiveInstance = (function() {
/**
* Properties of an ObjectiveInstance.
* @memberof CMsgQuestDef
* @interface IObjectiveInstance
* @property {ICMsgProtoDefID|null} [objective] ObjectiveInstance objective
* @property {EQuestPoints|null} [point_type] ObjectiveInstance point_type
* @property {number|null} [point_value] ObjectiveInstance point_value
*/
/**
* Constructs a new ObjectiveInstance.
* @memberof CMsgQuestDef
* @classdesc Represents an ObjectiveInstance.
* @implements IObjectiveInstance
* @constructor
* @param {CMsgQuestDef.IObjectiveInstance=} [properties] Properties to set
*/
function ObjectiveInstance(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]];
}
/**
* ObjectiveInstance objective.
* @member {ICMsgProtoDefID|null|undefined} objective
* @memberof CMsgQuestDef.ObjectiveInstance
* @instance
*/
ObjectiveInstance.prototype.objective = null;
/**
* ObjectiveInstance point_type.
* @member {EQuestPoints} point_type
* @memberof CMsgQuestDef.ObjectiveInstance
* @instance
*/
ObjectiveInstance.prototype.point_type = 0;
/**
* ObjectiveInstance point_value.
* @member {number} point_value
* @memberof CMsgQuestDef.ObjectiveInstance
* @instance
*/
ObjectiveInstance.prototype.point_value = 0;
/**
* Creates a new ObjectiveInstance instance using the specified properties.
* @function create
* @memberof CMsgQuestDef.ObjectiveInstance
* @static
* @param {CMsgQuestDef.IObjectiveInstance=} [properties] Properties to set
* @returns {CMsgQuestDef.ObjectiveInstance} ObjectiveInstance instance
*/
ObjectiveInstance.create = function create(properties) {
return new ObjectiveInstance(properties);
};
/**
* Encodes the specified ObjectiveInstance message. Does not implicitly {@link CMsgQuestDef.ObjectiveInstance.verify|verify} messages.
* @function encode
* @memberof CMsgQuestDef.ObjectiveInstance
* @static
* @param {CMsgQuestDef.IObjectiveInstance} message ObjectiveInstance message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ObjectiveInstance.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.objective != null && message.hasOwnProperty("objective"))
$root.CMsgProtoDefID.encode(message.objective, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.point_type != null && message.hasOwnProperty("point_type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.point_type);
if (message.point_value != null && message.hasOwnProperty("point_value"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.point_value);
return writer;
};
/**
* Encodes the specified ObjectiveInstance message, length delimited. Does not implicitly {@link CMsgQuestDef.ObjectiveInstance.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestDef.ObjectiveInstance
* @static
* @param {CMsgQuestDef.IObjectiveInstance} message ObjectiveInstance message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ObjectiveInstance.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ObjectiveInstance message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestDef.ObjectiveInstance
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestDef.ObjectiveInstance} ObjectiveInstance
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ObjectiveInstance.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestDef.ObjectiveInstance();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.objective = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 2:
message.point_type = reader.int32();
break;
case 3:
message.point_value = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ObjectiveInstance message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestDef.ObjectiveInstance
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestDef.ObjectiveInstance} ObjectiveInstance
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ObjectiveInstance.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ObjectiveInstance message.
* @function verify
* @memberof CMsgQuestDef.ObjectiveInstance
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ObjectiveInstance.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.objective != null && message.hasOwnProperty("objective")) {
var error = $root.CMsgProtoDefID.verify(message.objective);
if (error)
return "objective." + error;
}
if (message.point_type != null && message.hasOwnProperty("point_type"))
switch (message.point_type) {
default:
return "point_type: enum value expected";
case 0:
case 1:
case 2:
break;
}
if (message.point_value != null && message.hasOwnProperty("point_value"))
if (!$util.isInteger(message.point_value))
return "point_value: integer expected";
return null;
};
/**
* Creates an ObjectiveInstance message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestDef.ObjectiveInstance
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestDef.ObjectiveInstance} ObjectiveInstance
*/
ObjectiveInstance.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestDef.ObjectiveInstance)
return object;
var message = new $root.CMsgQuestDef.ObjectiveInstance();
if (object.objective != null) {
if (typeof object.objective !== "object")
throw TypeError(".CMsgQuestDef.ObjectiveInstance.objective: object expected");
message.objective = $root.CMsgProtoDefID.fromObject(object.objective);
}
switch (object.point_type) {
case "QUEST_POINTS_NOVICE":
case 0:
message.point_type = 0;
break;
case "QUEST_POINTS_ADVANCED":
case 1:
message.point_type = 1;
break;
case "QUEST_POINTS_EXPERT":
case 2:
message.point_type = 2;
break;
}
if (object.point_value != null)
message.point_value = object.point_value >>> 0;
return message;
};
/**
* Creates a plain object from an ObjectiveInstance message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestDef.ObjectiveInstance
* @static
* @param {CMsgQuestDef.ObjectiveInstance} message ObjectiveInstance
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ObjectiveInstance.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.objective = null;
object.point_type = options.enums === String ? "QUEST_POINTS_NOVICE" : 0;
object.point_value = 0;
}
if (message.objective != null && message.hasOwnProperty("objective"))
object.objective = $root.CMsgProtoDefID.toObject(message.objective, options);
if (message.point_type != null && message.hasOwnProperty("point_type"))
object.point_type = options.enums === String ? $root.EQuestPoints[message.point_type] : message.point_type;
if (message.point_value != null && message.hasOwnProperty("point_value"))
object.point_value = message.point_value;
return object;
};
/**
* Converts this ObjectiveInstance to JSON.
* @function toJSON
* @memberof CMsgQuestDef.ObjectiveInstance
* @instance
* @returns {Object.<string,*>} JSON object
*/
ObjectiveInstance.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return ObjectiveInstance;
})();
return CMsgQuestDef;
})();
$root.CMsgQuestMapStoreItem = (function() {
/**
* Properties of a CMsgQuestMapStoreItem.
* @exports ICMsgQuestMapStoreItem
* @interface ICMsgQuestMapStoreItem
* @property {ICMsgProtoDefHeader} header CMsgQuestMapStoreItem header
* @property {string|null} [item_name] CMsgQuestMapStoreItem item_name
* @property {string|null} [reward_lootlist_name] CMsgQuestMapStoreItem reward_lootlist_name
* @property {ICMsgVarField|null} [price] CMsgQuestMapStoreItem price
* @property {number|null} [purchase_limit] CMsgQuestMapStoreItem purchase_limit
* @property {number|null} [sort_group] CMsgQuestMapStoreItem sort_group
*/
/**
* Constructs a new CMsgQuestMapStoreItem.
* @exports CMsgQuestMapStoreItem
* @classdesc Represents a CMsgQuestMapStoreItem.
* @implements ICMsgQuestMapStoreItem
* @constructor
* @param {ICMsgQuestMapStoreItem=} [properties] Properties to set
*/
function CMsgQuestMapStoreItem(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]];
}
/**
* CMsgQuestMapStoreItem header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgQuestMapStoreItem
* @instance
*/
CMsgQuestMapStoreItem.prototype.header = null;
/**
* CMsgQuestMapStoreItem item_name.
* @member {string} item_name
* @memberof CMsgQuestMapStoreItem
* @instance
*/
CMsgQuestMapStoreItem.prototype.item_name = "";
/**
* CMsgQuestMapStoreItem reward_lootlist_name.
* @member {string} reward_lootlist_name
* @memberof CMsgQuestMapStoreItem
* @instance
*/
CMsgQuestMapStoreItem.prototype.reward_lootlist_name = "";
/**
* CMsgQuestMapStoreItem price.
* @member {ICMsgVarField|null|undefined} price
* @memberof CMsgQuestMapStoreItem
* @instance
*/
CMsgQuestMapStoreItem.prototype.price = null;
/**
* CMsgQuestMapStoreItem purchase_limit.
* @member {number} purchase_limit
* @memberof CMsgQuestMapStoreItem
* @instance
*/
CMsgQuestMapStoreItem.prototype.purchase_limit = 0;
/**
* CMsgQuestMapStoreItem sort_group.
* @member {number} sort_group
* @memberof CMsgQuestMapStoreItem
* @instance
*/
CMsgQuestMapStoreItem.prototype.sort_group = 0;
/**
* Creates a new CMsgQuestMapStoreItem instance using the specified properties.
* @function create
* @memberof CMsgQuestMapStoreItem
* @static
* @param {ICMsgQuestMapStoreItem=} [properties] Properties to set
* @returns {CMsgQuestMapStoreItem} CMsgQuestMapStoreItem instance
*/
CMsgQuestMapStoreItem.create = function create(properties) {
return new CMsgQuestMapStoreItem(properties);
};
/**
* Encodes the specified CMsgQuestMapStoreItem message. Does not implicitly {@link CMsgQuestMapStoreItem.verify|verify} messages.
* @function encode
* @memberof CMsgQuestMapStoreItem
* @static
* @param {ICMsgQuestMapStoreItem} message CMsgQuestMapStoreItem message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapStoreItem.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.item_name != null && message.hasOwnProperty("item_name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.item_name);
if (message.price != null && message.hasOwnProperty("price"))
$root.CMsgVarField.encode(message.price, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.purchase_limit != null && message.hasOwnProperty("purchase_limit"))
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.purchase_limit);
if (message.sort_group != null && message.hasOwnProperty("sort_group"))
writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.sort_group);
if (message.reward_lootlist_name != null && message.hasOwnProperty("reward_lootlist_name"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.reward_lootlist_name);
return writer;
};
/**
* Encodes the specified CMsgQuestMapStoreItem message, length delimited. Does not implicitly {@link CMsgQuestMapStoreItem.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestMapStoreItem
* @static
* @param {ICMsgQuestMapStoreItem} message CMsgQuestMapStoreItem message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapStoreItem.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestMapStoreItem message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestMapStoreItem
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestMapStoreItem} CMsgQuestMapStoreItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapStoreItem.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestMapStoreItem();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
message.item_name = reader.string();
break;
case 6:
message.reward_lootlist_name = reader.string();
break;
case 3:
message.price = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 4:
message.purchase_limit = reader.uint32();
break;
case 5:
message.sort_group = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestMapStoreItem message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestMapStoreItem
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestMapStoreItem} CMsgQuestMapStoreItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapStoreItem.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestMapStoreItem message.
* @function verify
* @memberof CMsgQuestMapStoreItem
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestMapStoreItem.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.item_name != null && message.hasOwnProperty("item_name"))
if (!$util.isString(message.item_name))
return "item_name: string expected";
if (message.reward_lootlist_name != null && message.hasOwnProperty("reward_lootlist_name"))
if (!$util.isString(message.reward_lootlist_name))
return "reward_lootlist_name: string expected";
if (message.price != null && message.hasOwnProperty("price")) {
var error = $root.CMsgVarField.verify(message.price);
if (error)
return "price." + error;
}
if (message.purchase_limit != null && message.hasOwnProperty("purchase_limit"))
if (!$util.isInteger(message.purchase_limit))
return "purchase_limit: integer expected";
if (message.sort_group != null && message.hasOwnProperty("sort_group"))
if (!$util.isInteger(message.sort_group))
return "sort_group: integer expected";
return null;
};
/**
* Creates a CMsgQuestMapStoreItem message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestMapStoreItem
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestMapStoreItem} CMsgQuestMapStoreItem
*/
CMsgQuestMapStoreItem.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestMapStoreItem)
return object;
var message = new $root.CMsgQuestMapStoreItem();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgQuestMapStoreItem.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.item_name != null)
message.item_name = String(object.item_name);
if (object.reward_lootlist_name != null)
message.reward_lootlist_name = String(object.reward_lootlist_name);
if (object.price != null) {
if (typeof object.price !== "object")
throw TypeError(".CMsgQuestMapStoreItem.price: object expected");
message.price = $root.CMsgVarField.fromObject(object.price);
}
if (object.purchase_limit != null)
message.purchase_limit = object.purchase_limit >>> 0;
if (object.sort_group != null)
message.sort_group = object.sort_group >>> 0;
return message;
};
/**
* Creates a plain object from a CMsgQuestMapStoreItem message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestMapStoreItem
* @static
* @param {CMsgQuestMapStoreItem} message CMsgQuestMapStoreItem
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestMapStoreItem.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.header = null;
object.item_name = "";
object.price = null;
object.purchase_limit = 0;
object.sort_group = 0;
object.reward_lootlist_name = "";
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.item_name != null && message.hasOwnProperty("item_name"))
object.item_name = message.item_name;
if (message.price != null && message.hasOwnProperty("price"))
object.price = $root.CMsgVarField.toObject(message.price, options);
if (message.purchase_limit != null && message.hasOwnProperty("purchase_limit"))
object.purchase_limit = message.purchase_limit;
if (message.sort_group != null && message.hasOwnProperty("sort_group"))
object.sort_group = message.sort_group;
if (message.reward_lootlist_name != null && message.hasOwnProperty("reward_lootlist_name"))
object.reward_lootlist_name = message.reward_lootlist_name;
return object;
};
/**
* Converts this CMsgQuestMapStoreItem to JSON.
* @function toJSON
* @memberof CMsgQuestMapStoreItem
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestMapStoreItem.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgQuestMapStoreItem;
})();
$root.CMsgQuestMapRegionDef = (function() {
/**
* Properties of a CMsgQuestMapRegionDef.
* @exports ICMsgQuestMapRegionDef
* @interface ICMsgQuestMapRegionDef
* @property {ICMsgProtoDefHeader} header CMsgQuestMapRegionDef header
* @property {string|null} [name] CMsgQuestMapRegionDef name
* @property {string|null} [resfile] CMsgQuestMapRegionDef resfile
* @property {Array.<CMsgQuestMapRegionDef.IRegionLink>|null} [links] CMsgQuestMapRegionDef links
* @property {ICMsgProtoDefID|null} [return_link] CMsgQuestMapRegionDef return_link
* @property {number|null} [radio_freq] CMsgQuestMapRegionDef radio_freq
* @property {number|null} [zoom_scale] CMsgQuestMapRegionDef zoom_scale
* @property {ICMsgProtoDefID|null} [star_type] CMsgQuestMapRegionDef star_type
*/
/**
* Constructs a new CMsgQuestMapRegionDef.
* @exports CMsgQuestMapRegionDef
* @classdesc Represents a CMsgQuestMapRegionDef.
* @implements ICMsgQuestMapRegionDef
* @constructor
* @param {ICMsgQuestMapRegionDef=} [properties] Properties to set
*/
function CMsgQuestMapRegionDef(properties) {
this.links = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgQuestMapRegionDef header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgQuestMapRegionDef
* @instance
*/
CMsgQuestMapRegionDef.prototype.header = null;
/**
* CMsgQuestMapRegionDef name.
* @member {string} name
* @memberof CMsgQuestMapRegionDef
* @instance
*/
CMsgQuestMapRegionDef.prototype.name = "";
/**
* CMsgQuestMapRegionDef resfile.
* @member {string} resfile
* @memberof CMsgQuestMapRegionDef
* @instance
*/
CMsgQuestMapRegionDef.prototype.resfile = "";
/**
* CMsgQuestMapRegionDef links.
* @member {Array.<CMsgQuestMapRegionDef.IRegionLink>} links
* @memberof CMsgQuestMapRegionDef
* @instance
*/
CMsgQuestMapRegionDef.prototype.links = $util.emptyArray;
/**
* CMsgQuestMapRegionDef return_link.
* @member {ICMsgProtoDefID|null|undefined} return_link
* @memberof CMsgQuestMapRegionDef
* @instance
*/
CMsgQuestMapRegionDef.prototype.return_link = null;
/**
* CMsgQuestMapRegionDef radio_freq.
* @member {number} radio_freq
* @memberof CMsgQuestMapRegionDef
* @instance
*/
CMsgQuestMapRegionDef.prototype.radio_freq = 0;
/**
* CMsgQuestMapRegionDef zoom_scale.
* @member {number} zoom_scale
* @memberof CMsgQuestMapRegionDef
* @instance
*/
CMsgQuestMapRegionDef.prototype.zoom_scale = 0;
/**
* CMsgQuestMapRegionDef star_type.
* @member {ICMsgProtoDefID|null|undefined} star_type
* @memberof CMsgQuestMapRegionDef
* @instance
*/
CMsgQuestMapRegionDef.prototype.star_type = null;
/**
* Creates a new CMsgQuestMapRegionDef instance using the specified properties.
* @function create
* @memberof CMsgQuestMapRegionDef
* @static
* @param {ICMsgQuestMapRegionDef=} [properties] Properties to set
* @returns {CMsgQuestMapRegionDef} CMsgQuestMapRegionDef instance
*/
CMsgQuestMapRegionDef.create = function create(properties) {
return new CMsgQuestMapRegionDef(properties);
};
/**
* Encodes the specified CMsgQuestMapRegionDef message. Does not implicitly {@link CMsgQuestMapRegionDef.verify|verify} messages.
* @function encode
* @memberof CMsgQuestMapRegionDef
* @static
* @param {ICMsgQuestMapRegionDef} message CMsgQuestMapRegionDef message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapRegionDef.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
if (message.resfile != null && message.hasOwnProperty("resfile"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.resfile);
if (message.links != null && message.links.length)
for (var i = 0; i < message.links.length; ++i)
$root.CMsgQuestMapRegionDef.RegionLink.encode(message.links[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.return_link != null && message.hasOwnProperty("return_link"))
$root.CMsgProtoDefID.encode(message.return_link, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.radio_freq != null && message.hasOwnProperty("radio_freq"))
writer.uint32(/* id 6, wireType 5 =*/53).float(message.radio_freq);
if (message.zoom_scale != null && message.hasOwnProperty("zoom_scale"))
writer.uint32(/* id 7, wireType 5 =*/61).float(message.zoom_scale);
if (message.star_type != null && message.hasOwnProperty("star_type"))
$root.CMsgProtoDefID.encode(message.star_type, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgQuestMapRegionDef message, length delimited. Does not implicitly {@link CMsgQuestMapRegionDef.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestMapRegionDef
* @static
* @param {ICMsgQuestMapRegionDef} message CMsgQuestMapRegionDef message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapRegionDef.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestMapRegionDef message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestMapRegionDef
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestMapRegionDef} CMsgQuestMapRegionDef
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapRegionDef.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestMapRegionDef();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
message.name = reader.string();
break;
case 3:
message.resfile = reader.string();
break;
case 4:
if (!(message.links && message.links.length))
message.links = [];
message.links.push($root.CMsgQuestMapRegionDef.RegionLink.decode(reader, reader.uint32()));
break;
case 5:
message.return_link = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 6:
message.radio_freq = reader.float();
break;
case 7:
message.zoom_scale = reader.float();
break;
case 8:
message.star_type = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestMapRegionDef message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestMapRegionDef
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestMapRegionDef} CMsgQuestMapRegionDef
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapRegionDef.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestMapRegionDef message.
* @function verify
* @memberof CMsgQuestMapRegionDef
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestMapRegionDef.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
if (message.resfile != null && message.hasOwnProperty("resfile"))
if (!$util.isString(message.resfile))
return "resfile: string expected";
if (message.links != null && message.hasOwnProperty("links")) {
if (!Array.isArray(message.links))
return "links: array expected";
for (var i = 0; i < message.links.length; ++i) {
var error = $root.CMsgQuestMapRegionDef.RegionLink.verify(message.links[i]);
if (error)
return "links." + error;
}
}
if (message.return_link != null && message.hasOwnProperty("return_link")) {
var error = $root.CMsgProtoDefID.verify(message.return_link);
if (error)
return "return_link." + error;
}
if (message.radio_freq != null && message.hasOwnProperty("radio_freq"))
if (typeof message.radio_freq !== "number")
return "radio_freq: number expected";
if (message.zoom_scale != null && message.hasOwnProperty("zoom_scale"))
if (typeof message.zoom_scale !== "number")
return "zoom_scale: number expected";
if (message.star_type != null && message.hasOwnProperty("star_type")) {
var error = $root.CMsgProtoDefID.verify(message.star_type);
if (error)
return "star_type." + error;
}
return null;
};
/**
* Creates a CMsgQuestMapRegionDef message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestMapRegionDef
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestMapRegionDef} CMsgQuestMapRegionDef
*/
CMsgQuestMapRegionDef.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestMapRegionDef)
return object;
var message = new $root.CMsgQuestMapRegionDef();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgQuestMapRegionDef.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.name != null)
message.name = String(object.name);
if (object.resfile != null)
message.resfile = String(object.resfile);
if (object.links) {
if (!Array.isArray(object.links))
throw TypeError(".CMsgQuestMapRegionDef.links: array expected");
message.links = [];
for (var i = 0; i < object.links.length; ++i) {
if (typeof object.links[i] !== "object")
throw TypeError(".CMsgQuestMapRegionDef.links: object expected");
message.links[i] = $root.CMsgQuestMapRegionDef.RegionLink.fromObject(object.links[i]);
}
}
if (object.return_link != null) {
if (typeof object.return_link !== "object")
throw TypeError(".CMsgQuestMapRegionDef.return_link: object expected");
message.return_link = $root.CMsgProtoDefID.fromObject(object.return_link);
}
if (object.radio_freq != null)
message.radio_freq = Number(object.radio_freq);
if (object.zoom_scale != null)
message.zoom_scale = Number(object.zoom_scale);
if (object.star_type != null) {
if (typeof object.star_type !== "object")
throw TypeError(".CMsgQuestMapRegionDef.star_type: object expected");
message.star_type = $root.CMsgProtoDefID.fromObject(object.star_type);
}
return message;
};
/**
* Creates a plain object from a CMsgQuestMapRegionDef message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestMapRegionDef
* @static
* @param {CMsgQuestMapRegionDef} message CMsgQuestMapRegionDef
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestMapRegionDef.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.links = [];
if (options.defaults) {
object.header = null;
object.name = "";
object.resfile = "";
object.return_link = null;
object.radio_freq = 0;
object.zoom_scale = 0;
object.star_type = null;
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.resfile != null && message.hasOwnProperty("resfile"))
object.resfile = message.resfile;
if (message.links && message.links.length) {
object.links = [];
for (var j = 0; j < message.links.length; ++j)
object.links[j] = $root.CMsgQuestMapRegionDef.RegionLink.toObject(message.links[j], options);
}
if (message.return_link != null && message.hasOwnProperty("return_link"))
object.return_link = $root.CMsgProtoDefID.toObject(message.return_link, options);
if (message.radio_freq != null && message.hasOwnProperty("radio_freq"))
object.radio_freq = options.json && !isFinite(message.radio_freq) ? String(message.radio_freq) : message.radio_freq;
if (message.zoom_scale != null && message.hasOwnProperty("zoom_scale"))
object.zoom_scale = options.json && !isFinite(message.zoom_scale) ? String(message.zoom_scale) : message.zoom_scale;
if (message.star_type != null && message.hasOwnProperty("star_type"))
object.star_type = $root.CMsgProtoDefID.toObject(message.star_type, options);
return object;
};
/**
* Converts this CMsgQuestMapRegionDef to JSON.
* @function toJSON
* @memberof CMsgQuestMapRegionDef
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestMapRegionDef.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
CMsgQuestMapRegionDef.RegionLink = (function() {
/**
* Properties of a RegionLink.
* @memberof CMsgQuestMapRegionDef
* @interface IRegionLink
* @property {ICMsgProtoDefID} target_region_defid RegionLink target_region_defid
* @property {number|null} [xpos] RegionLink xpos
* @property {number|null} [ypos] RegionLink ypos
*/
/**
* Constructs a new RegionLink.
* @memberof CMsgQuestMapRegionDef
* @classdesc Represents a RegionLink.
* @implements IRegionLink
* @constructor
* @param {CMsgQuestMapRegionDef.IRegionLink=} [properties] Properties to set
*/
function RegionLink(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]];
}
/**
* RegionLink target_region_defid.
* @member {ICMsgProtoDefID} target_region_defid
* @memberof CMsgQuestMapRegionDef.RegionLink
* @instance
*/
RegionLink.prototype.target_region_defid = null;
/**
* RegionLink xpos.
* @member {number} xpos
* @memberof CMsgQuestMapRegionDef.RegionLink
* @instance
*/
RegionLink.prototype.xpos = 0;
/**
* RegionLink ypos.
* @member {number} ypos
* @memberof CMsgQuestMapRegionDef.RegionLink
* @instance
*/
RegionLink.prototype.ypos = 0;
/**
* Creates a new RegionLink instance using the specified properties.
* @function create
* @memberof CMsgQuestMapRegionDef.RegionLink
* @static
* @param {CMsgQuestMapRegionDef.IRegionLink=} [properties] Properties to set
* @returns {CMsgQuestMapRegionDef.RegionLink} RegionLink instance
*/
RegionLink.create = function create(properties) {
return new RegionLink(properties);
};
/**
* Encodes the specified RegionLink message. Does not implicitly {@link CMsgQuestMapRegionDef.RegionLink.verify|verify} messages.
* @function encode
* @memberof CMsgQuestMapRegionDef.RegionLink
* @static
* @param {CMsgQuestMapRegionDef.IRegionLink} message RegionLink message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
RegionLink.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefID.encode(message.target_region_defid, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.xpos != null && message.hasOwnProperty("xpos"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.xpos);
if (message.ypos != null && message.hasOwnProperty("ypos"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.ypos);
return writer;
};
/**
* Encodes the specified RegionLink message, length delimited. Does not implicitly {@link CMsgQuestMapRegionDef.RegionLink.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestMapRegionDef.RegionLink
* @static
* @param {CMsgQuestMapRegionDef.IRegionLink} message RegionLink message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
RegionLink.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a RegionLink message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestMapRegionDef.RegionLink
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestMapRegionDef.RegionLink} RegionLink
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
RegionLink.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestMapRegionDef.RegionLink();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.target_region_defid = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 2:
message.xpos = reader.uint32();
break;
case 3:
message.ypos = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("target_region_defid"))
throw $util.ProtocolError("missing required 'target_region_defid'", { instance: message });
return message;
};
/**
* Decodes a RegionLink message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestMapRegionDef.RegionLink
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestMapRegionDef.RegionLink} RegionLink
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
RegionLink.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a RegionLink message.
* @function verify
* @memberof CMsgQuestMapRegionDef.RegionLink
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
RegionLink.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefID.verify(message.target_region_defid);
if (error)
return "target_region_defid." + error;
}
if (message.xpos != null && message.hasOwnProperty("xpos"))
if (!$util.isInteger(message.xpos))
return "xpos: integer expected";
if (message.ypos != null && message.hasOwnProperty("ypos"))
if (!$util.isInteger(message.ypos))
return "ypos: integer expected";
return null;
};
/**
* Creates a RegionLink message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestMapRegionDef.RegionLink
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestMapRegionDef.RegionLink} RegionLink
*/
RegionLink.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestMapRegionDef.RegionLink)
return object;
var message = new $root.CMsgQuestMapRegionDef.RegionLink();
if (object.target_region_defid != null) {
if (typeof object.target_region_defid !== "object")
throw TypeError(".CMsgQuestMapRegionDef.RegionLink.target_region_defid: object expected");
message.target_region_defid = $root.CMsgProtoDefID.fromObject(object.target_region_defid);
}
if (object.xpos != null)
message.xpos = object.xpos >>> 0;
if (object.ypos != null)
message.ypos = object.ypos >>> 0;
return message;
};
/**
* Creates a plain object from a RegionLink message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestMapRegionDef.RegionLink
* @static
* @param {CMsgQuestMapRegionDef.RegionLink} message RegionLink
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
RegionLink.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.target_region_defid = null;
object.xpos = 0;
object.ypos = 0;
}
if (message.target_region_defid != null && message.hasOwnProperty("target_region_defid"))
object.target_region_defid = $root.CMsgProtoDefID.toObject(message.target_region_defid, options);
if (message.xpos != null && message.hasOwnProperty("xpos"))
object.xpos = message.xpos;
if (message.ypos != null && message.hasOwnProperty("ypos"))
object.ypos = message.ypos;
return object;
};
/**
* Converts this RegionLink to JSON.
* @function toJSON
* @memberof CMsgQuestMapRegionDef.RegionLink
* @instance
* @returns {Object.<string,*>} JSON object
*/
RegionLink.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return RegionLink;
})();
return CMsgQuestMapRegionDef;
})();
$root.CMsgVarField = (function() {
/**
* Properties of a CMsgVarField.
* @exports ICMsgVarField
* @interface ICMsgVarField
* @property {string|null} [variable] CMsgVarField variable
* @property {number|null} [float] CMsgVarField float
* @property {number|null} [double] CMsgVarField double
* @property {number|null} [uint32] CMsgVarField uint32
* @property {number|Long|null} [uint64] CMsgVarField uint64
* @property {number|null} [sint32] CMsgVarField sint32
* @property {number|Long|null} [sint64] CMsgVarField sint64
* @property {boolean|null} [bool] CMsgVarField bool
* @property {string|null} [string] CMsgVarField string
*/
/**
* Constructs a new CMsgVarField.
* @exports CMsgVarField
* @classdesc Represents a CMsgVarField.
* @implements ICMsgVarField
* @constructor
* @param {ICMsgVarField=} [properties] Properties to set
*/
function CMsgVarField(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]];
}
/**
* CMsgVarField variable.
* @member {string} variable
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.variable = "";
/**
* CMsgVarField float.
* @member {number} float
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.float = 0;
/**
* CMsgVarField double.
* @member {number} double
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.double = 0;
/**
* CMsgVarField uint32.
* @member {number} uint32
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.uint32 = 0;
/**
* CMsgVarField uint64.
* @member {number|Long} uint64
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.uint64 = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* CMsgVarField sint32.
* @member {number} sint32
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.sint32 = 0;
/**
* CMsgVarField sint64.
* @member {number|Long} sint64
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.sint64 = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgVarField bool.
* @member {boolean} bool
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.bool = false;
/**
* CMsgVarField string.
* @member {string} string
* @memberof CMsgVarField
* @instance
*/
CMsgVarField.prototype.string = "";
// OneOf field names bound to virtual getters and setters
var $oneOfFields;
/**
* CMsgVarField value.
* @member {"float"|"double"|"uint32"|"uint64"|"sint32"|"sint64"|"bool"|"string"|undefined} value
* @memberof CMsgVarField
* @instance
*/
Object.defineProperty(CMsgVarField.prototype, "value", {
get: $util.oneOfGetter($oneOfFields = ["float", "double", "uint32", "uint64", "sint32", "sint64", "bool", "string"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Creates a new CMsgVarField instance using the specified properties.
* @function create
* @memberof CMsgVarField
* @static
* @param {ICMsgVarField=} [properties] Properties to set
* @returns {CMsgVarField} CMsgVarField instance
*/
CMsgVarField.create = function create(properties) {
return new CMsgVarField(properties);
};
/**
* Encodes the specified CMsgVarField message. Does not implicitly {@link CMsgVarField.verify|verify} messages.
* @function encode
* @memberof CMsgVarField
* @static
* @param {ICMsgVarField} message CMsgVarField message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgVarField.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.variable != null && message.hasOwnProperty("variable"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.variable);
if (message.float != null && message.hasOwnProperty("float"))
writer.uint32(/* id 2, wireType 5 =*/21).float(message.float);
if (message.double != null && message.hasOwnProperty("double"))
writer.uint32(/* id 3, wireType 1 =*/25).double(message.double);
if (message.uint32 != null && message.hasOwnProperty("uint32"))
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.uint32);
if (message.uint64 != null && message.hasOwnProperty("uint64"))
writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.uint64);
if (message.sint32 != null && message.hasOwnProperty("sint32"))
writer.uint32(/* id 6, wireType 0 =*/48).sint32(message.sint32);
if (message.sint64 != null && message.hasOwnProperty("sint64"))
writer.uint32(/* id 7, wireType 0 =*/56).sint64(message.sint64);
if (message.bool != null && message.hasOwnProperty("bool"))
writer.uint32(/* id 8, wireType 0 =*/64).bool(message.bool);
if (message.string != null && message.hasOwnProperty("string"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.string);
return writer;
};
/**
* Encodes the specified CMsgVarField message, length delimited. Does not implicitly {@link CMsgVarField.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgVarField
* @static
* @param {ICMsgVarField} message CMsgVarField message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgVarField.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgVarField message from the specified reader or buffer.
* @function decode
* @memberof CMsgVarField
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgVarField} CMsgVarField
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgVarField.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgVarField();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.variable = reader.string();
break;
case 2:
message.float = reader.float();
break;
case 3:
message.double = reader.double();
break;
case 4:
message.uint32 = reader.uint32();
break;
case 5:
message.uint64 = reader.uint64();
break;
case 6:
message.sint32 = reader.sint32();
break;
case 7:
message.sint64 = reader.sint64();
break;
case 8:
message.bool = reader.bool();
break;
case 9:
message.string = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgVarField message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgVarField
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgVarField} CMsgVarField
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgVarField.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgVarField message.
* @function verify
* @memberof CMsgVarField
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgVarField.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
var properties = {};
if (message.variable != null && message.hasOwnProperty("variable"))
if (!$util.isString(message.variable))
return "variable: string expected";
if (message.float != null && message.hasOwnProperty("float")) {
properties.value = 1;
if (typeof message.float !== "number")
return "float: number expected";
}
if (message.double != null && message.hasOwnProperty("double")) {
if (properties.value === 1)
return "value: multiple values";
properties.value = 1;
if (typeof message.double !== "number")
return "double: number expected";
}
if (message.uint32 != null && message.hasOwnProperty("uint32")) {
if (properties.value === 1)
return "value: multiple values";
properties.value = 1;
if (!$util.isInteger(message.uint32))
return "uint32: integer expected";
}
if (message.uint64 != null && message.hasOwnProperty("uint64")) {
if (properties.value === 1)
return "value: multiple values";
properties.value = 1;
if (!$util.isInteger(message.uint64) && !(message.uint64 && $util.isInteger(message.uint64.low) && $util.isInteger(message.uint64.high)))
return "uint64: integer|Long expected";
}
if (message.sint32 != null && message.hasOwnProperty("sint32")) {
if (properties.value === 1)
return "value: multiple values";
properties.value = 1;
if (!$util.isInteger(message.sint32))
return "sint32: integer expected";
}
if (message.sint64 != null && message.hasOwnProperty("sint64")) {
if (properties.value === 1)
return "value: multiple values";
properties.value = 1;
if (!$util.isInteger(message.sint64) && !(message.sint64 && $util.isInteger(message.sint64.low) && $util.isInteger(message.sint64.high)))
return "sint64: integer|Long expected";
}
if (message.bool != null && message.hasOwnProperty("bool")) {
if (properties.value === 1)
return "value: multiple values";
properties.value = 1;
if (typeof message.bool !== "boolean")
return "bool: boolean expected";
}
if (message.string != null && message.hasOwnProperty("string")) {
if (properties.value === 1)
return "value: multiple values";
properties.value = 1;
if (!$util.isString(message.string))
return "string: string expected";
}
return null;
};
/**
* Creates a CMsgVarField message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgVarField
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgVarField} CMsgVarField
*/
CMsgVarField.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgVarField)
return object;
var message = new $root.CMsgVarField();
if (object.variable != null)
message.variable = String(object.variable);
if (object.float != null)
message.float = Number(object.float);
if (object.double != null)
message.double = Number(object.double);
if (object.uint32 != null)
message.uint32 = object.uint32 >>> 0;
if (object.uint64 != null)
if ($util.Long)
(message.uint64 = $util.Long.fromValue(object.uint64)).unsigned = true;
else if (typeof object.uint64 === "string")
message.uint64 = parseInt(object.uint64, 10);
else if (typeof object.uint64 === "number")
message.uint64 = object.uint64;
else if (typeof object.uint64 === "object")
message.uint64 = new $util.LongBits(object.uint64.low >>> 0, object.uint64.high >>> 0).toNumber(true);
if (object.sint32 != null)
message.sint32 = object.sint32 | 0;
if (object.sint64 != null)
if ($util.Long)
(message.sint64 = $util.Long.fromValue(object.sint64)).unsigned = false;
else if (typeof object.sint64 === "string")
message.sint64 = parseInt(object.sint64, 10);
else if (typeof object.sint64 === "number")
message.sint64 = object.sint64;
else if (typeof object.sint64 === "object")
message.sint64 = new $util.LongBits(object.sint64.low >>> 0, object.sint64.high >>> 0).toNumber();
if (object.bool != null)
message.bool = Boolean(object.bool);
if (object.string != null)
message.string = String(object.string);
return message;
};
/**
* Creates a plain object from a CMsgVarField message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgVarField
* @static
* @param {CMsgVarField} message CMsgVarField
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgVarField.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.variable = "";
if (message.variable != null && message.hasOwnProperty("variable"))
object.variable = message.variable;
if (message.float != null && message.hasOwnProperty("float")) {
object.float = options.json && !isFinite(message.float) ? String(message.float) : message.float;
if (options.oneofs)
object.value = "float";
}
if (message.double != null && message.hasOwnProperty("double")) {
object.double = options.json && !isFinite(message.double) ? String(message.double) : message.double;
if (options.oneofs)
object.value = "double";
}
if (message.uint32 != null && message.hasOwnProperty("uint32")) {
object.uint32 = message.uint32;
if (options.oneofs)
object.value = "uint32";
}
if (message.uint64 != null && message.hasOwnProperty("uint64")) {
if (typeof message.uint64 === "number")
object.uint64 = options.longs === String ? String(message.uint64) : message.uint64;
else
object.uint64 = options.longs === String ? $util.Long.prototype.toString.call(message.uint64) : options.longs === Number ? new $util.LongBits(message.uint64.low >>> 0, message.uint64.high >>> 0).toNumber(true) : message.uint64;
if (options.oneofs)
object.value = "uint64";
}
if (message.sint32 != null && message.hasOwnProperty("sint32")) {
object.sint32 = message.sint32;
if (options.oneofs)
object.value = "sint32";
}
if (message.sint64 != null && message.hasOwnProperty("sint64")) {
if (typeof message.sint64 === "number")
object.sint64 = options.longs === String ? String(message.sint64) : message.sint64;
else
object.sint64 = options.longs === String ? $util.Long.prototype.toString.call(message.sint64) : options.longs === Number ? new $util.LongBits(message.sint64.low >>> 0, message.sint64.high >>> 0).toNumber() : message.sint64;
if (options.oneofs)
object.value = "sint64";
}
if (message.bool != null && message.hasOwnProperty("bool")) {
object.bool = message.bool;
if (options.oneofs)
object.value = "bool";
}
if (message.string != null && message.hasOwnProperty("string")) {
object.string = message.string;
if (options.oneofs)
object.value = "string";
}
return object;
};
/**
* Converts this CMsgVarField to JSON.
* @function toJSON
* @memberof CMsgVarField
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgVarField.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgVarField;
})();
$root.CMsgQuestMapStarType = (function() {
/**
* Properties of a CMsgQuestMapStarType.
* @exports ICMsgQuestMapStarType
* @interface ICMsgQuestMapStarType
* @property {ICMsgProtoDefHeader} header CMsgQuestMapStarType header
* @property {string|null} [name] CMsgQuestMapStarType name
*/
/**
* Constructs a new CMsgQuestMapStarType.
* @exports CMsgQuestMapStarType
* @classdesc Represents a CMsgQuestMapStarType.
* @implements ICMsgQuestMapStarType
* @constructor
* @param {ICMsgQuestMapStarType=} [properties] Properties to set
*/
function CMsgQuestMapStarType(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]];
}
/**
* CMsgQuestMapStarType header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgQuestMapStarType
* @instance
*/
CMsgQuestMapStarType.prototype.header = null;
/**
* CMsgQuestMapStarType name.
* @member {string} name
* @memberof CMsgQuestMapStarType
* @instance
*/
CMsgQuestMapStarType.prototype.name = "";
/**
* Creates a new CMsgQuestMapStarType instance using the specified properties.
* @function create
* @memberof CMsgQuestMapStarType
* @static
* @param {ICMsgQuestMapStarType=} [properties] Properties to set
* @returns {CMsgQuestMapStarType} CMsgQuestMapStarType instance
*/
CMsgQuestMapStarType.create = function create(properties) {
return new CMsgQuestMapStarType(properties);
};
/**
* Encodes the specified CMsgQuestMapStarType message. Does not implicitly {@link CMsgQuestMapStarType.verify|verify} messages.
* @function encode
* @memberof CMsgQuestMapStarType
* @static
* @param {ICMsgQuestMapStarType} message CMsgQuestMapStarType message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapStarType.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
return writer;
};
/**
* Encodes the specified CMsgQuestMapStarType message, length delimited. Does not implicitly {@link CMsgQuestMapStarType.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestMapStarType
* @static
* @param {ICMsgQuestMapStarType} message CMsgQuestMapStarType message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapStarType.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestMapStarType message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestMapStarType
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestMapStarType} CMsgQuestMapStarType
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapStarType.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestMapStarType();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
message.name = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestMapStarType message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestMapStarType
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestMapStarType} CMsgQuestMapStarType
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapStarType.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestMapStarType message.
* @function verify
* @memberof CMsgQuestMapStarType
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestMapStarType.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
return null;
};
/**
* Creates a CMsgQuestMapStarType message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestMapStarType
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestMapStarType} CMsgQuestMapStarType
*/
CMsgQuestMapStarType.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestMapStarType)
return object;
var message = new $root.CMsgQuestMapStarType();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgQuestMapStarType.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.name != null)
message.name = String(object.name);
return message;
};
/**
* Creates a plain object from a CMsgQuestMapStarType message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestMapStarType
* @static
* @param {CMsgQuestMapStarType} message CMsgQuestMapStarType
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestMapStarType.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.header = null;
object.name = "";
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
return object;
};
/**
* Converts this CMsgQuestMapStarType to JSON.
* @function toJSON
* @memberof CMsgQuestMapStarType
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestMapStarType.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgQuestMapStarType;
})();
$root.CMsgQuestMapNodeDef = (function() {
/**
* Properties of a CMsgQuestMapNodeDef.
* @exports ICMsgQuestMapNodeDef
* @interface ICMsgQuestMapNodeDef
* @property {ICMsgProtoDefHeader} header CMsgQuestMapNodeDef header
* @property {string|null} [name_loctoken] CMsgQuestMapNodeDef name_loctoken
* @property {number|null} [x_pos] CMsgQuestMapNodeDef x_pos
* @property {number|null} [y_pos] CMsgQuestMapNodeDef y_pos
* @property {ICMsgQuestMapNodeCondition|null} [condition] CMsgQuestMapNodeDef condition
* @property {ICMsgProtoDefID|null} [owning_region] CMsgQuestMapNodeDef owning_region
* @property {Array.<ICMsgProtoDefID>|null} [quest_options] CMsgQuestMapNodeDef quest_options
* @property {string|null} [associated_operation] CMsgQuestMapNodeDef associated_operation
* @property {string|null} [reward_item_name] CMsgQuestMapNodeDef reward_item_name
* @property {string|null} [reward_lootlist_name] CMsgQuestMapNodeDef reward_lootlist_name
* @property {ENodeCashReward|null} [cash_reward] CMsgQuestMapNodeDef cash_reward
* @property {ICMsgProtoDefID|null} [star_type] CMsgQuestMapNodeDef star_type
* @property {number|null} [stars_to_unlock] CMsgQuestMapNodeDef stars_to_unlock
*/
/**
* Constructs a new CMsgQuestMapNodeDef.
* @exports CMsgQuestMapNodeDef
* @classdesc Represents a CMsgQuestMapNodeDef.
* @implements ICMsgQuestMapNodeDef
* @constructor
* @param {ICMsgQuestMapNodeDef=} [properties] Properties to set
*/
function CMsgQuestMapNodeDef(properties) {
this.quest_options = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgQuestMapNodeDef header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.header = null;
/**
* CMsgQuestMapNodeDef name_loctoken.
* @member {string} name_loctoken
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.name_loctoken = "";
/**
* CMsgQuestMapNodeDef x_pos.
* @member {number} x_pos
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.x_pos = 0;
/**
* CMsgQuestMapNodeDef y_pos.
* @member {number} y_pos
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.y_pos = 0;
/**
* CMsgQuestMapNodeDef condition.
* @member {ICMsgQuestMapNodeCondition|null|undefined} condition
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.condition = null;
/**
* CMsgQuestMapNodeDef owning_region.
* @member {ICMsgProtoDefID|null|undefined} owning_region
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.owning_region = null;
/**
* CMsgQuestMapNodeDef quest_options.
* @member {Array.<ICMsgProtoDefID>} quest_options
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.quest_options = $util.emptyArray;
/**
* CMsgQuestMapNodeDef associated_operation.
* @member {string} associated_operation
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.associated_operation = "";
/**
* CMsgQuestMapNodeDef reward_item_name.
* @member {string} reward_item_name
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.reward_item_name = "";
/**
* CMsgQuestMapNodeDef reward_lootlist_name.
* @member {string} reward_lootlist_name
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.reward_lootlist_name = "";
/**
* CMsgQuestMapNodeDef cash_reward.
* @member {ENodeCashReward} cash_reward
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.cash_reward = 1;
/**
* CMsgQuestMapNodeDef star_type.
* @member {ICMsgProtoDefID|null|undefined} star_type
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.star_type = null;
/**
* CMsgQuestMapNodeDef stars_to_unlock.
* @member {number} stars_to_unlock
* @memberof CMsgQuestMapNodeDef
* @instance
*/
CMsgQuestMapNodeDef.prototype.stars_to_unlock = 1;
/**
* Creates a new CMsgQuestMapNodeDef instance using the specified properties.
* @function create
* @memberof CMsgQuestMapNodeDef
* @static
* @param {ICMsgQuestMapNodeDef=} [properties] Properties to set
* @returns {CMsgQuestMapNodeDef} CMsgQuestMapNodeDef instance
*/
CMsgQuestMapNodeDef.create = function create(properties) {
return new CMsgQuestMapNodeDef(properties);
};
/**
* Encodes the specified CMsgQuestMapNodeDef message. Does not implicitly {@link CMsgQuestMapNodeDef.verify|verify} messages.
* @function encode
* @memberof CMsgQuestMapNodeDef
* @static
* @param {ICMsgQuestMapNodeDef} message CMsgQuestMapNodeDef message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapNodeDef.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.name_loctoken != null && message.hasOwnProperty("name_loctoken"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.name_loctoken);
if (message.x_pos != null && message.hasOwnProperty("x_pos"))
writer.uint32(/* id 6, wireType 5 =*/53).float(message.x_pos);
if (message.y_pos != null && message.hasOwnProperty("y_pos"))
writer.uint32(/* id 7, wireType 5 =*/61).float(message.y_pos);
if (message.condition != null && message.hasOwnProperty("condition"))
$root.CMsgQuestMapNodeCondition.encode(message.condition, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.owning_region != null && message.hasOwnProperty("owning_region"))
$root.CMsgProtoDefID.encode(message.owning_region, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
if (message.quest_options != null && message.quest_options.length)
for (var i = 0; i < message.quest_options.length; ++i)
$root.CMsgProtoDefID.encode(message.quest_options[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
if (message.associated_operation != null && message.hasOwnProperty("associated_operation"))
writer.uint32(/* id 16, wireType 2 =*/130).string(message.associated_operation);
if (message.reward_item_name != null && message.hasOwnProperty("reward_item_name"))
writer.uint32(/* id 18, wireType 2 =*/146).string(message.reward_item_name);
if (message.cash_reward != null && message.hasOwnProperty("cash_reward"))
writer.uint32(/* id 19, wireType 0 =*/152).int32(message.cash_reward);
if (message.star_type != null && message.hasOwnProperty("star_type"))
$root.CMsgProtoDefID.encode(message.star_type, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();
if (message.stars_to_unlock != null && message.hasOwnProperty("stars_to_unlock"))
writer.uint32(/* id 21, wireType 0 =*/168).uint32(message.stars_to_unlock);
if (message.reward_lootlist_name != null && message.hasOwnProperty("reward_lootlist_name"))
writer.uint32(/* id 22, wireType 2 =*/178).string(message.reward_lootlist_name);
return writer;
};
/**
* Encodes the specified CMsgQuestMapNodeDef message, length delimited. Does not implicitly {@link CMsgQuestMapNodeDef.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestMapNodeDef
* @static
* @param {ICMsgQuestMapNodeDef} message CMsgQuestMapNodeDef message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapNodeDef.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestMapNodeDef message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestMapNodeDef
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestMapNodeDef} CMsgQuestMapNodeDef
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapNodeDef.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestMapNodeDef();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 4:
message.name_loctoken = reader.string();
break;
case 6:
message.x_pos = reader.float();
break;
case 7:
message.y_pos = reader.float();
break;
case 9:
message.condition = $root.CMsgQuestMapNodeCondition.decode(reader, reader.uint32());
break;
case 10:
message.owning_region = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 11:
if (!(message.quest_options && message.quest_options.length))
message.quest_options = [];
message.quest_options.push($root.CMsgProtoDefID.decode(reader, reader.uint32()));
break;
case 16:
message.associated_operation = reader.string();
break;
case 18:
message.reward_item_name = reader.string();
break;
case 22:
message.reward_lootlist_name = reader.string();
break;
case 19:
message.cash_reward = reader.int32();
break;
case 20:
message.star_type = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 21:
message.stars_to_unlock = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestMapNodeDef message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestMapNodeDef
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestMapNodeDef} CMsgQuestMapNodeDef
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapNodeDef.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestMapNodeDef message.
* @function verify
* @memberof CMsgQuestMapNodeDef
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestMapNodeDef.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.name_loctoken != null && message.hasOwnProperty("name_loctoken"))
if (!$util.isString(message.name_loctoken))
return "name_loctoken: string expected";
if (message.x_pos != null && message.hasOwnProperty("x_pos"))
if (typeof message.x_pos !== "number")
return "x_pos: number expected";
if (message.y_pos != null && message.hasOwnProperty("y_pos"))
if (typeof message.y_pos !== "number")
return "y_pos: number expected";
if (message.condition != null && message.hasOwnProperty("condition")) {
var error = $root.CMsgQuestMapNodeCondition.verify(message.condition);
if (error)
return "condition." + error;
}
if (message.owning_region != null && message.hasOwnProperty("owning_region")) {
var error = $root.CMsgProtoDefID.verify(message.owning_region);
if (error)
return "owning_region." + error;
}
if (message.quest_options != null && message.hasOwnProperty("quest_options")) {
if (!Array.isArray(message.quest_options))
return "quest_options: array expected";
for (var i = 0; i < message.quest_options.length; ++i) {
var error = $root.CMsgProtoDefID.verify(message.quest_options[i]);
if (error)
return "quest_options." + error;
}
}
if (message.associated_operation != null && message.hasOwnProperty("associated_operation"))
if (!$util.isString(message.associated_operation))
return "associated_operation: string expected";
if (message.reward_item_name != null && message.hasOwnProperty("reward_item_name"))
if (!$util.isString(message.reward_item_name))
return "reward_item_name: string expected";
if (message.reward_lootlist_name != null && message.hasOwnProperty("reward_lootlist_name"))
if (!$util.isString(message.reward_lootlist_name))
return "reward_lootlist_name: string expected";
if (message.cash_reward != null && message.hasOwnProperty("cash_reward"))
switch (message.cash_reward) {
default:
return "cash_reward: enum value expected";
case 1:
case 2:
case 3:
case 4:
break;
}
if (message.star_type != null && message.hasOwnProperty("star_type")) {
var error = $root.CMsgProtoDefID.verify(message.star_type);
if (error)
return "star_type." + error;
}
if (message.stars_to_unlock != null && message.hasOwnProperty("stars_to_unlock"))
if (!$util.isInteger(message.stars_to_unlock))
return "stars_to_unlock: integer expected";
return null;
};
/**
* Creates a CMsgQuestMapNodeDef message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestMapNodeDef
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestMapNodeDef} CMsgQuestMapNodeDef
*/
CMsgQuestMapNodeDef.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestMapNodeDef)
return object;
var message = new $root.CMsgQuestMapNodeDef();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgQuestMapNodeDef.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.name_loctoken != null)
message.name_loctoken = String(object.name_loctoken);
if (object.x_pos != null)
message.x_pos = Number(object.x_pos);
if (object.y_pos != null)
message.y_pos = Number(object.y_pos);
if (object.condition != null) {
if (typeof object.condition !== "object")
throw TypeError(".CMsgQuestMapNodeDef.condition: object expected");
message.condition = $root.CMsgQuestMapNodeCondition.fromObject(object.condition);
}
if (object.owning_region != null) {
if (typeof object.owning_region !== "object")
throw TypeError(".CMsgQuestMapNodeDef.owning_region: object expected");
message.owning_region = $root.CMsgProtoDefID.fromObject(object.owning_region);
}
if (object.quest_options) {
if (!Array.isArray(object.quest_options))
throw TypeError(".CMsgQuestMapNodeDef.quest_options: array expected");
message.quest_options = [];
for (var i = 0; i < object.quest_options.length; ++i) {
if (typeof object.quest_options[i] !== "object")
throw TypeError(".CMsgQuestMapNodeDef.quest_options: object expected");
message.quest_options[i] = $root.CMsgProtoDefID.fromObject(object.quest_options[i]);
}
}
if (object.associated_operation != null)
message.associated_operation = String(object.associated_operation);
if (object.reward_item_name != null)
message.reward_item_name = String(object.reward_item_name);
if (object.reward_lootlist_name != null)
message.reward_lootlist_name = String(object.reward_lootlist_name);
switch (object.cash_reward) {
case "CASH_REWARD_NONE":
case 1:
message.cash_reward = 1;
break;
case "CASH_REWARD_SMALL":
case 2:
message.cash_reward = 2;
break;
case "CASH_REWARD_MEDIUM":
case 3:
message.cash_reward = 3;
break;
case "CASH_REWARD_LARGE":
case 4:
message.cash_reward = 4;
break;
}
if (object.star_type != null) {
if (typeof object.star_type !== "object")
throw TypeError(".CMsgQuestMapNodeDef.star_type: object expected");
message.star_type = $root.CMsgProtoDefID.fromObject(object.star_type);
}
if (object.stars_to_unlock != null)
message.stars_to_unlock = object.stars_to_unlock >>> 0;
return message;
};
/**
* Creates a plain object from a CMsgQuestMapNodeDef message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestMapNodeDef
* @static
* @param {CMsgQuestMapNodeDef} message CMsgQuestMapNodeDef
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestMapNodeDef.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.quest_options = [];
if (options.defaults) {
object.header = null;
object.name_loctoken = "";
object.x_pos = 0;
object.y_pos = 0;
object.condition = null;
object.owning_region = null;
object.associated_operation = "";
object.reward_item_name = "";
object.cash_reward = options.enums === String ? "CASH_REWARD_NONE" : 1;
object.star_type = null;
object.stars_to_unlock = 1;
object.reward_lootlist_name = "";
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.name_loctoken != null && message.hasOwnProperty("name_loctoken"))
object.name_loctoken = message.name_loctoken;
if (message.x_pos != null && message.hasOwnProperty("x_pos"))
object.x_pos = options.json && !isFinite(message.x_pos) ? String(message.x_pos) : message.x_pos;
if (message.y_pos != null && message.hasOwnProperty("y_pos"))
object.y_pos = options.json && !isFinite(message.y_pos) ? String(message.y_pos) : message.y_pos;
if (message.condition != null && message.hasOwnProperty("condition"))
object.condition = $root.CMsgQuestMapNodeCondition.toObject(message.condition, options);
if (message.owning_region != null && message.hasOwnProperty("owning_region"))
object.owning_region = $root.CMsgProtoDefID.toObject(message.owning_region, options);
if (message.quest_options && message.quest_options.length) {
object.quest_options = [];
for (var j = 0; j < message.quest_options.length; ++j)
object.quest_options[j] = $root.CMsgProtoDefID.toObject(message.quest_options[j], options);
}
if (message.associated_operation != null && message.hasOwnProperty("associated_operation"))
object.associated_operation = message.associated_operation;
if (message.reward_item_name != null && message.hasOwnProperty("reward_item_name"))
object.reward_item_name = message.reward_item_name;
if (message.cash_reward != null && message.hasOwnProperty("cash_reward"))
object.cash_reward = options.enums === String ? $root.ENodeCashReward[message.cash_reward] : message.cash_reward;
if (message.star_type != null && message.hasOwnProperty("star_type"))
object.star_type = $root.CMsgProtoDefID.toObject(message.star_type, options);
if (message.stars_to_unlock != null && message.hasOwnProperty("stars_to_unlock"))
object.stars_to_unlock = message.stars_to_unlock;
if (message.reward_lootlist_name != null && message.hasOwnProperty("reward_lootlist_name"))
object.reward_lootlist_name = message.reward_lootlist_name;
return object;
};
/**
* Converts this CMsgQuestMapNodeDef to JSON.
* @function toJSON
* @memberof CMsgQuestMapNodeDef
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestMapNodeDef.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgQuestMapNodeDef;
})();
$root.CMsgPaintKit_Variables = (function() {
/**
* Properties of a CMsgPaintKit_Variables.
* @exports ICMsgPaintKit_Variables
* @interface ICMsgPaintKit_Variables
* @property {ICMsgProtoDefHeader} header CMsgPaintKit_Variables header
*/
/**
* Constructs a new CMsgPaintKit_Variables.
* @exports CMsgPaintKit_Variables
* @classdesc Represents a CMsgPaintKit_Variables.
* @implements ICMsgPaintKit_Variables
* @constructor
* @param {ICMsgPaintKit_Variables=} [properties] Properties to set
*/
function CMsgPaintKit_Variables(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]];
}
/**
* CMsgPaintKit_Variables header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgPaintKit_Variables
* @instance
*/
CMsgPaintKit_Variables.prototype.header = null;
/**
* Creates a new CMsgPaintKit_Variables instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Variables
* @static
* @param {ICMsgPaintKit_Variables=} [properties] Properties to set
* @returns {CMsgPaintKit_Variables} CMsgPaintKit_Variables instance
*/
CMsgPaintKit_Variables.create = function create(properties) {
return new CMsgPaintKit_Variables(properties);
};
/**
* Encodes the specified CMsgPaintKit_Variables message. Does not implicitly {@link CMsgPaintKit_Variables.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Variables
* @static
* @param {ICMsgPaintKit_Variables} message CMsgPaintKit_Variables message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Variables.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_Variables message, length delimited. Does not implicitly {@link CMsgPaintKit_Variables.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Variables
* @static
* @param {ICMsgPaintKit_Variables} message CMsgPaintKit_Variables message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Variables.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_Variables message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Variables
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Variables} CMsgPaintKit_Variables
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Variables.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Variables();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgPaintKit_Variables message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Variables
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Variables} CMsgPaintKit_Variables
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Variables.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_Variables message.
* @function verify
* @memberof CMsgPaintKit_Variables
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_Variables.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
return null;
};
/**
* Creates a CMsgPaintKit_Variables message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Variables
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Variables} CMsgPaintKit_Variables
*/
CMsgPaintKit_Variables.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Variables)
return object;
var message = new $root.CMsgPaintKit_Variables();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgPaintKit_Variables.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_Variables message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Variables
* @static
* @param {CMsgPaintKit_Variables} message CMsgPaintKit_Variables
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_Variables.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.header = null;
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
return object;
};
/**
* Converts this CMsgPaintKit_Variables to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Variables
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_Variables.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_Variables;
})();
$root.CMsgPaintKit_Operation_TextureStage = (function() {
/**
* Properties of a CMsgPaintKit_Operation_TextureStage.
* @exports ICMsgPaintKit_Operation_TextureStage
* @interface ICMsgPaintKit_Operation_TextureStage
* @property {ICMsgVarField|null} [texture] CMsgPaintKit_Operation_TextureStage texture
* @property {ICMsgVarField|null} [texture_red] CMsgPaintKit_Operation_TextureStage texture_red
* @property {ICMsgVarField|null} [texture_blue] CMsgPaintKit_Operation_TextureStage texture_blue
* @property {ICMsgVarField|null} [adjust_black] CMsgPaintKit_Operation_TextureStage adjust_black
* @property {ICMsgVarField|null} [adjust_offset] CMsgPaintKit_Operation_TextureStage adjust_offset
* @property {ICMsgVarField|null} [adjust_gamma] CMsgPaintKit_Operation_TextureStage adjust_gamma
* @property {ICMsgVarField|null} [rotation] CMsgPaintKit_Operation_TextureStage rotation
* @property {ICMsgVarField|null} [translate_u] CMsgPaintKit_Operation_TextureStage translate_u
* @property {ICMsgVarField|null} [translate_v] CMsgPaintKit_Operation_TextureStage translate_v
* @property {ICMsgVarField|null} [scale_uv] CMsgPaintKit_Operation_TextureStage scale_uv
* @property {ICMsgVarField|null} [flip_u] CMsgPaintKit_Operation_TextureStage flip_u
* @property {ICMsgVarField|null} [flip_v] CMsgPaintKit_Operation_TextureStage flip_v
*/
/**
* Constructs a new CMsgPaintKit_Operation_TextureStage.
* @exports CMsgPaintKit_Operation_TextureStage
* @classdesc Represents a CMsgPaintKit_Operation_TextureStage.
* @implements ICMsgPaintKit_Operation_TextureStage
* @constructor
* @param {ICMsgPaintKit_Operation_TextureStage=} [properties] Properties to set
*/
function CMsgPaintKit_Operation_TextureStage(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]];
}
/**
* CMsgPaintKit_Operation_TextureStage texture.
* @member {ICMsgVarField|null|undefined} texture
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.texture = null;
/**
* CMsgPaintKit_Operation_TextureStage texture_red.
* @member {ICMsgVarField|null|undefined} texture_red
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.texture_red = null;
/**
* CMsgPaintKit_Operation_TextureStage texture_blue.
* @member {ICMsgVarField|null|undefined} texture_blue
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.texture_blue = null;
/**
* CMsgPaintKit_Operation_TextureStage adjust_black.
* @member {ICMsgVarField|null|undefined} adjust_black
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.adjust_black = null;
/**
* CMsgPaintKit_Operation_TextureStage adjust_offset.
* @member {ICMsgVarField|null|undefined} adjust_offset
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.adjust_offset = null;
/**
* CMsgPaintKit_Operation_TextureStage adjust_gamma.
* @member {ICMsgVarField|null|undefined} adjust_gamma
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.adjust_gamma = null;
/**
* CMsgPaintKit_Operation_TextureStage rotation.
* @member {ICMsgVarField|null|undefined} rotation
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.rotation = null;
/**
* CMsgPaintKit_Operation_TextureStage translate_u.
* @member {ICMsgVarField|null|undefined} translate_u
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.translate_u = null;
/**
* CMsgPaintKit_Operation_TextureStage translate_v.
* @member {ICMsgVarField|null|undefined} translate_v
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.translate_v = null;
/**
* CMsgPaintKit_Operation_TextureStage scale_uv.
* @member {ICMsgVarField|null|undefined} scale_uv
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.scale_uv = null;
/**
* CMsgPaintKit_Operation_TextureStage flip_u.
* @member {ICMsgVarField|null|undefined} flip_u
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.flip_u = null;
/**
* CMsgPaintKit_Operation_TextureStage flip_v.
* @member {ICMsgVarField|null|undefined} flip_v
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
*/
CMsgPaintKit_Operation_TextureStage.prototype.flip_v = null;
/**
* Creates a new CMsgPaintKit_Operation_TextureStage instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Operation_TextureStage
* @static
* @param {ICMsgPaintKit_Operation_TextureStage=} [properties] Properties to set
* @returns {CMsgPaintKit_Operation_TextureStage} CMsgPaintKit_Operation_TextureStage instance
*/
CMsgPaintKit_Operation_TextureStage.create = function create(properties) {
return new CMsgPaintKit_Operation_TextureStage(properties);
};
/**
* Encodes the specified CMsgPaintKit_Operation_TextureStage message. Does not implicitly {@link CMsgPaintKit_Operation_TextureStage.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Operation_TextureStage
* @static
* @param {ICMsgPaintKit_Operation_TextureStage} message CMsgPaintKit_Operation_TextureStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_TextureStage.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.texture != null && message.hasOwnProperty("texture"))
$root.CMsgVarField.encode(message.texture, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.texture_red != null && message.hasOwnProperty("texture_red"))
$root.CMsgVarField.encode(message.texture_red, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.texture_blue != null && message.hasOwnProperty("texture_blue"))
$root.CMsgVarField.encode(message.texture_blue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.adjust_black != null && message.hasOwnProperty("adjust_black"))
$root.CMsgVarField.encode(message.adjust_black, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset"))
$root.CMsgVarField.encode(message.adjust_offset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma"))
$root.CMsgVarField.encode(message.adjust_gamma, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.rotation != null && message.hasOwnProperty("rotation"))
$root.CMsgVarField.encode(message.rotation, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.translate_u != null && message.hasOwnProperty("translate_u"))
$root.CMsgVarField.encode(message.translate_u, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
if (message.translate_v != null && message.hasOwnProperty("translate_v"))
$root.CMsgVarField.encode(message.translate_v, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.scale_uv != null && message.hasOwnProperty("scale_uv"))
$root.CMsgVarField.encode(message.scale_uv, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
if (message.flip_u != null && message.hasOwnProperty("flip_u"))
$root.CMsgVarField.encode(message.flip_u, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
if (message.flip_v != null && message.hasOwnProperty("flip_v"))
$root.CMsgVarField.encode(message.flip_v, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_Operation_TextureStage message, length delimited. Does not implicitly {@link CMsgPaintKit_Operation_TextureStage.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Operation_TextureStage
* @static
* @param {ICMsgPaintKit_Operation_TextureStage} message CMsgPaintKit_Operation_TextureStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_TextureStage.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_Operation_TextureStage message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Operation_TextureStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Operation_TextureStage} CMsgPaintKit_Operation_TextureStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_TextureStage.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Operation_TextureStage();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.texture = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 2:
message.texture_red = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 3:
message.texture_blue = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 4:
message.adjust_black = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 5:
message.adjust_offset = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 6:
message.adjust_gamma = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 7:
message.rotation = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 8:
message.translate_u = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 9:
message.translate_v = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 10:
message.scale_uv = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 11:
message.flip_u = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 12:
message.flip_v = $root.CMsgVarField.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgPaintKit_Operation_TextureStage message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Operation_TextureStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Operation_TextureStage} CMsgPaintKit_Operation_TextureStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_TextureStage.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_Operation_TextureStage message.
* @function verify
* @memberof CMsgPaintKit_Operation_TextureStage
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_Operation_TextureStage.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.texture != null && message.hasOwnProperty("texture")) {
var error = $root.CMsgVarField.verify(message.texture);
if (error)
return "texture." + error;
}
if (message.texture_red != null && message.hasOwnProperty("texture_red")) {
var error = $root.CMsgVarField.verify(message.texture_red);
if (error)
return "texture_red." + error;
}
if (message.texture_blue != null && message.hasOwnProperty("texture_blue")) {
var error = $root.CMsgVarField.verify(message.texture_blue);
if (error)
return "texture_blue." + error;
}
if (message.adjust_black != null && message.hasOwnProperty("adjust_black")) {
var error = $root.CMsgVarField.verify(message.adjust_black);
if (error)
return "adjust_black." + error;
}
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset")) {
var error = $root.CMsgVarField.verify(message.adjust_offset);
if (error)
return "adjust_offset." + error;
}
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma")) {
var error = $root.CMsgVarField.verify(message.adjust_gamma);
if (error)
return "adjust_gamma." + error;
}
if (message.rotation != null && message.hasOwnProperty("rotation")) {
var error = $root.CMsgVarField.verify(message.rotation);
if (error)
return "rotation." + error;
}
if (message.translate_u != null && message.hasOwnProperty("translate_u")) {
var error = $root.CMsgVarField.verify(message.translate_u);
if (error)
return "translate_u." + error;
}
if (message.translate_v != null && message.hasOwnProperty("translate_v")) {
var error = $root.CMsgVarField.verify(message.translate_v);
if (error)
return "translate_v." + error;
}
if (message.scale_uv != null && message.hasOwnProperty("scale_uv")) {
var error = $root.CMsgVarField.verify(message.scale_uv);
if (error)
return "scale_uv." + error;
}
if (message.flip_u != null && message.hasOwnProperty("flip_u")) {
var error = $root.CMsgVarField.verify(message.flip_u);
if (error)
return "flip_u." + error;
}
if (message.flip_v != null && message.hasOwnProperty("flip_v")) {
var error = $root.CMsgVarField.verify(message.flip_v);
if (error)
return "flip_v." + error;
}
return null;
};
/**
* Creates a CMsgPaintKit_Operation_TextureStage message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Operation_TextureStage
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Operation_TextureStage} CMsgPaintKit_Operation_TextureStage
*/
CMsgPaintKit_Operation_TextureStage.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Operation_TextureStage)
return object;
var message = new $root.CMsgPaintKit_Operation_TextureStage();
if (object.texture != null) {
if (typeof object.texture !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.texture: object expected");
message.texture = $root.CMsgVarField.fromObject(object.texture);
}
if (object.texture_red != null) {
if (typeof object.texture_red !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.texture_red: object expected");
message.texture_red = $root.CMsgVarField.fromObject(object.texture_red);
}
if (object.texture_blue != null) {
if (typeof object.texture_blue !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.texture_blue: object expected");
message.texture_blue = $root.CMsgVarField.fromObject(object.texture_blue);
}
if (object.adjust_black != null) {
if (typeof object.adjust_black !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.adjust_black: object expected");
message.adjust_black = $root.CMsgVarField.fromObject(object.adjust_black);
}
if (object.adjust_offset != null) {
if (typeof object.adjust_offset !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.adjust_offset: object expected");
message.adjust_offset = $root.CMsgVarField.fromObject(object.adjust_offset);
}
if (object.adjust_gamma != null) {
if (typeof object.adjust_gamma !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.adjust_gamma: object expected");
message.adjust_gamma = $root.CMsgVarField.fromObject(object.adjust_gamma);
}
if (object.rotation != null) {
if (typeof object.rotation !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.rotation: object expected");
message.rotation = $root.CMsgVarField.fromObject(object.rotation);
}
if (object.translate_u != null) {
if (typeof object.translate_u !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.translate_u: object expected");
message.translate_u = $root.CMsgVarField.fromObject(object.translate_u);
}
if (object.translate_v != null) {
if (typeof object.translate_v !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.translate_v: object expected");
message.translate_v = $root.CMsgVarField.fromObject(object.translate_v);
}
if (object.scale_uv != null) {
if (typeof object.scale_uv !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.scale_uv: object expected");
message.scale_uv = $root.CMsgVarField.fromObject(object.scale_uv);
}
if (object.flip_u != null) {
if (typeof object.flip_u !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.flip_u: object expected");
message.flip_u = $root.CMsgVarField.fromObject(object.flip_u);
}
if (object.flip_v != null) {
if (typeof object.flip_v !== "object")
throw TypeError(".CMsgPaintKit_Operation_TextureStage.flip_v: object expected");
message.flip_v = $root.CMsgVarField.fromObject(object.flip_v);
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_Operation_TextureStage message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Operation_TextureStage
* @static
* @param {CMsgPaintKit_Operation_TextureStage} message CMsgPaintKit_Operation_TextureStage
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_Operation_TextureStage.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.texture = null;
object.texture_red = null;
object.texture_blue = null;
object.adjust_black = null;
object.adjust_offset = null;
object.adjust_gamma = null;
object.rotation = null;
object.translate_u = null;
object.translate_v = null;
object.scale_uv = null;
object.flip_u = null;
object.flip_v = null;
}
if (message.texture != null && message.hasOwnProperty("texture"))
object.texture = $root.CMsgVarField.toObject(message.texture, options);
if (message.texture_red != null && message.hasOwnProperty("texture_red"))
object.texture_red = $root.CMsgVarField.toObject(message.texture_red, options);
if (message.texture_blue != null && message.hasOwnProperty("texture_blue"))
object.texture_blue = $root.CMsgVarField.toObject(message.texture_blue, options);
if (message.adjust_black != null && message.hasOwnProperty("adjust_black"))
object.adjust_black = $root.CMsgVarField.toObject(message.adjust_black, options);
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset"))
object.adjust_offset = $root.CMsgVarField.toObject(message.adjust_offset, options);
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma"))
object.adjust_gamma = $root.CMsgVarField.toObject(message.adjust_gamma, options);
if (message.rotation != null && message.hasOwnProperty("rotation"))
object.rotation = $root.CMsgVarField.toObject(message.rotation, options);
if (message.translate_u != null && message.hasOwnProperty("translate_u"))
object.translate_u = $root.CMsgVarField.toObject(message.translate_u, options);
if (message.translate_v != null && message.hasOwnProperty("translate_v"))
object.translate_v = $root.CMsgVarField.toObject(message.translate_v, options);
if (message.scale_uv != null && message.hasOwnProperty("scale_uv"))
object.scale_uv = $root.CMsgVarField.toObject(message.scale_uv, options);
if (message.flip_u != null && message.hasOwnProperty("flip_u"))
object.flip_u = $root.CMsgVarField.toObject(message.flip_u, options);
if (message.flip_v != null && message.hasOwnProperty("flip_v"))
object.flip_v = $root.CMsgVarField.toObject(message.flip_v, options);
return object;
};
/**
* Converts this CMsgPaintKit_Operation_TextureStage to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Operation_TextureStage
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_Operation_TextureStage.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_Operation_TextureStage;
})();
$root.CMsgPaintKit_Operation_CombineStage = (function() {
/**
* Properties of a CMsgPaintKit_Operation_CombineStage.
* @exports ICMsgPaintKit_Operation_CombineStage
* @interface ICMsgPaintKit_Operation_CombineStage
* @property {ICMsgVarField|null} [adjust_black] CMsgPaintKit_Operation_CombineStage adjust_black
* @property {ICMsgVarField|null} [adjust_offset] CMsgPaintKit_Operation_CombineStage adjust_offset
* @property {ICMsgVarField|null} [adjust_gamma] CMsgPaintKit_Operation_CombineStage adjust_gamma
* @property {ICMsgVarField|null} [rotation] CMsgPaintKit_Operation_CombineStage rotation
* @property {ICMsgVarField|null} [translate_u] CMsgPaintKit_Operation_CombineStage translate_u
* @property {ICMsgVarField|null} [translate_v] CMsgPaintKit_Operation_CombineStage translate_v
* @property {ICMsgVarField|null} [scale_uv] CMsgPaintKit_Operation_CombineStage scale_uv
* @property {ICMsgVarField|null} [flip_u] CMsgPaintKit_Operation_CombineStage flip_u
* @property {ICMsgVarField|null} [flip_v] CMsgPaintKit_Operation_CombineStage flip_v
* @property {Array.<ICMsgPaintKit_OperationNode>|null} [operation_node] CMsgPaintKit_Operation_CombineStage operation_node
*/
/**
* Constructs a new CMsgPaintKit_Operation_CombineStage.
* @exports CMsgPaintKit_Operation_CombineStage
* @classdesc Represents a CMsgPaintKit_Operation_CombineStage.
* @implements ICMsgPaintKit_Operation_CombineStage
* @constructor
* @param {ICMsgPaintKit_Operation_CombineStage=} [properties] Properties to set
*/
function CMsgPaintKit_Operation_CombineStage(properties) {
this.operation_node = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgPaintKit_Operation_CombineStage adjust_black.
* @member {ICMsgVarField|null|undefined} adjust_black
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.adjust_black = null;
/**
* CMsgPaintKit_Operation_CombineStage adjust_offset.
* @member {ICMsgVarField|null|undefined} adjust_offset
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.adjust_offset = null;
/**
* CMsgPaintKit_Operation_CombineStage adjust_gamma.
* @member {ICMsgVarField|null|undefined} adjust_gamma
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.adjust_gamma = null;
/**
* CMsgPaintKit_Operation_CombineStage rotation.
* @member {ICMsgVarField|null|undefined} rotation
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.rotation = null;
/**
* CMsgPaintKit_Operation_CombineStage translate_u.
* @member {ICMsgVarField|null|undefined} translate_u
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.translate_u = null;
/**
* CMsgPaintKit_Operation_CombineStage translate_v.
* @member {ICMsgVarField|null|undefined} translate_v
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.translate_v = null;
/**
* CMsgPaintKit_Operation_CombineStage scale_uv.
* @member {ICMsgVarField|null|undefined} scale_uv
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.scale_uv = null;
/**
* CMsgPaintKit_Operation_CombineStage flip_u.
* @member {ICMsgVarField|null|undefined} flip_u
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.flip_u = null;
/**
* CMsgPaintKit_Operation_CombineStage flip_v.
* @member {ICMsgVarField|null|undefined} flip_v
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.flip_v = null;
/**
* CMsgPaintKit_Operation_CombineStage operation_node.
* @member {Array.<ICMsgPaintKit_OperationNode>} operation_node
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
*/
CMsgPaintKit_Operation_CombineStage.prototype.operation_node = $util.emptyArray;
/**
* Creates a new CMsgPaintKit_Operation_CombineStage instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Operation_CombineStage
* @static
* @param {ICMsgPaintKit_Operation_CombineStage=} [properties] Properties to set
* @returns {CMsgPaintKit_Operation_CombineStage} CMsgPaintKit_Operation_CombineStage instance
*/
CMsgPaintKit_Operation_CombineStage.create = function create(properties) {
return new CMsgPaintKit_Operation_CombineStage(properties);
};
/**
* Encodes the specified CMsgPaintKit_Operation_CombineStage message. Does not implicitly {@link CMsgPaintKit_Operation_CombineStage.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Operation_CombineStage
* @static
* @param {ICMsgPaintKit_Operation_CombineStage} message CMsgPaintKit_Operation_CombineStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_CombineStage.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.adjust_black != null && message.hasOwnProperty("adjust_black"))
$root.CMsgVarField.encode(message.adjust_black, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset"))
$root.CMsgVarField.encode(message.adjust_offset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma"))
$root.CMsgVarField.encode(message.adjust_gamma, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.rotation != null && message.hasOwnProperty("rotation"))
$root.CMsgVarField.encode(message.rotation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.translate_u != null && message.hasOwnProperty("translate_u"))
$root.CMsgVarField.encode(message.translate_u, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.translate_v != null && message.hasOwnProperty("translate_v"))
$root.CMsgVarField.encode(message.translate_v, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.scale_uv != null && message.hasOwnProperty("scale_uv"))
$root.CMsgVarField.encode(message.scale_uv, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.flip_u != null && message.hasOwnProperty("flip_u"))
$root.CMsgVarField.encode(message.flip_u, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
if (message.flip_v != null && message.hasOwnProperty("flip_v"))
$root.CMsgVarField.encode(message.flip_v, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.operation_node != null && message.operation_node.length)
for (var i = 0; i < message.operation_node.length; ++i)
$root.CMsgPaintKit_OperationNode.encode(message.operation_node[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_Operation_CombineStage message, length delimited. Does not implicitly {@link CMsgPaintKit_Operation_CombineStage.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Operation_CombineStage
* @static
* @param {ICMsgPaintKit_Operation_CombineStage} message CMsgPaintKit_Operation_CombineStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_CombineStage.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_Operation_CombineStage message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Operation_CombineStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Operation_CombineStage} CMsgPaintKit_Operation_CombineStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_CombineStage.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Operation_CombineStage();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.adjust_black = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 2:
message.adjust_offset = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 3:
message.adjust_gamma = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 4:
message.rotation = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 5:
message.translate_u = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 6:
message.translate_v = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 7:
message.scale_uv = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 8:
message.flip_u = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 9:
message.flip_v = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 11:
if (!(message.operation_node && message.operation_node.length))
message.operation_node = [];
message.operation_node.push($root.CMsgPaintKit_OperationNode.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgPaintKit_Operation_CombineStage message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Operation_CombineStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Operation_CombineStage} CMsgPaintKit_Operation_CombineStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_CombineStage.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_Operation_CombineStage message.
* @function verify
* @memberof CMsgPaintKit_Operation_CombineStage
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_Operation_CombineStage.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.adjust_black != null && message.hasOwnProperty("adjust_black")) {
var error = $root.CMsgVarField.verify(message.adjust_black);
if (error)
return "adjust_black." + error;
}
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset")) {
var error = $root.CMsgVarField.verify(message.adjust_offset);
if (error)
return "adjust_offset." + error;
}
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma")) {
var error = $root.CMsgVarField.verify(message.adjust_gamma);
if (error)
return "adjust_gamma." + error;
}
if (message.rotation != null && message.hasOwnProperty("rotation")) {
var error = $root.CMsgVarField.verify(message.rotation);
if (error)
return "rotation." + error;
}
if (message.translate_u != null && message.hasOwnProperty("translate_u")) {
var error = $root.CMsgVarField.verify(message.translate_u);
if (error)
return "translate_u." + error;
}
if (message.translate_v != null && message.hasOwnProperty("translate_v")) {
var error = $root.CMsgVarField.verify(message.translate_v);
if (error)
return "translate_v." + error;
}
if (message.scale_uv != null && message.hasOwnProperty("scale_uv")) {
var error = $root.CMsgVarField.verify(message.scale_uv);
if (error)
return "scale_uv." + error;
}
if (message.flip_u != null && message.hasOwnProperty("flip_u")) {
var error = $root.CMsgVarField.verify(message.flip_u);
if (error)
return "flip_u." + error;
}
if (message.flip_v != null && message.hasOwnProperty("flip_v")) {
var error = $root.CMsgVarField.verify(message.flip_v);
if (error)
return "flip_v." + error;
}
if (message.operation_node != null && message.hasOwnProperty("operation_node")) {
if (!Array.isArray(message.operation_node))
return "operation_node: array expected";
for (var i = 0; i < message.operation_node.length; ++i) {
var error = $root.CMsgPaintKit_OperationNode.verify(message.operation_node[i]);
if (error)
return "operation_node." + error;
}
}
return null;
};
/**
* Creates a CMsgPaintKit_Operation_CombineStage message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Operation_CombineStage
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Operation_CombineStage} CMsgPaintKit_Operation_CombineStage
*/
CMsgPaintKit_Operation_CombineStage.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Operation_CombineStage)
return object;
var message = new $root.CMsgPaintKit_Operation_CombineStage();
if (object.adjust_black != null) {
if (typeof object.adjust_black !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.adjust_black: object expected");
message.adjust_black = $root.CMsgVarField.fromObject(object.adjust_black);
}
if (object.adjust_offset != null) {
if (typeof object.adjust_offset !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.adjust_offset: object expected");
message.adjust_offset = $root.CMsgVarField.fromObject(object.adjust_offset);
}
if (object.adjust_gamma != null) {
if (typeof object.adjust_gamma !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.adjust_gamma: object expected");
message.adjust_gamma = $root.CMsgVarField.fromObject(object.adjust_gamma);
}
if (object.rotation != null) {
if (typeof object.rotation !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.rotation: object expected");
message.rotation = $root.CMsgVarField.fromObject(object.rotation);
}
if (object.translate_u != null) {
if (typeof object.translate_u !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.translate_u: object expected");
message.translate_u = $root.CMsgVarField.fromObject(object.translate_u);
}
if (object.translate_v != null) {
if (typeof object.translate_v !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.translate_v: object expected");
message.translate_v = $root.CMsgVarField.fromObject(object.translate_v);
}
if (object.scale_uv != null) {
if (typeof object.scale_uv !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.scale_uv: object expected");
message.scale_uv = $root.CMsgVarField.fromObject(object.scale_uv);
}
if (object.flip_u != null) {
if (typeof object.flip_u !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.flip_u: object expected");
message.flip_u = $root.CMsgVarField.fromObject(object.flip_u);
}
if (object.flip_v != null) {
if (typeof object.flip_v !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.flip_v: object expected");
message.flip_v = $root.CMsgVarField.fromObject(object.flip_v);
}
if (object.operation_node) {
if (!Array.isArray(object.operation_node))
throw TypeError(".CMsgPaintKit_Operation_CombineStage.operation_node: array expected");
message.operation_node = [];
for (var i = 0; i < object.operation_node.length; ++i) {
if (typeof object.operation_node[i] !== "object")
throw TypeError(".CMsgPaintKit_Operation_CombineStage.operation_node: object expected");
message.operation_node[i] = $root.CMsgPaintKit_OperationNode.fromObject(object.operation_node[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_Operation_CombineStage message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Operation_CombineStage
* @static
* @param {CMsgPaintKit_Operation_CombineStage} message CMsgPaintKit_Operation_CombineStage
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_Operation_CombineStage.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.operation_node = [];
if (options.defaults) {
object.adjust_black = null;
object.adjust_offset = null;
object.adjust_gamma = null;
object.rotation = null;
object.translate_u = null;
object.translate_v = null;
object.scale_uv = null;
object.flip_u = null;
object.flip_v = null;
}
if (message.adjust_black != null && message.hasOwnProperty("adjust_black"))
object.adjust_black = $root.CMsgVarField.toObject(message.adjust_black, options);
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset"))
object.adjust_offset = $root.CMsgVarField.toObject(message.adjust_offset, options);
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma"))
object.adjust_gamma = $root.CMsgVarField.toObject(message.adjust_gamma, options);
if (message.rotation != null && message.hasOwnProperty("rotation"))
object.rotation = $root.CMsgVarField.toObject(message.rotation, options);
if (message.translate_u != null && message.hasOwnProperty("translate_u"))
object.translate_u = $root.CMsgVarField.toObject(message.translate_u, options);
if (message.translate_v != null && message.hasOwnProperty("translate_v"))
object.translate_v = $root.CMsgVarField.toObject(message.translate_v, options);
if (message.scale_uv != null && message.hasOwnProperty("scale_uv"))
object.scale_uv = $root.CMsgVarField.toObject(message.scale_uv, options);
if (message.flip_u != null && message.hasOwnProperty("flip_u"))
object.flip_u = $root.CMsgVarField.toObject(message.flip_u, options);
if (message.flip_v != null && message.hasOwnProperty("flip_v"))
object.flip_v = $root.CMsgVarField.toObject(message.flip_v, options);
if (message.operation_node && message.operation_node.length) {
object.operation_node = [];
for (var j = 0; j < message.operation_node.length; ++j)
object.operation_node[j] = $root.CMsgPaintKit_OperationNode.toObject(message.operation_node[j], options);
}
return object;
};
/**
* Converts this CMsgPaintKit_Operation_CombineStage to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Operation_CombineStage
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_Operation_CombineStage.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_Operation_CombineStage;
})();
$root.CMsgPaintKit_Operation_SelectStage = (function() {
/**
* Properties of a CMsgPaintKit_Operation_SelectStage.
* @exports ICMsgPaintKit_Operation_SelectStage
* @interface ICMsgPaintKit_Operation_SelectStage
* @property {ICMsgVarField|null} [groups] CMsgPaintKit_Operation_SelectStage groups
* @property {Array.<ICMsgVarField>|null} [select] CMsgPaintKit_Operation_SelectStage select
*/
/**
* Constructs a new CMsgPaintKit_Operation_SelectStage.
* @exports CMsgPaintKit_Operation_SelectStage
* @classdesc Represents a CMsgPaintKit_Operation_SelectStage.
* @implements ICMsgPaintKit_Operation_SelectStage
* @constructor
* @param {ICMsgPaintKit_Operation_SelectStage=} [properties] Properties to set
*/
function CMsgPaintKit_Operation_SelectStage(properties) {
this.select = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgPaintKit_Operation_SelectStage groups.
* @member {ICMsgVarField|null|undefined} groups
* @memberof CMsgPaintKit_Operation_SelectStage
* @instance
*/
CMsgPaintKit_Operation_SelectStage.prototype.groups = null;
/**
* CMsgPaintKit_Operation_SelectStage select.
* @member {Array.<ICMsgVarField>} select
* @memberof CMsgPaintKit_Operation_SelectStage
* @instance
*/
CMsgPaintKit_Operation_SelectStage.prototype.select = $util.emptyArray;
/**
* Creates a new CMsgPaintKit_Operation_SelectStage instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Operation_SelectStage
* @static
* @param {ICMsgPaintKit_Operation_SelectStage=} [properties] Properties to set
* @returns {CMsgPaintKit_Operation_SelectStage} CMsgPaintKit_Operation_SelectStage instance
*/
CMsgPaintKit_Operation_SelectStage.create = function create(properties) {
return new CMsgPaintKit_Operation_SelectStage(properties);
};
/**
* Encodes the specified CMsgPaintKit_Operation_SelectStage message. Does not implicitly {@link CMsgPaintKit_Operation_SelectStage.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Operation_SelectStage
* @static
* @param {ICMsgPaintKit_Operation_SelectStage} message CMsgPaintKit_Operation_SelectStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_SelectStage.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.groups != null && message.hasOwnProperty("groups"))
$root.CMsgVarField.encode(message.groups, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.select != null && message.select.length)
for (var i = 0; i < message.select.length; ++i)
$root.CMsgVarField.encode(message.select[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_Operation_SelectStage message, length delimited. Does not implicitly {@link CMsgPaintKit_Operation_SelectStage.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Operation_SelectStage
* @static
* @param {ICMsgPaintKit_Operation_SelectStage} message CMsgPaintKit_Operation_SelectStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_SelectStage.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_Operation_SelectStage message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Operation_SelectStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Operation_SelectStage} CMsgPaintKit_Operation_SelectStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_SelectStage.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Operation_SelectStage();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.groups = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 2:
if (!(message.select && message.select.length))
message.select = [];
message.select.push($root.CMsgVarField.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgPaintKit_Operation_SelectStage message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Operation_SelectStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Operation_SelectStage} CMsgPaintKit_Operation_SelectStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_SelectStage.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_Operation_SelectStage message.
* @function verify
* @memberof CMsgPaintKit_Operation_SelectStage
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_Operation_SelectStage.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.groups != null && message.hasOwnProperty("groups")) {
var error = $root.CMsgVarField.verify(message.groups);
if (error)
return "groups." + error;
}
if (message.select != null && message.hasOwnProperty("select")) {
if (!Array.isArray(message.select))
return "select: array expected";
for (var i = 0; i < message.select.length; ++i) {
var error = $root.CMsgVarField.verify(message.select[i]);
if (error)
return "select." + error;
}
}
return null;
};
/**
* Creates a CMsgPaintKit_Operation_SelectStage message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Operation_SelectStage
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Operation_SelectStage} CMsgPaintKit_Operation_SelectStage
*/
CMsgPaintKit_Operation_SelectStage.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Operation_SelectStage)
return object;
var message = new $root.CMsgPaintKit_Operation_SelectStage();
if (object.groups != null) {
if (typeof object.groups !== "object")
throw TypeError(".CMsgPaintKit_Operation_SelectStage.groups: object expected");
message.groups = $root.CMsgVarField.fromObject(object.groups);
}
if (object.select) {
if (!Array.isArray(object.select))
throw TypeError(".CMsgPaintKit_Operation_SelectStage.select: array expected");
message.select = [];
for (var i = 0; i < object.select.length; ++i) {
if (typeof object.select[i] !== "object")
throw TypeError(".CMsgPaintKit_Operation_SelectStage.select: object expected");
message.select[i] = $root.CMsgVarField.fromObject(object.select[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_Operation_SelectStage message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Operation_SelectStage
* @static
* @param {CMsgPaintKit_Operation_SelectStage} message CMsgPaintKit_Operation_SelectStage
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_Operation_SelectStage.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.select = [];
if (options.defaults)
object.groups = null;
if (message.groups != null && message.hasOwnProperty("groups"))
object.groups = $root.CMsgVarField.toObject(message.groups, options);
if (message.select && message.select.length) {
object.select = [];
for (var j = 0; j < message.select.length; ++j)
object.select[j] = $root.CMsgVarField.toObject(message.select[j], options);
}
return object;
};
/**
* Converts this CMsgPaintKit_Operation_SelectStage to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Operation_SelectStage
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_Operation_SelectStage.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_Operation_SelectStage;
})();
$root.CMsgPaintKit_Operation_Sticker = (function() {
/**
* Properties of a CMsgPaintKit_Operation_Sticker.
* @exports ICMsgPaintKit_Operation_Sticker
* @interface ICMsgPaintKit_Operation_Sticker
* @property {ICMsgVarField|null} [base] CMsgPaintKit_Operation_Sticker base
* @property {ICMsgVarField|null} [weight] CMsgPaintKit_Operation_Sticker weight
* @property {ICMsgVarField|null} [spec] CMsgPaintKit_Operation_Sticker spec
*/
/**
* Constructs a new CMsgPaintKit_Operation_Sticker.
* @exports CMsgPaintKit_Operation_Sticker
* @classdesc Represents a CMsgPaintKit_Operation_Sticker.
* @implements ICMsgPaintKit_Operation_Sticker
* @constructor
* @param {ICMsgPaintKit_Operation_Sticker=} [properties] Properties to set
*/
function CMsgPaintKit_Operation_Sticker(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]];
}
/**
* CMsgPaintKit_Operation_Sticker base.
* @member {ICMsgVarField|null|undefined} base
* @memberof CMsgPaintKit_Operation_Sticker
* @instance
*/
CMsgPaintKit_Operation_Sticker.prototype.base = null;
/**
* CMsgPaintKit_Operation_Sticker weight.
* @member {ICMsgVarField|null|undefined} weight
* @memberof CMsgPaintKit_Operation_Sticker
* @instance
*/
CMsgPaintKit_Operation_Sticker.prototype.weight = null;
/**
* CMsgPaintKit_Operation_Sticker spec.
* @member {ICMsgVarField|null|undefined} spec
* @memberof CMsgPaintKit_Operation_Sticker
* @instance
*/
CMsgPaintKit_Operation_Sticker.prototype.spec = null;
/**
* Creates a new CMsgPaintKit_Operation_Sticker instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Operation_Sticker
* @static
* @param {ICMsgPaintKit_Operation_Sticker=} [properties] Properties to set
* @returns {CMsgPaintKit_Operation_Sticker} CMsgPaintKit_Operation_Sticker instance
*/
CMsgPaintKit_Operation_Sticker.create = function create(properties) {
return new CMsgPaintKit_Operation_Sticker(properties);
};
/**
* Encodes the specified CMsgPaintKit_Operation_Sticker message. Does not implicitly {@link CMsgPaintKit_Operation_Sticker.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Operation_Sticker
* @static
* @param {ICMsgPaintKit_Operation_Sticker} message CMsgPaintKit_Operation_Sticker message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_Sticker.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.base != null && message.hasOwnProperty("base"))
$root.CMsgVarField.encode(message.base, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.weight != null && message.hasOwnProperty("weight"))
$root.CMsgVarField.encode(message.weight, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.spec != null && message.hasOwnProperty("spec"))
$root.CMsgVarField.encode(message.spec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_Operation_Sticker message, length delimited. Does not implicitly {@link CMsgPaintKit_Operation_Sticker.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Operation_Sticker
* @static
* @param {ICMsgPaintKit_Operation_Sticker} message CMsgPaintKit_Operation_Sticker message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_Sticker.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_Operation_Sticker message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Operation_Sticker
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Operation_Sticker} CMsgPaintKit_Operation_Sticker
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_Sticker.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Operation_Sticker();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.base = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 2:
message.weight = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 3:
message.spec = $root.CMsgVarField.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgPaintKit_Operation_Sticker message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Operation_Sticker
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Operation_Sticker} CMsgPaintKit_Operation_Sticker
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_Sticker.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_Operation_Sticker message.
* @function verify
* @memberof CMsgPaintKit_Operation_Sticker
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_Operation_Sticker.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.base != null && message.hasOwnProperty("base")) {
var error = $root.CMsgVarField.verify(message.base);
if (error)
return "base." + error;
}
if (message.weight != null && message.hasOwnProperty("weight")) {
var error = $root.CMsgVarField.verify(message.weight);
if (error)
return "weight." + error;
}
if (message.spec != null && message.hasOwnProperty("spec")) {
var error = $root.CMsgVarField.verify(message.spec);
if (error)
return "spec." + error;
}
return null;
};
/**
* Creates a CMsgPaintKit_Operation_Sticker message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Operation_Sticker
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Operation_Sticker} CMsgPaintKit_Operation_Sticker
*/
CMsgPaintKit_Operation_Sticker.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Operation_Sticker)
return object;
var message = new $root.CMsgPaintKit_Operation_Sticker();
if (object.base != null) {
if (typeof object.base !== "object")
throw TypeError(".CMsgPaintKit_Operation_Sticker.base: object expected");
message.base = $root.CMsgVarField.fromObject(object.base);
}
if (object.weight != null) {
if (typeof object.weight !== "object")
throw TypeError(".CMsgPaintKit_Operation_Sticker.weight: object expected");
message.weight = $root.CMsgVarField.fromObject(object.weight);
}
if (object.spec != null) {
if (typeof object.spec !== "object")
throw TypeError(".CMsgPaintKit_Operation_Sticker.spec: object expected");
message.spec = $root.CMsgVarField.fromObject(object.spec);
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_Operation_Sticker message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Operation_Sticker
* @static
* @param {CMsgPaintKit_Operation_Sticker} message CMsgPaintKit_Operation_Sticker
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_Operation_Sticker.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.base = null;
object.weight = null;
object.spec = null;
}
if (message.base != null && message.hasOwnProperty("base"))
object.base = $root.CMsgVarField.toObject(message.base, options);
if (message.weight != null && message.hasOwnProperty("weight"))
object.weight = $root.CMsgVarField.toObject(message.weight, options);
if (message.spec != null && message.hasOwnProperty("spec"))
object.spec = $root.CMsgVarField.toObject(message.spec, options);
return object;
};
/**
* Converts this CMsgPaintKit_Operation_Sticker to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Operation_Sticker
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_Operation_Sticker.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_Operation_Sticker;
})();
$root.CMsgPaintKit_Operation_StickerStage = (function() {
/**
* Properties of a CMsgPaintKit_Operation_StickerStage.
* @exports ICMsgPaintKit_Operation_StickerStage
* @interface ICMsgPaintKit_Operation_StickerStage
* @property {Array.<ICMsgPaintKit_Operation_Sticker>|null} [sticker] CMsgPaintKit_Operation_StickerStage sticker
* @property {ICMsgVarField|null} [dest_tl] CMsgPaintKit_Operation_StickerStage dest_tl
* @property {ICMsgVarField|null} [dest_tr] CMsgPaintKit_Operation_StickerStage dest_tr
* @property {ICMsgVarField|null} [dest_bl] CMsgPaintKit_Operation_StickerStage dest_bl
* @property {ICMsgVarField|null} [adjust_black] CMsgPaintKit_Operation_StickerStage adjust_black
* @property {ICMsgVarField|null} [adjust_offset] CMsgPaintKit_Operation_StickerStage adjust_offset
* @property {ICMsgVarField|null} [adjust_gamma] CMsgPaintKit_Operation_StickerStage adjust_gamma
* @property {Array.<ICMsgPaintKit_OperationNode>|null} [operation_node] CMsgPaintKit_Operation_StickerStage operation_node
*/
/**
* Constructs a new CMsgPaintKit_Operation_StickerStage.
* @exports CMsgPaintKit_Operation_StickerStage
* @classdesc Represents a CMsgPaintKit_Operation_StickerStage.
* @implements ICMsgPaintKit_Operation_StickerStage
* @constructor
* @param {ICMsgPaintKit_Operation_StickerStage=} [properties] Properties to set
*/
function CMsgPaintKit_Operation_StickerStage(properties) {
this.sticker = [];
this.operation_node = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgPaintKit_Operation_StickerStage sticker.
* @member {Array.<ICMsgPaintKit_Operation_Sticker>} sticker
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
*/
CMsgPaintKit_Operation_StickerStage.prototype.sticker = $util.emptyArray;
/**
* CMsgPaintKit_Operation_StickerStage dest_tl.
* @member {ICMsgVarField|null|undefined} dest_tl
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
*/
CMsgPaintKit_Operation_StickerStage.prototype.dest_tl = null;
/**
* CMsgPaintKit_Operation_StickerStage dest_tr.
* @member {ICMsgVarField|null|undefined} dest_tr
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
*/
CMsgPaintKit_Operation_StickerStage.prototype.dest_tr = null;
/**
* CMsgPaintKit_Operation_StickerStage dest_bl.
* @member {ICMsgVarField|null|undefined} dest_bl
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
*/
CMsgPaintKit_Operation_StickerStage.prototype.dest_bl = null;
/**
* CMsgPaintKit_Operation_StickerStage adjust_black.
* @member {ICMsgVarField|null|undefined} adjust_black
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
*/
CMsgPaintKit_Operation_StickerStage.prototype.adjust_black = null;
/**
* CMsgPaintKit_Operation_StickerStage adjust_offset.
* @member {ICMsgVarField|null|undefined} adjust_offset
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
*/
CMsgPaintKit_Operation_StickerStage.prototype.adjust_offset = null;
/**
* CMsgPaintKit_Operation_StickerStage adjust_gamma.
* @member {ICMsgVarField|null|undefined} adjust_gamma
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
*/
CMsgPaintKit_Operation_StickerStage.prototype.adjust_gamma = null;
/**
* CMsgPaintKit_Operation_StickerStage operation_node.
* @member {Array.<ICMsgPaintKit_OperationNode>} operation_node
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
*/
CMsgPaintKit_Operation_StickerStage.prototype.operation_node = $util.emptyArray;
/**
* Creates a new CMsgPaintKit_Operation_StickerStage instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Operation_StickerStage
* @static
* @param {ICMsgPaintKit_Operation_StickerStage=} [properties] Properties to set
* @returns {CMsgPaintKit_Operation_StickerStage} CMsgPaintKit_Operation_StickerStage instance
*/
CMsgPaintKit_Operation_StickerStage.create = function create(properties) {
return new CMsgPaintKit_Operation_StickerStage(properties);
};
/**
* Encodes the specified CMsgPaintKit_Operation_StickerStage message. Does not implicitly {@link CMsgPaintKit_Operation_StickerStage.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Operation_StickerStage
* @static
* @param {ICMsgPaintKit_Operation_StickerStage} message CMsgPaintKit_Operation_StickerStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_StickerStage.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.sticker != null && message.sticker.length)
for (var i = 0; i < message.sticker.length; ++i)
$root.CMsgPaintKit_Operation_Sticker.encode(message.sticker[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.dest_tl != null && message.hasOwnProperty("dest_tl"))
$root.CMsgVarField.encode(message.dest_tl, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.dest_tr != null && message.hasOwnProperty("dest_tr"))
$root.CMsgVarField.encode(message.dest_tr, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.dest_bl != null && message.hasOwnProperty("dest_bl"))
$root.CMsgVarField.encode(message.dest_bl, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.adjust_black != null && message.hasOwnProperty("adjust_black"))
$root.CMsgVarField.encode(message.adjust_black, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset"))
$root.CMsgVarField.encode(message.adjust_offset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma"))
$root.CMsgVarField.encode(message.adjust_gamma, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.operation_node != null && message.operation_node.length)
for (var i = 0; i < message.operation_node.length; ++i)
$root.CMsgPaintKit_OperationNode.encode(message.operation_node[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_Operation_StickerStage message, length delimited. Does not implicitly {@link CMsgPaintKit_Operation_StickerStage.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Operation_StickerStage
* @static
* @param {ICMsgPaintKit_Operation_StickerStage} message CMsgPaintKit_Operation_StickerStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation_StickerStage.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_Operation_StickerStage message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Operation_StickerStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Operation_StickerStage} CMsgPaintKit_Operation_StickerStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_StickerStage.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Operation_StickerStage();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.sticker && message.sticker.length))
message.sticker = [];
message.sticker.push($root.CMsgPaintKit_Operation_Sticker.decode(reader, reader.uint32()));
break;
case 2:
message.dest_tl = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 3:
message.dest_tr = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 4:
message.dest_bl = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 5:
message.adjust_black = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 6:
message.adjust_offset = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 7:
message.adjust_gamma = $root.CMsgVarField.decode(reader, reader.uint32());
break;
case 9:
if (!(message.operation_node && message.operation_node.length))
message.operation_node = [];
message.operation_node.push($root.CMsgPaintKit_OperationNode.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgPaintKit_Operation_StickerStage message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Operation_StickerStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Operation_StickerStage} CMsgPaintKit_Operation_StickerStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation_StickerStage.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_Operation_StickerStage message.
* @function verify
* @memberof CMsgPaintKit_Operation_StickerStage
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_Operation_StickerStage.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.sticker != null && message.hasOwnProperty("sticker")) {
if (!Array.isArray(message.sticker))
return "sticker: array expected";
for (var i = 0; i < message.sticker.length; ++i) {
var error = $root.CMsgPaintKit_Operation_Sticker.verify(message.sticker[i]);
if (error)
return "sticker." + error;
}
}
if (message.dest_tl != null && message.hasOwnProperty("dest_tl")) {
var error = $root.CMsgVarField.verify(message.dest_tl);
if (error)
return "dest_tl." + error;
}
if (message.dest_tr != null && message.hasOwnProperty("dest_tr")) {
var error = $root.CMsgVarField.verify(message.dest_tr);
if (error)
return "dest_tr." + error;
}
if (message.dest_bl != null && message.hasOwnProperty("dest_bl")) {
var error = $root.CMsgVarField.verify(message.dest_bl);
if (error)
return "dest_bl." + error;
}
if (message.adjust_black != null && message.hasOwnProperty("adjust_black")) {
var error = $root.CMsgVarField.verify(message.adjust_black);
if (error)
return "adjust_black." + error;
}
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset")) {
var error = $root.CMsgVarField.verify(message.adjust_offset);
if (error)
return "adjust_offset." + error;
}
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma")) {
var error = $root.CMsgVarField.verify(message.adjust_gamma);
if (error)
return "adjust_gamma." + error;
}
if (message.operation_node != null && message.hasOwnProperty("operation_node")) {
if (!Array.isArray(message.operation_node))
return "operation_node: array expected";
for (var i = 0; i < message.operation_node.length; ++i) {
var error = $root.CMsgPaintKit_OperationNode.verify(message.operation_node[i]);
if (error)
return "operation_node." + error;
}
}
return null;
};
/**
* Creates a CMsgPaintKit_Operation_StickerStage message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Operation_StickerStage
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Operation_StickerStage} CMsgPaintKit_Operation_StickerStage
*/
CMsgPaintKit_Operation_StickerStage.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Operation_StickerStage)
return object;
var message = new $root.CMsgPaintKit_Operation_StickerStage();
if (object.sticker) {
if (!Array.isArray(object.sticker))
throw TypeError(".CMsgPaintKit_Operation_StickerStage.sticker: array expected");
message.sticker = [];
for (var i = 0; i < object.sticker.length; ++i) {
if (typeof object.sticker[i] !== "object")
throw TypeError(".CMsgPaintKit_Operation_StickerStage.sticker: object expected");
message.sticker[i] = $root.CMsgPaintKit_Operation_Sticker.fromObject(object.sticker[i]);
}
}
if (object.dest_tl != null) {
if (typeof object.dest_tl !== "object")
throw TypeError(".CMsgPaintKit_Operation_StickerStage.dest_tl: object expected");
message.dest_tl = $root.CMsgVarField.fromObject(object.dest_tl);
}
if (object.dest_tr != null) {
if (typeof object.dest_tr !== "object")
throw TypeError(".CMsgPaintKit_Operation_StickerStage.dest_tr: object expected");
message.dest_tr = $root.CMsgVarField.fromObject(object.dest_tr);
}
if (object.dest_bl != null) {
if (typeof object.dest_bl !== "object")
throw TypeError(".CMsgPaintKit_Operation_StickerStage.dest_bl: object expected");
message.dest_bl = $root.CMsgVarField.fromObject(object.dest_bl);
}
if (object.adjust_black != null) {
if (typeof object.adjust_black !== "object")
throw TypeError(".CMsgPaintKit_Operation_StickerStage.adjust_black: object expected");
message.adjust_black = $root.CMsgVarField.fromObject(object.adjust_black);
}
if (object.adjust_offset != null) {
if (typeof object.adjust_offset !== "object")
throw TypeError(".CMsgPaintKit_Operation_StickerStage.adjust_offset: object expected");
message.adjust_offset = $root.CMsgVarField.fromObject(object.adjust_offset);
}
if (object.adjust_gamma != null) {
if (typeof object.adjust_gamma !== "object")
throw TypeError(".CMsgPaintKit_Operation_StickerStage.adjust_gamma: object expected");
message.adjust_gamma = $root.CMsgVarField.fromObject(object.adjust_gamma);
}
if (object.operation_node) {
if (!Array.isArray(object.operation_node))
throw TypeError(".CMsgPaintKit_Operation_StickerStage.operation_node: array expected");
message.operation_node = [];
for (var i = 0; i < object.operation_node.length; ++i) {
if (typeof object.operation_node[i] !== "object")
throw TypeError(".CMsgPaintKit_Operation_StickerStage.operation_node: object expected");
message.operation_node[i] = $root.CMsgPaintKit_OperationNode.fromObject(object.operation_node[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_Operation_StickerStage message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Operation_StickerStage
* @static
* @param {CMsgPaintKit_Operation_StickerStage} message CMsgPaintKit_Operation_StickerStage
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_Operation_StickerStage.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.sticker = [];
object.operation_node = [];
}
if (options.defaults) {
object.dest_tl = null;
object.dest_tr = null;
object.dest_bl = null;
object.adjust_black = null;
object.adjust_offset = null;
object.adjust_gamma = null;
}
if (message.sticker && message.sticker.length) {
object.sticker = [];
for (var j = 0; j < message.sticker.length; ++j)
object.sticker[j] = $root.CMsgPaintKit_Operation_Sticker.toObject(message.sticker[j], options);
}
if (message.dest_tl != null && message.hasOwnProperty("dest_tl"))
object.dest_tl = $root.CMsgVarField.toObject(message.dest_tl, options);
if (message.dest_tr != null && message.hasOwnProperty("dest_tr"))
object.dest_tr = $root.CMsgVarField.toObject(message.dest_tr, options);
if (message.dest_bl != null && message.hasOwnProperty("dest_bl"))
object.dest_bl = $root.CMsgVarField.toObject(message.dest_bl, options);
if (message.adjust_black != null && message.hasOwnProperty("adjust_black"))
object.adjust_black = $root.CMsgVarField.toObject(message.adjust_black, options);
if (message.adjust_offset != null && message.hasOwnProperty("adjust_offset"))
object.adjust_offset = $root.CMsgVarField.toObject(message.adjust_offset, options);
if (message.adjust_gamma != null && message.hasOwnProperty("adjust_gamma"))
object.adjust_gamma = $root.CMsgVarField.toObject(message.adjust_gamma, options);
if (message.operation_node && message.operation_node.length) {
object.operation_node = [];
for (var j = 0; j < message.operation_node.length; ++j)
object.operation_node[j] = $root.CMsgPaintKit_OperationNode.toObject(message.operation_node[j], options);
}
return object;
};
/**
* Converts this CMsgPaintKit_Operation_StickerStage to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Operation_StickerStage
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_Operation_StickerStage.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_Operation_StickerStage;
})();
$root.CMsgPaintKit_OperationStage = (function() {
/**
* Properties of a CMsgPaintKit_OperationStage.
* @exports ICMsgPaintKit_OperationStage
* @interface ICMsgPaintKit_OperationStage
* @property {ICMsgPaintKit_Operation_TextureStage|null} [texture_lookup] CMsgPaintKit_OperationStage texture_lookup
* @property {ICMsgPaintKit_Operation_CombineStage|null} [combine_add] CMsgPaintKit_OperationStage combine_add
* @property {ICMsgPaintKit_Operation_CombineStage|null} [combine_lerp] CMsgPaintKit_OperationStage combine_lerp
* @property {ICMsgPaintKit_Operation_CombineStage|null} [combine_multiply] CMsgPaintKit_OperationStage combine_multiply
* @property {ICMsgPaintKit_Operation_SelectStage|null} [select] CMsgPaintKit_OperationStage select
* @property {ICMsgPaintKit_Operation_StickerStage|null} [apply_sticker] CMsgPaintKit_OperationStage apply_sticker
*/
/**
* Constructs a new CMsgPaintKit_OperationStage.
* @exports CMsgPaintKit_OperationStage
* @classdesc Represents a CMsgPaintKit_OperationStage.
* @implements ICMsgPaintKit_OperationStage
* @constructor
* @param {ICMsgPaintKit_OperationStage=} [properties] Properties to set
*/
function CMsgPaintKit_OperationStage(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]];
}
/**
* CMsgPaintKit_OperationStage texture_lookup.
* @member {ICMsgPaintKit_Operation_TextureStage|null|undefined} texture_lookup
* @memberof CMsgPaintKit_OperationStage
* @instance
*/
CMsgPaintKit_OperationStage.prototype.texture_lookup = null;
/**
* CMsgPaintKit_OperationStage combine_add.
* @member {ICMsgPaintKit_Operation_CombineStage|null|undefined} combine_add
* @memberof CMsgPaintKit_OperationStage
* @instance
*/
CMsgPaintKit_OperationStage.prototype.combine_add = null;
/**
* CMsgPaintKit_OperationStage combine_lerp.
* @member {ICMsgPaintKit_Operation_CombineStage|null|undefined} combine_lerp
* @memberof CMsgPaintKit_OperationStage
* @instance
*/
CMsgPaintKit_OperationStage.prototype.combine_lerp = null;
/**
* CMsgPaintKit_OperationStage combine_multiply.
* @member {ICMsgPaintKit_Operation_CombineStage|null|undefined} combine_multiply
* @memberof CMsgPaintKit_OperationStage
* @instance
*/
CMsgPaintKit_OperationStage.prototype.combine_multiply = null;
/**
* CMsgPaintKit_OperationStage select.
* @member {ICMsgPaintKit_Operation_SelectStage|null|undefined} select
* @memberof CMsgPaintKit_OperationStage
* @instance
*/
CMsgPaintKit_OperationStage.prototype.select = null;
/**
* CMsgPaintKit_OperationStage apply_sticker.
* @member {ICMsgPaintKit_Operation_StickerStage|null|undefined} apply_sticker
* @memberof CMsgPaintKit_OperationStage
* @instance
*/
CMsgPaintKit_OperationStage.prototype.apply_sticker = null;
// OneOf field names bound to virtual getters and setters
var $oneOfFields;
/**
* CMsgPaintKit_OperationStage stage.
* @member {"texture_lookup"|"combine_add"|"combine_lerp"|"combine_multiply"|"select"|"apply_sticker"|undefined} stage
* @memberof CMsgPaintKit_OperationStage
* @instance
*/
Object.defineProperty(CMsgPaintKit_OperationStage.prototype, "stage", {
get: $util.oneOfGetter($oneOfFields = ["texture_lookup", "combine_add", "combine_lerp", "combine_multiply", "select", "apply_sticker"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Creates a new CMsgPaintKit_OperationStage instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_OperationStage
* @static
* @param {ICMsgPaintKit_OperationStage=} [properties] Properties to set
* @returns {CMsgPaintKit_OperationStage} CMsgPaintKit_OperationStage instance
*/
CMsgPaintKit_OperationStage.create = function create(properties) {
return new CMsgPaintKit_OperationStage(properties);
};
/**
* Encodes the specified CMsgPaintKit_OperationStage message. Does not implicitly {@link CMsgPaintKit_OperationStage.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_OperationStage
* @static
* @param {ICMsgPaintKit_OperationStage} message CMsgPaintKit_OperationStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_OperationStage.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.texture_lookup != null && message.hasOwnProperty("texture_lookup"))
$root.CMsgPaintKit_Operation_TextureStage.encode(message.texture_lookup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.combine_add != null && message.hasOwnProperty("combine_add"))
$root.CMsgPaintKit_Operation_CombineStage.encode(message.combine_add, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.combine_lerp != null && message.hasOwnProperty("combine_lerp"))
$root.CMsgPaintKit_Operation_CombineStage.encode(message.combine_lerp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.combine_multiply != null && message.hasOwnProperty("combine_multiply"))
$root.CMsgPaintKit_Operation_CombineStage.encode(message.combine_multiply, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.select != null && message.hasOwnProperty("select"))
$root.CMsgPaintKit_Operation_SelectStage.encode(message.select, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.apply_sticker != null && message.hasOwnProperty("apply_sticker"))
$root.CMsgPaintKit_Operation_StickerStage.encode(message.apply_sticker, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_OperationStage message, length delimited. Does not implicitly {@link CMsgPaintKit_OperationStage.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_OperationStage
* @static
* @param {ICMsgPaintKit_OperationStage} message CMsgPaintKit_OperationStage message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_OperationStage.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_OperationStage message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_OperationStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_OperationStage} CMsgPaintKit_OperationStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_OperationStage.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_OperationStage();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.texture_lookup = $root.CMsgPaintKit_Operation_TextureStage.decode(reader, reader.uint32());
break;
case 2:
message.combine_add = $root.CMsgPaintKit_Operation_CombineStage.decode(reader, reader.uint32());
break;
case 3:
message.combine_lerp = $root.CMsgPaintKit_Operation_CombineStage.decode(reader, reader.uint32());
break;
case 4:
message.combine_multiply = $root.CMsgPaintKit_Operation_CombineStage.decode(reader, reader.uint32());
break;
case 5:
message.select = $root.CMsgPaintKit_Operation_SelectStage.decode(reader, reader.uint32());
break;
case 6:
message.apply_sticker = $root.CMsgPaintKit_Operation_StickerStage.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgPaintKit_OperationStage message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_OperationStage
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_OperationStage} CMsgPaintKit_OperationStage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_OperationStage.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_OperationStage message.
* @function verify
* @memberof CMsgPaintKit_OperationStage
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_OperationStage.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
var properties = {};
if (message.texture_lookup != null && message.hasOwnProperty("texture_lookup")) {
properties.stage = 1;
{
var error = $root.CMsgPaintKit_Operation_TextureStage.verify(message.texture_lookup);
if (error)
return "texture_lookup." + error;
}
}
if (message.combine_add != null && message.hasOwnProperty("combine_add")) {
if (properties.stage === 1)
return "stage: multiple values";
properties.stage = 1;
{
var error = $root.CMsgPaintKit_Operation_CombineStage.verify(message.combine_add);
if (error)
return "combine_add." + error;
}
}
if (message.combine_lerp != null && message.hasOwnProperty("combine_lerp")) {
if (properties.stage === 1)
return "stage: multiple values";
properties.stage = 1;
{
var error = $root.CMsgPaintKit_Operation_CombineStage.verify(message.combine_lerp);
if (error)
return "combine_lerp." + error;
}
}
if (message.combine_multiply != null && message.hasOwnProperty("combine_multiply")) {
if (properties.stage === 1)
return "stage: multiple values";
properties.stage = 1;
{
var error = $root.CMsgPaintKit_Operation_CombineStage.verify(message.combine_multiply);
if (error)
return "combine_multiply." + error;
}
}
if (message.select != null && message.hasOwnProperty("select")) {
if (properties.stage === 1)
return "stage: multiple values";
properties.stage = 1;
{
var error = $root.CMsgPaintKit_Operation_SelectStage.verify(message.select);
if (error)
return "select." + error;
}
}
if (message.apply_sticker != null && message.hasOwnProperty("apply_sticker")) {
if (properties.stage === 1)
return "stage: multiple values";
properties.stage = 1;
{
var error = $root.CMsgPaintKit_Operation_StickerStage.verify(message.apply_sticker);
if (error)
return "apply_sticker." + error;
}
}
return null;
};
/**
* Creates a CMsgPaintKit_OperationStage message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_OperationStage
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_OperationStage} CMsgPaintKit_OperationStage
*/
CMsgPaintKit_OperationStage.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_OperationStage)
return object;
var message = new $root.CMsgPaintKit_OperationStage();
if (object.texture_lookup != null) {
if (typeof object.texture_lookup !== "object")
throw TypeError(".CMsgPaintKit_OperationStage.texture_lookup: object expected");
message.texture_lookup = $root.CMsgPaintKit_Operation_TextureStage.fromObject(object.texture_lookup);
}
if (object.combine_add != null) {
if (typeof object.combine_add !== "object")
throw TypeError(".CMsgPaintKit_OperationStage.combine_add: object expected");
message.combine_add = $root.CMsgPaintKit_Operation_CombineStage.fromObject(object.combine_add);
}
if (object.combine_lerp != null) {
if (typeof object.combine_lerp !== "object")
throw TypeError(".CMsgPaintKit_OperationStage.combine_lerp: object expected");
message.combine_lerp = $root.CMsgPaintKit_Operation_CombineStage.fromObject(object.combine_lerp);
}
if (object.combine_multiply != null) {
if (typeof object.combine_multiply !== "object")
throw TypeError(".CMsgPaintKit_OperationStage.combine_multiply: object expected");
message.combine_multiply = $root.CMsgPaintKit_Operation_CombineStage.fromObject(object.combine_multiply);
}
if (object.select != null) {
if (typeof object.select !== "object")
throw TypeError(".CMsgPaintKit_OperationStage.select: object expected");
message.select = $root.CMsgPaintKit_Operation_SelectStage.fromObject(object.select);
}
if (object.apply_sticker != null) {
if (typeof object.apply_sticker !== "object")
throw TypeError(".CMsgPaintKit_OperationStage.apply_sticker: object expected");
message.apply_sticker = $root.CMsgPaintKit_Operation_StickerStage.fromObject(object.apply_sticker);
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_OperationStage message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_OperationStage
* @static
* @param {CMsgPaintKit_OperationStage} message CMsgPaintKit_OperationStage
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_OperationStage.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (message.texture_lookup != null && message.hasOwnProperty("texture_lookup")) {
object.texture_lookup = $root.CMsgPaintKit_Operation_TextureStage.toObject(message.texture_lookup, options);
if (options.oneofs)
object.stage = "texture_lookup";
}
if (message.combine_add != null && message.hasOwnProperty("combine_add")) {
object.combine_add = $root.CMsgPaintKit_Operation_CombineStage.toObject(message.combine_add, options);
if (options.oneofs)
object.stage = "combine_add";
}
if (message.combine_lerp != null && message.hasOwnProperty("combine_lerp")) {
object.combine_lerp = $root.CMsgPaintKit_Operation_CombineStage.toObject(message.combine_lerp, options);
if (options.oneofs)
object.stage = "combine_lerp";
}
if (message.combine_multiply != null && message.hasOwnProperty("combine_multiply")) {
object.combine_multiply = $root.CMsgPaintKit_Operation_CombineStage.toObject(message.combine_multiply, options);
if (options.oneofs)
object.stage = "combine_multiply";
}
if (message.select != null && message.hasOwnProperty("select")) {
object.select = $root.CMsgPaintKit_Operation_SelectStage.toObject(message.select, options);
if (options.oneofs)
object.stage = "select";
}
if (message.apply_sticker != null && message.hasOwnProperty("apply_sticker")) {
object.apply_sticker = $root.CMsgPaintKit_Operation_StickerStage.toObject(message.apply_sticker, options);
if (options.oneofs)
object.stage = "apply_sticker";
}
return object;
};
/**
* Converts this CMsgPaintKit_OperationStage to JSON.
* @function toJSON
* @memberof CMsgPaintKit_OperationStage
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_OperationStage.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_OperationStage;
})();
$root.CMsgPaintKit_OperationNode = (function() {
/**
* Properties of a CMsgPaintKit_OperationNode.
* @exports ICMsgPaintKit_OperationNode
* @interface ICMsgPaintKit_OperationNode
* @property {ICMsgPaintKit_OperationStage|null} [stage] CMsgPaintKit_OperationNode stage
* @property {ICMsgProtoDefID|null} [operation_template] CMsgPaintKit_OperationNode operation_template
*/
/**
* Constructs a new CMsgPaintKit_OperationNode.
* @exports CMsgPaintKit_OperationNode
* @classdesc Represents a CMsgPaintKit_OperationNode.
* @implements ICMsgPaintKit_OperationNode
* @constructor
* @param {ICMsgPaintKit_OperationNode=} [properties] Properties to set
*/
function CMsgPaintKit_OperationNode(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]];
}
/**
* CMsgPaintKit_OperationNode stage.
* @member {ICMsgPaintKit_OperationStage|null|undefined} stage
* @memberof CMsgPaintKit_OperationNode
* @instance
*/
CMsgPaintKit_OperationNode.prototype.stage = null;
/**
* CMsgPaintKit_OperationNode operation_template.
* @member {ICMsgProtoDefID|null|undefined} operation_template
* @memberof CMsgPaintKit_OperationNode
* @instance
*/
CMsgPaintKit_OperationNode.prototype.operation_template = null;
// OneOf field names bound to virtual getters and setters
var $oneOfFields;
/**
* CMsgPaintKit_OperationNode node.
* @member {"stage"|"operation_template"|undefined} node
* @memberof CMsgPaintKit_OperationNode
* @instance
*/
Object.defineProperty(CMsgPaintKit_OperationNode.prototype, "node", {
get: $util.oneOfGetter($oneOfFields = ["stage", "operation_template"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Creates a new CMsgPaintKit_OperationNode instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_OperationNode
* @static
* @param {ICMsgPaintKit_OperationNode=} [properties] Properties to set
* @returns {CMsgPaintKit_OperationNode} CMsgPaintKit_OperationNode instance
*/
CMsgPaintKit_OperationNode.create = function create(properties) {
return new CMsgPaintKit_OperationNode(properties);
};
/**
* Encodes the specified CMsgPaintKit_OperationNode message. Does not implicitly {@link CMsgPaintKit_OperationNode.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_OperationNode
* @static
* @param {ICMsgPaintKit_OperationNode} message CMsgPaintKit_OperationNode message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_OperationNode.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.stage != null && message.hasOwnProperty("stage"))
$root.CMsgPaintKit_OperationStage.encode(message.stage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.operation_template != null && message.hasOwnProperty("operation_template"))
$root.CMsgProtoDefID.encode(message.operation_template, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_OperationNode message, length delimited. Does not implicitly {@link CMsgPaintKit_OperationNode.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_OperationNode
* @static
* @param {ICMsgPaintKit_OperationNode} message CMsgPaintKit_OperationNode message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_OperationNode.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_OperationNode message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_OperationNode
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_OperationNode} CMsgPaintKit_OperationNode
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_OperationNode.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_OperationNode();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.stage = $root.CMsgPaintKit_OperationStage.decode(reader, reader.uint32());
break;
case 2:
message.operation_template = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgPaintKit_OperationNode message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_OperationNode
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_OperationNode} CMsgPaintKit_OperationNode
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_OperationNode.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_OperationNode message.
* @function verify
* @memberof CMsgPaintKit_OperationNode
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_OperationNode.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
var properties = {};
if (message.stage != null && message.hasOwnProperty("stage")) {
properties.node = 1;
{
var error = $root.CMsgPaintKit_OperationStage.verify(message.stage);
if (error)
return "stage." + error;
}
}
if (message.operation_template != null && message.hasOwnProperty("operation_template")) {
if (properties.node === 1)
return "node: multiple values";
properties.node = 1;
{
var error = $root.CMsgProtoDefID.verify(message.operation_template);
if (error)
return "operation_template." + error;
}
}
return null;
};
/**
* Creates a CMsgPaintKit_OperationNode message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_OperationNode
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_OperationNode} CMsgPaintKit_OperationNode
*/
CMsgPaintKit_OperationNode.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_OperationNode)
return object;
var message = new $root.CMsgPaintKit_OperationNode();
if (object.stage != null) {
if (typeof object.stage !== "object")
throw TypeError(".CMsgPaintKit_OperationNode.stage: object expected");
message.stage = $root.CMsgPaintKit_OperationStage.fromObject(object.stage);
}
if (object.operation_template != null) {
if (typeof object.operation_template !== "object")
throw TypeError(".CMsgPaintKit_OperationNode.operation_template: object expected");
message.operation_template = $root.CMsgProtoDefID.fromObject(object.operation_template);
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_OperationNode message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_OperationNode
* @static
* @param {CMsgPaintKit_OperationNode} message CMsgPaintKit_OperationNode
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_OperationNode.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (message.stage != null && message.hasOwnProperty("stage")) {
object.stage = $root.CMsgPaintKit_OperationStage.toObject(message.stage, options);
if (options.oneofs)
object.node = "stage";
}
if (message.operation_template != null && message.hasOwnProperty("operation_template")) {
object.operation_template = $root.CMsgProtoDefID.toObject(message.operation_template, options);
if (options.oneofs)
object.node = "operation_template";
}
return object;
};
/**
* Converts this CMsgPaintKit_OperationNode to JSON.
* @function toJSON
* @memberof CMsgPaintKit_OperationNode
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_OperationNode.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_OperationNode;
})();
$root.CMsgPaintKit_Operation = (function() {
/**
* Properties of a CMsgPaintKit_Operation.
* @exports ICMsgPaintKit_Operation
* @interface ICMsgPaintKit_Operation
* @property {ICMsgProtoDefHeader} header CMsgPaintKit_Operation header
* @property {Array.<ICMsgPaintKit_OperationNode>|null} [operation_node] CMsgPaintKit_Operation operation_node
*/
/**
* Constructs a new CMsgPaintKit_Operation.
* @exports CMsgPaintKit_Operation
* @classdesc Represents a CMsgPaintKit_Operation.
* @implements ICMsgPaintKit_Operation
* @constructor
* @param {ICMsgPaintKit_Operation=} [properties] Properties to set
*/
function CMsgPaintKit_Operation(properties) {
this.operation_node = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgPaintKit_Operation header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgPaintKit_Operation
* @instance
*/
CMsgPaintKit_Operation.prototype.header = null;
/**
* CMsgPaintKit_Operation operation_node.
* @member {Array.<ICMsgPaintKit_OperationNode>} operation_node
* @memberof CMsgPaintKit_Operation
* @instance
*/
CMsgPaintKit_Operation.prototype.operation_node = $util.emptyArray;
/**
* Creates a new CMsgPaintKit_Operation instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Operation
* @static
* @param {ICMsgPaintKit_Operation=} [properties] Properties to set
* @returns {CMsgPaintKit_Operation} CMsgPaintKit_Operation instance
*/
CMsgPaintKit_Operation.create = function create(properties) {
return new CMsgPaintKit_Operation(properties);
};
/**
* Encodes the specified CMsgPaintKit_Operation message. Does not implicitly {@link CMsgPaintKit_Operation.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Operation
* @static
* @param {ICMsgPaintKit_Operation} message CMsgPaintKit_Operation message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.operation_node != null && message.operation_node.length)
for (var i = 0; i < message.operation_node.length; ++i)
$root.CMsgPaintKit_OperationNode.encode(message.operation_node[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_Operation message, length delimited. Does not implicitly {@link CMsgPaintKit_Operation.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Operation
* @static
* @param {ICMsgPaintKit_Operation} message CMsgPaintKit_Operation message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Operation.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_Operation message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Operation
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Operation} CMsgPaintKit_Operation
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Operation();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
if (!(message.operation_node && message.operation_node.length))
message.operation_node = [];
message.operation_node.push($root.CMsgPaintKit_OperationNode.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgPaintKit_Operation message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Operation
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Operation} CMsgPaintKit_Operation
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Operation.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_Operation message.
* @function verify
* @memberof CMsgPaintKit_Operation
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_Operation.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.operation_node != null && message.hasOwnProperty("operation_node")) {
if (!Array.isArray(message.operation_node))
return "operation_node: array expected";
for (var i = 0; i < message.operation_node.length; ++i) {
var error = $root.CMsgPaintKit_OperationNode.verify(message.operation_node[i]);
if (error)
return "operation_node." + error;
}
}
return null;
};
/**
* Creates a CMsgPaintKit_Operation message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Operation
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Operation} CMsgPaintKit_Operation
*/
CMsgPaintKit_Operation.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Operation)
return object;
var message = new $root.CMsgPaintKit_Operation();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgPaintKit_Operation.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.operation_node) {
if (!Array.isArray(object.operation_node))
throw TypeError(".CMsgPaintKit_Operation.operation_node: array expected");
message.operation_node = [];
for (var i = 0; i < object.operation_node.length; ++i) {
if (typeof object.operation_node[i] !== "object")
throw TypeError(".CMsgPaintKit_Operation.operation_node: object expected");
message.operation_node[i] = $root.CMsgPaintKit_OperationNode.fromObject(object.operation_node[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_Operation message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Operation
* @static
* @param {CMsgPaintKit_Operation} message CMsgPaintKit_Operation
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_Operation.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.operation_node = [];
if (options.defaults)
object.header = null;
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.operation_node && message.operation_node.length) {
object.operation_node = [];
for (var j = 0; j < message.operation_node.length; ++j)
object.operation_node[j] = $root.CMsgPaintKit_OperationNode.toObject(message.operation_node[j], options);
}
return object;
};
/**
* Converts this CMsgPaintKit_Operation to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Operation
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_Operation.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgPaintKit_Operation;
})();
$root.CMsgPaintKit_ItemDefinition = (function() {
/**
* Properties of a CMsgPaintKit_ItemDefinition.
* @exports ICMsgPaintKit_ItemDefinition
* @interface ICMsgPaintKit_ItemDefinition
* @property {ICMsgProtoDefHeader} header CMsgPaintKit_ItemDefinition header
* @property {number} item_definition_index CMsgPaintKit_ItemDefinition item_definition_index
* @property {ICMsgProtoDefID|null} [variable_template] CMsgPaintKit_ItemDefinition variable_template
* @property {Array.<CMsgPaintKit_ItemDefinition.IDefinition>|null} [definition] CMsgPaintKit_ItemDefinition definition
*/
/**
* Constructs a new CMsgPaintKit_ItemDefinition.
* @exports CMsgPaintKit_ItemDefinition
* @classdesc Represents a CMsgPaintKit_ItemDefinition.
* @implements ICMsgPaintKit_ItemDefinition
* @constructor
* @param {ICMsgPaintKit_ItemDefinition=} [properties] Properties to set
*/
function CMsgPaintKit_ItemDefinition(properties) {
this.definition = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgPaintKit_ItemDefinition header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgPaintKit_ItemDefinition
* @instance
*/
CMsgPaintKit_ItemDefinition.prototype.header = null;
/**
* CMsgPaintKit_ItemDefinition item_definition_index.
* @member {number} item_definition_index
* @memberof CMsgPaintKit_ItemDefinition
* @instance
*/
CMsgPaintKit_ItemDefinition.prototype.item_definition_index = 0;
/**
* CMsgPaintKit_ItemDefinition variable_template.
* @member {ICMsgProtoDefID|null|undefined} variable_template
* @memberof CMsgPaintKit_ItemDefinition
* @instance
*/
CMsgPaintKit_ItemDefinition.prototype.variable_template = null;
/**
* CMsgPaintKit_ItemDefinition definition.
* @member {Array.<CMsgPaintKit_ItemDefinition.IDefinition>} definition
* @memberof CMsgPaintKit_ItemDefinition
* @instance
*/
CMsgPaintKit_ItemDefinition.prototype.definition = $util.emptyArray;
/**
* Creates a new CMsgPaintKit_ItemDefinition instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_ItemDefinition
* @static
* @param {ICMsgPaintKit_ItemDefinition=} [properties] Properties to set
* @returns {CMsgPaintKit_ItemDefinition} CMsgPaintKit_ItemDefinition instance
*/
CMsgPaintKit_ItemDefinition.create = function create(properties) {
return new CMsgPaintKit_ItemDefinition(properties);
};
/**
* Encodes the specified CMsgPaintKit_ItemDefinition message. Does not implicitly {@link CMsgPaintKit_ItemDefinition.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_ItemDefinition
* @static
* @param {ICMsgPaintKit_ItemDefinition} message CMsgPaintKit_ItemDefinition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_ItemDefinition.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.item_definition_index);
if (message.variable_template != null && message.hasOwnProperty("variable_template"))
$root.CMsgProtoDefID.encode(message.variable_template, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.definition != null && message.definition.length)
for (var i = 0; i < message.definition.length; ++i)
$root.CMsgPaintKit_ItemDefinition.Definition.encode(message.definition[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_ItemDefinition message, length delimited. Does not implicitly {@link CMsgPaintKit_ItemDefinition.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_ItemDefinition
* @static
* @param {ICMsgPaintKit_ItemDefinition} message CMsgPaintKit_ItemDefinition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_ItemDefinition.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_ItemDefinition message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_ItemDefinition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_ItemDefinition} CMsgPaintKit_ItemDefinition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_ItemDefinition.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_ItemDefinition();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
message.item_definition_index = reader.uint32();
break;
case 3:
message.variable_template = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 4:
if (!(message.definition && message.definition.length))
message.definition = [];
message.definition.push($root.CMsgPaintKit_ItemDefinition.Definition.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
if (!message.hasOwnProperty("item_definition_index"))
throw $util.ProtocolError("missing required 'item_definition_index'", { instance: message });
return message;
};
/**
* Decodes a CMsgPaintKit_ItemDefinition message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_ItemDefinition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_ItemDefinition} CMsgPaintKit_ItemDefinition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_ItemDefinition.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_ItemDefinition message.
* @function verify
* @memberof CMsgPaintKit_ItemDefinition
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_ItemDefinition.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (!$util.isInteger(message.item_definition_index))
return "item_definition_index: integer expected";
if (message.variable_template != null && message.hasOwnProperty("variable_template")) {
var error = $root.CMsgProtoDefID.verify(message.variable_template);
if (error)
return "variable_template." + error;
}
if (message.definition != null && message.hasOwnProperty("definition")) {
if (!Array.isArray(message.definition))
return "definition: array expected";
for (var i = 0; i < message.definition.length; ++i) {
var error = $root.CMsgPaintKit_ItemDefinition.Definition.verify(message.definition[i]);
if (error)
return "definition." + error;
}
}
return null;
};
/**
* Creates a CMsgPaintKit_ItemDefinition message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_ItemDefinition
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_ItemDefinition} CMsgPaintKit_ItemDefinition
*/
CMsgPaintKit_ItemDefinition.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_ItemDefinition)
return object;
var message = new $root.CMsgPaintKit_ItemDefinition();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgPaintKit_ItemDefinition.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.item_definition_index != null)
message.item_definition_index = object.item_definition_index >>> 0;
if (object.variable_template != null) {
if (typeof object.variable_template !== "object")
throw TypeError(".CMsgPaintKit_ItemDefinition.variable_template: object expected");
message.variable_template = $root.CMsgProtoDefID.fromObject(object.variable_template);
}
if (object.definition) {
if (!Array.isArray(object.definition))
throw TypeError(".CMsgPaintKit_ItemDefinition.definition: array expected");
message.definition = [];
for (var i = 0; i < object.definition.length; ++i) {
if (typeof object.definition[i] !== "object")
throw TypeError(".CMsgPaintKit_ItemDefinition.definition: object expected");
message.definition[i] = $root.CMsgPaintKit_ItemDefinition.Definition.fromObject(object.definition[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_ItemDefinition message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_ItemDefinition
* @static
* @param {CMsgPaintKit_ItemDefinition} message CMsgPaintKit_ItemDefinition
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_ItemDefinition.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.definition = [];
if (options.defaults) {
object.header = null;
object.item_definition_index = 0;
object.variable_template = null;
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.item_definition_index != null && message.hasOwnProperty("item_definition_index"))
object.item_definition_index = message.item_definition_index;
if (message.variable_template != null && message.hasOwnProperty("variable_template"))
object.variable_template = $root.CMsgProtoDefID.toObject(message.variable_template, options);
if (message.definition && message.definition.length) {
object.definition = [];
for (var j = 0; j < message.definition.length; ++j)
object.definition[j] = $root.CMsgPaintKit_ItemDefinition.Definition.toObject(message.definition[j], options);
}
return object;
};
/**
* Converts this CMsgPaintKit_ItemDefinition to JSON.
* @function toJSON
* @memberof CMsgPaintKit_ItemDefinition
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_ItemDefinition.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
CMsgPaintKit_ItemDefinition.Definition = (function() {
/**
* Properties of a Definition.
* @memberof CMsgPaintKit_ItemDefinition
* @interface IDefinition
* @property {ICMsgProtoDefID|null} [operation_template] Definition operation_template
* @property {Array.<ICMsgVarField>|null} [variable] Definition variable
*/
/**
* Constructs a new Definition.
* @memberof CMsgPaintKit_ItemDefinition
* @classdesc Represents a Definition.
* @implements IDefinition
* @constructor
* @param {CMsgPaintKit_ItemDefinition.IDefinition=} [properties] Properties to set
*/
function Definition(properties) {
this.variable = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Definition operation_template.
* @member {ICMsgProtoDefID|null|undefined} operation_template
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @instance
*/
Definition.prototype.operation_template = null;
/**
* Definition variable.
* @member {Array.<ICMsgVarField>} variable
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @instance
*/
Definition.prototype.variable = $util.emptyArray;
/**
* Creates a new Definition instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @static
* @param {CMsgPaintKit_ItemDefinition.IDefinition=} [properties] Properties to set
* @returns {CMsgPaintKit_ItemDefinition.Definition} Definition instance
*/
Definition.create = function create(properties) {
return new Definition(properties);
};
/**
* Encodes the specified Definition message. Does not implicitly {@link CMsgPaintKit_ItemDefinition.Definition.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @static
* @param {CMsgPaintKit_ItemDefinition.IDefinition} message Definition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Definition.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.operation_template != null && message.hasOwnProperty("operation_template"))
$root.CMsgProtoDefID.encode(message.operation_template, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.variable != null && message.variable.length)
for (var i = 0; i < message.variable.length; ++i)
$root.CMsgVarField.encode(message.variable[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified Definition message, length delimited. Does not implicitly {@link CMsgPaintKit_ItemDefinition.Definition.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @static
* @param {CMsgPaintKit_ItemDefinition.IDefinition} message Definition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Definition.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a Definition message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_ItemDefinition.Definition} Definition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Definition.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_ItemDefinition.Definition();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.operation_template = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 2:
if (!(message.variable && message.variable.length))
message.variable = [];
message.variable.push($root.CMsgVarField.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a Definition message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_ItemDefinition.Definition} Definition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Definition.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a Definition message.
* @function verify
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Definition.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.operation_template != null && message.hasOwnProperty("operation_template")) {
var error = $root.CMsgProtoDefID.verify(message.operation_template);
if (error)
return "operation_template." + error;
}
if (message.variable != null && message.hasOwnProperty("variable")) {
if (!Array.isArray(message.variable))
return "variable: array expected";
for (var i = 0; i < message.variable.length; ++i) {
var error = $root.CMsgVarField.verify(message.variable[i]);
if (error)
return "variable." + error;
}
}
return null;
};
/**
* Creates a Definition message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_ItemDefinition.Definition} Definition
*/
Definition.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_ItemDefinition.Definition)
return object;
var message = new $root.CMsgPaintKit_ItemDefinition.Definition();
if (object.operation_template != null) {
if (typeof object.operation_template !== "object")
throw TypeError(".CMsgPaintKit_ItemDefinition.Definition.operation_template: object expected");
message.operation_template = $root.CMsgProtoDefID.fromObject(object.operation_template);
}
if (object.variable) {
if (!Array.isArray(object.variable))
throw TypeError(".CMsgPaintKit_ItemDefinition.Definition.variable: array expected");
message.variable = [];
for (var i = 0; i < object.variable.length; ++i) {
if (typeof object.variable[i] !== "object")
throw TypeError(".CMsgPaintKit_ItemDefinition.Definition.variable: object expected");
message.variable[i] = $root.CMsgVarField.fromObject(object.variable[i]);
}
}
return message;
};
/**
* Creates a plain object from a Definition message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @static
* @param {CMsgPaintKit_ItemDefinition.Definition} message Definition
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Definition.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.variable = [];
if (options.defaults)
object.operation_template = null;
if (message.operation_template != null && message.hasOwnProperty("operation_template"))
object.operation_template = $root.CMsgProtoDefID.toObject(message.operation_template, options);
if (message.variable && message.variable.length) {
object.variable = [];
for (var j = 0; j < message.variable.length; ++j)
object.variable[j] = $root.CMsgVarField.toObject(message.variable[j], options);
}
return object;
};
/**
* Converts this Definition to JSON.
* @function toJSON
* @memberof CMsgPaintKit_ItemDefinition.Definition
* @instance
* @returns {Object.<string,*>} JSON object
*/
Definition.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return Definition;
})();
return CMsgPaintKit_ItemDefinition;
})();
$root.CMsgPaintKit_Definition = (function() {
/**
* Properties of a CMsgPaintKit_Definition.
* @exports ICMsgPaintKit_Definition
* @interface ICMsgPaintKit_Definition
* @property {ICMsgProtoDefHeader} header CMsgPaintKit_Definition header
* @property {string|null} [loc_desctoken] CMsgPaintKit_Definition loc_desctoken
* @property {ICMsgProtoDefID|null} [operation_template] CMsgPaintKit_Definition operation_template
* @property {boolean|null} [has_team_textures] CMsgPaintKit_Definition has_team_textures
* @property {Array.<CMsgPaintKit_Definition.IItem>|null} [item] CMsgPaintKit_Definition item
* @property {CMsgPaintKit_Definition.IItem|null} [paintkit_tool] CMsgPaintKit_Definition paintkit_tool
* @property {CMsgPaintKit_Definition.IItem|null} [flamethrower] CMsgPaintKit_Definition flamethrower
* @property {CMsgPaintKit_Definition.IItem|null} [grenadelauncher] CMsgPaintKit_Definition grenadelauncher
* @property {CMsgPaintKit_Definition.IItem|null} [knife] CMsgPaintKit_Definition knife
* @property {CMsgPaintKit_Definition.IItem|null} [medigun] CMsgPaintKit_Definition medigun
* @property {CMsgPaintKit_Definition.IItem|null} [minigun] CMsgPaintKit_Definition minigun
* @property {CMsgPaintKit_Definition.IItem|null} [pistol] CMsgPaintKit_Definition pistol
* @property {CMsgPaintKit_Definition.IItem|null} [revolver] CMsgPaintKit_Definition revolver
* @property {CMsgPaintKit_Definition.IItem|null} [rocketlauncher] CMsgPaintKit_Definition rocketlauncher
* @property {CMsgPaintKit_Definition.IItem|null} [scattergun] CMsgPaintKit_Definition scattergun
* @property {CMsgPaintKit_Definition.IItem|null} [shotgun] CMsgPaintKit_Definition shotgun
* @property {CMsgPaintKit_Definition.IItem|null} [smg] CMsgPaintKit_Definition smg
* @property {CMsgPaintKit_Definition.IItem|null} [sniperrifle] CMsgPaintKit_Definition sniperrifle
* @property {CMsgPaintKit_Definition.IItem|null} [stickybomb_launcher] CMsgPaintKit_Definition stickybomb_launcher
* @property {CMsgPaintKit_Definition.IItem|null} [ubersaw] CMsgPaintKit_Definition ubersaw
* @property {CMsgPaintKit_Definition.IItem|null} [wrench] CMsgPaintKit_Definition wrench
* @property {CMsgPaintKit_Definition.IItem|null} [amputator] CMsgPaintKit_Definition amputator
* @property {CMsgPaintKit_Definition.IItem|null} [atom_launcher] CMsgPaintKit_Definition atom_launcher
* @property {CMsgPaintKit_Definition.IItem|null} [back_scratcher] CMsgPaintKit_Definition back_scratcher
* @property {CMsgPaintKit_Definition.IItem|null} [battleaxe] CMsgPaintKit_Definition battleaxe
* @property {CMsgPaintKit_Definition.IItem|null} [bazaar_sniper] CMsgPaintKit_Definition bazaar_sniper
* @property {CMsgPaintKit_Definition.IItem|null} [blackbox] CMsgPaintKit_Definition blackbox
* @property {CMsgPaintKit_Definition.IItem|null} [claidheamohmor] CMsgPaintKit_Definition claidheamohmor
* @property {CMsgPaintKit_Definition.IItem|null} [crusaders_crossbow] CMsgPaintKit_Definition crusaders_crossbow
* @property {CMsgPaintKit_Definition.IItem|null} [degreaser] CMsgPaintKit_Definition degreaser
* @property {CMsgPaintKit_Definition.IItem|null} [demo_cannon] CMsgPaintKit_Definition demo_cannon
* @property {CMsgPaintKit_Definition.IItem|null} [demo_sultan_sword] CMsgPaintKit_Definition demo_sultan_sword
* @property {CMsgPaintKit_Definition.IItem|null} [detonator] CMsgPaintKit_Definition detonator
* @property {CMsgPaintKit_Definition.IItem|null} [gatling_gun] CMsgPaintKit_Definition gatling_gun
* @property {CMsgPaintKit_Definition.IItem|null} [holymackerel] CMsgPaintKit_Definition holymackerel
* @property {CMsgPaintKit_Definition.IItem|null} [jag] CMsgPaintKit_Definition jag
* @property {CMsgPaintKit_Definition.IItem|null} [lochnload] CMsgPaintKit_Definition lochnload
* @property {CMsgPaintKit_Definition.IItem|null} [powerjack] CMsgPaintKit_Definition powerjack
* @property {CMsgPaintKit_Definition.IItem|null} [quadball] CMsgPaintKit_Definition quadball
* @property {CMsgPaintKit_Definition.IItem|null} [reserve_shooter] CMsgPaintKit_Definition reserve_shooter
* @property {CMsgPaintKit_Definition.IItem|null} [riding_crop] CMsgPaintKit_Definition riding_crop
* @property {CMsgPaintKit_Definition.IItem|null} [russian_riot] CMsgPaintKit_Definition russian_riot
* @property {CMsgPaintKit_Definition.IItem|null} [scimitar] CMsgPaintKit_Definition scimitar
* @property {CMsgPaintKit_Definition.IItem|null} [scorch_shot] CMsgPaintKit_Definition scorch_shot
* @property {CMsgPaintKit_Definition.IItem|null} [shortstop] CMsgPaintKit_Definition shortstop
* @property {CMsgPaintKit_Definition.IItem|null} [soda_popper] CMsgPaintKit_Definition soda_popper
* @property {CMsgPaintKit_Definition.IItem|null} [tele_shotgun] CMsgPaintKit_Definition tele_shotgun
* @property {CMsgPaintKit_Definition.IItem|null} [tomislav] CMsgPaintKit_Definition tomislav
* @property {CMsgPaintKit_Definition.IItem|null} [trenchgun] CMsgPaintKit_Definition trenchgun
* @property {CMsgPaintKit_Definition.IItem|null} [winger_pistol] CMsgPaintKit_Definition winger_pistol
*/
/**
* Constructs a new CMsgPaintKit_Definition.
* @exports CMsgPaintKit_Definition
* @classdesc Represents a CMsgPaintKit_Definition.
* @implements ICMsgPaintKit_Definition
* @constructor
* @param {ICMsgPaintKit_Definition=} [properties] Properties to set
*/
function CMsgPaintKit_Definition(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]];
}
/**
* CMsgPaintKit_Definition header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.header = null;
/**
* CMsgPaintKit_Definition loc_desctoken.
* @member {string} loc_desctoken
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.loc_desctoken = "";
/**
* CMsgPaintKit_Definition operation_template.
* @member {ICMsgProtoDefID|null|undefined} operation_template
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.operation_template = null;
/**
* CMsgPaintKit_Definition has_team_textures.
* @member {boolean} has_team_textures
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.has_team_textures = false;
/**
* CMsgPaintKit_Definition item.
* @member {Array.<CMsgPaintKit_Definition.IItem>} item
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.item = $util.emptyArray;
/**
* CMsgPaintKit_Definition paintkit_tool.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} paintkit_tool
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.paintkit_tool = null;
/**
* CMsgPaintKit_Definition flamethrower.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} flamethrower
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.flamethrower = null;
/**
* CMsgPaintKit_Definition grenadelauncher.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} grenadelauncher
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.grenadelauncher = null;
/**
* CMsgPaintKit_Definition knife.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} knife
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.knife = null;
/**
* CMsgPaintKit_Definition medigun.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} medigun
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.medigun = null;
/**
* CMsgPaintKit_Definition minigun.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} minigun
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.minigun = null;
/**
* CMsgPaintKit_Definition pistol.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} pistol
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.pistol = null;
/**
* CMsgPaintKit_Definition revolver.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} revolver
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.revolver = null;
/**
* CMsgPaintKit_Definition rocketlauncher.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} rocketlauncher
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.rocketlauncher = null;
/**
* CMsgPaintKit_Definition scattergun.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} scattergun
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.scattergun = null;
/**
* CMsgPaintKit_Definition shotgun.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} shotgun
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.shotgun = null;
/**
* CMsgPaintKit_Definition smg.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} smg
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.smg = null;
/**
* CMsgPaintKit_Definition sniperrifle.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} sniperrifle
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.sniperrifle = null;
/**
* CMsgPaintKit_Definition stickybomb_launcher.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} stickybomb_launcher
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.stickybomb_launcher = null;
/**
* CMsgPaintKit_Definition ubersaw.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} ubersaw
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.ubersaw = null;
/**
* CMsgPaintKit_Definition wrench.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} wrench
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.wrench = null;
/**
* CMsgPaintKit_Definition amputator.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} amputator
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.amputator = null;
/**
* CMsgPaintKit_Definition atom_launcher.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} atom_launcher
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.atom_launcher = null;
/**
* CMsgPaintKit_Definition back_scratcher.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} back_scratcher
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.back_scratcher = null;
/**
* CMsgPaintKit_Definition battleaxe.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} battleaxe
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.battleaxe = null;
/**
* CMsgPaintKit_Definition bazaar_sniper.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} bazaar_sniper
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.bazaar_sniper = null;
/**
* CMsgPaintKit_Definition blackbox.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} blackbox
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.blackbox = null;
/**
* CMsgPaintKit_Definition claidheamohmor.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} claidheamohmor
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.claidheamohmor = null;
/**
* CMsgPaintKit_Definition crusaders_crossbow.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} crusaders_crossbow
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.crusaders_crossbow = null;
/**
* CMsgPaintKit_Definition degreaser.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} degreaser
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.degreaser = null;
/**
* CMsgPaintKit_Definition demo_cannon.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} demo_cannon
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.demo_cannon = null;
/**
* CMsgPaintKit_Definition demo_sultan_sword.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} demo_sultan_sword
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.demo_sultan_sword = null;
/**
* CMsgPaintKit_Definition detonator.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} detonator
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.detonator = null;
/**
* CMsgPaintKit_Definition gatling_gun.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} gatling_gun
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.gatling_gun = null;
/**
* CMsgPaintKit_Definition holymackerel.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} holymackerel
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.holymackerel = null;
/**
* CMsgPaintKit_Definition jag.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} jag
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.jag = null;
/**
* CMsgPaintKit_Definition lochnload.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} lochnload
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.lochnload = null;
/**
* CMsgPaintKit_Definition powerjack.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} powerjack
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.powerjack = null;
/**
* CMsgPaintKit_Definition quadball.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} quadball
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.quadball = null;
/**
* CMsgPaintKit_Definition reserve_shooter.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} reserve_shooter
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.reserve_shooter = null;
/**
* CMsgPaintKit_Definition riding_crop.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} riding_crop
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.riding_crop = null;
/**
* CMsgPaintKit_Definition russian_riot.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} russian_riot
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.russian_riot = null;
/**
* CMsgPaintKit_Definition scimitar.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} scimitar
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.scimitar = null;
/**
* CMsgPaintKit_Definition scorch_shot.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} scorch_shot
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.scorch_shot = null;
/**
* CMsgPaintKit_Definition shortstop.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} shortstop
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.shortstop = null;
/**
* CMsgPaintKit_Definition soda_popper.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} soda_popper
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.soda_popper = null;
/**
* CMsgPaintKit_Definition tele_shotgun.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} tele_shotgun
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.tele_shotgun = null;
/**
* CMsgPaintKit_Definition tomislav.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} tomislav
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.tomislav = null;
/**
* CMsgPaintKit_Definition trenchgun.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} trenchgun
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.trenchgun = null;
/**
* CMsgPaintKit_Definition winger_pistol.
* @member {CMsgPaintKit_Definition.IItem|null|undefined} winger_pistol
* @memberof CMsgPaintKit_Definition
* @instance
*/
CMsgPaintKit_Definition.prototype.winger_pistol = null;
/**
* Creates a new CMsgPaintKit_Definition instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Definition
* @static
* @param {ICMsgPaintKit_Definition=} [properties] Properties to set
* @returns {CMsgPaintKit_Definition} CMsgPaintKit_Definition instance
*/
CMsgPaintKit_Definition.create = function create(properties) {
return new CMsgPaintKit_Definition(properties);
};
/**
* Encodes the specified CMsgPaintKit_Definition message. Does not implicitly {@link CMsgPaintKit_Definition.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Definition
* @static
* @param {ICMsgPaintKit_Definition} message CMsgPaintKit_Definition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Definition.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.loc_desctoken != null && message.hasOwnProperty("loc_desctoken"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.loc_desctoken);
if (message.operation_template != null && message.hasOwnProperty("operation_template"))
$root.CMsgProtoDefID.encode(message.operation_template, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.has_team_textures != null && message.hasOwnProperty("has_team_textures"))
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.has_team_textures);
if (message.item != null && message.item.length)
for (var i = 0; i < message.item.length; ++i)
$root.CMsgPaintKit_Definition.Item.encode(message.item[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.paintkit_tool != null && message.hasOwnProperty("paintkit_tool"))
$root.CMsgPaintKit_Definition.Item.encode(message.paintkit_tool, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.flamethrower != null && message.hasOwnProperty("flamethrower"))
$root.CMsgPaintKit_Definition.Item.encode(message.flamethrower, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.grenadelauncher != null && message.hasOwnProperty("grenadelauncher"))
$root.CMsgPaintKit_Definition.Item.encode(message.grenadelauncher, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
if (message.knife != null && message.hasOwnProperty("knife"))
$root.CMsgPaintKit_Definition.Item.encode(message.knife, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.medigun != null && message.hasOwnProperty("medigun"))
$root.CMsgPaintKit_Definition.Item.encode(message.medigun, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
if (message.minigun != null && message.hasOwnProperty("minigun"))
$root.CMsgPaintKit_Definition.Item.encode(message.minigun, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
if (message.pistol != null && message.hasOwnProperty("pistol"))
$root.CMsgPaintKit_Definition.Item.encode(message.pistol, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
if (message.revolver != null && message.hasOwnProperty("revolver"))
$root.CMsgPaintKit_Definition.Item.encode(message.revolver, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
if (message.rocketlauncher != null && message.hasOwnProperty("rocketlauncher"))
$root.CMsgPaintKit_Definition.Item.encode(message.rocketlauncher, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
if (message.scattergun != null && message.hasOwnProperty("scattergun"))
$root.CMsgPaintKit_Definition.Item.encode(message.scattergun, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
if (message.shotgun != null && message.hasOwnProperty("shotgun"))
$root.CMsgPaintKit_Definition.Item.encode(message.shotgun, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim();
if (message.smg != null && message.hasOwnProperty("smg"))
$root.CMsgPaintKit_Definition.Item.encode(message.smg, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim();
if (message.sniperrifle != null && message.hasOwnProperty("sniperrifle"))
$root.CMsgPaintKit_Definition.Item.encode(message.sniperrifle, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim();
if (message.stickybomb_launcher != null && message.hasOwnProperty("stickybomb_launcher"))
$root.CMsgPaintKit_Definition.Item.encode(message.stickybomb_launcher, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
if (message.ubersaw != null && message.hasOwnProperty("ubersaw"))
$root.CMsgPaintKit_Definition.Item.encode(message.ubersaw, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();
if (message.wrench != null && message.hasOwnProperty("wrench"))
$root.CMsgPaintKit_Definition.Item.encode(message.wrench, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim();
if (message.amputator != null && message.hasOwnProperty("amputator"))
$root.CMsgPaintKit_Definition.Item.encode(message.amputator, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim();
if (message.atom_launcher != null && message.hasOwnProperty("atom_launcher"))
$root.CMsgPaintKit_Definition.Item.encode(message.atom_launcher, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();
if (message.back_scratcher != null && message.hasOwnProperty("back_scratcher"))
$root.CMsgPaintKit_Definition.Item.encode(message.back_scratcher, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim();
if (message.battleaxe != null && message.hasOwnProperty("battleaxe"))
$root.CMsgPaintKit_Definition.Item.encode(message.battleaxe, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim();
if (message.bazaar_sniper != null && message.hasOwnProperty("bazaar_sniper"))
$root.CMsgPaintKit_Definition.Item.encode(message.bazaar_sniper, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim();
if (message.blackbox != null && message.hasOwnProperty("blackbox"))
$root.CMsgPaintKit_Definition.Item.encode(message.blackbox, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim();
if (message.claidheamohmor != null && message.hasOwnProperty("claidheamohmor"))
$root.CMsgPaintKit_Definition.Item.encode(message.claidheamohmor, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim();
if (message.crusaders_crossbow != null && message.hasOwnProperty("crusaders_crossbow"))
$root.CMsgPaintKit_Definition.Item.encode(message.crusaders_crossbow, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim();
if (message.degreaser != null && message.hasOwnProperty("degreaser"))
$root.CMsgPaintKit_Definition.Item.encode(message.degreaser, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim();
if (message.demo_cannon != null && message.hasOwnProperty("demo_cannon"))
$root.CMsgPaintKit_Definition.Item.encode(message.demo_cannon, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim();
if (message.demo_sultan_sword != null && message.hasOwnProperty("demo_sultan_sword"))
$root.CMsgPaintKit_Definition.Item.encode(message.demo_sultan_sword, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim();
if (message.detonator != null && message.hasOwnProperty("detonator"))
$root.CMsgPaintKit_Definition.Item.encode(message.detonator, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim();
if (message.gatling_gun != null && message.hasOwnProperty("gatling_gun"))
$root.CMsgPaintKit_Definition.Item.encode(message.gatling_gun, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim();
if (message.holymackerel != null && message.hasOwnProperty("holymackerel"))
$root.CMsgPaintKit_Definition.Item.encode(message.holymackerel, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim();
if (message.jag != null && message.hasOwnProperty("jag"))
$root.CMsgPaintKit_Definition.Item.encode(message.jag, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim();
if (message.lochnload != null && message.hasOwnProperty("lochnload"))
$root.CMsgPaintKit_Definition.Item.encode(message.lochnload, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim();
if (message.powerjack != null && message.hasOwnProperty("powerjack"))
$root.CMsgPaintKit_Definition.Item.encode(message.powerjack, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim();
if (message.quadball != null && message.hasOwnProperty("quadball"))
$root.CMsgPaintKit_Definition.Item.encode(message.quadball, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim();
if (message.reserve_shooter != null && message.hasOwnProperty("reserve_shooter"))
$root.CMsgPaintKit_Definition.Item.encode(message.reserve_shooter, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim();
if (message.riding_crop != null && message.hasOwnProperty("riding_crop"))
$root.CMsgPaintKit_Definition.Item.encode(message.riding_crop, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim();
if (message.russian_riot != null && message.hasOwnProperty("russian_riot"))
$root.CMsgPaintKit_Definition.Item.encode(message.russian_riot, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim();
if (message.scimitar != null && message.hasOwnProperty("scimitar"))
$root.CMsgPaintKit_Definition.Item.encode(message.scimitar, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim();
if (message.scorch_shot != null && message.hasOwnProperty("scorch_shot"))
$root.CMsgPaintKit_Definition.Item.encode(message.scorch_shot, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim();
if (message.shortstop != null && message.hasOwnProperty("shortstop"))
$root.CMsgPaintKit_Definition.Item.encode(message.shortstop, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim();
if (message.soda_popper != null && message.hasOwnProperty("soda_popper"))
$root.CMsgPaintKit_Definition.Item.encode(message.soda_popper, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim();
if (message.tele_shotgun != null && message.hasOwnProperty("tele_shotgun"))
$root.CMsgPaintKit_Definition.Item.encode(message.tele_shotgun, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim();
if (message.tomislav != null && message.hasOwnProperty("tomislav"))
$root.CMsgPaintKit_Definition.Item.encode(message.tomislav, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim();
if (message.trenchgun != null && message.hasOwnProperty("trenchgun"))
$root.CMsgPaintKit_Definition.Item.encode(message.trenchgun, writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim();
if (message.winger_pistol != null && message.hasOwnProperty("winger_pistol"))
$root.CMsgPaintKit_Definition.Item.encode(message.winger_pistol, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgPaintKit_Definition message, length delimited. Does not implicitly {@link CMsgPaintKit_Definition.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Definition
* @static
* @param {ICMsgPaintKit_Definition} message CMsgPaintKit_Definition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgPaintKit_Definition.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgPaintKit_Definition message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Definition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Definition} CMsgPaintKit_Definition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Definition.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Definition();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
message.loc_desctoken = reader.string();
break;
case 3:
message.operation_template = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 4:
message.has_team_textures = reader.bool();
break;
case 5:
if (!(message.item && message.item.length))
message.item = [];
message.item.push($root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32()));
break;
case 6:
message.paintkit_tool = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 7:
message.flamethrower = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 8:
message.grenadelauncher = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 9:
message.knife = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 10:
message.medigun = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 11:
message.minigun = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 12:
message.pistol = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 13:
message.revolver = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 14:
message.rocketlauncher = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 15:
message.scattergun = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 16:
message.shotgun = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 17:
message.smg = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 18:
message.sniperrifle = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 19:
message.stickybomb_launcher = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 20:
message.ubersaw = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 21:
message.wrench = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 22:
message.amputator = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 23:
message.atom_launcher = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 24:
message.back_scratcher = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 25:
message.battleaxe = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 26:
message.bazaar_sniper = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 27:
message.blackbox = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 28:
message.claidheamohmor = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 29:
message.crusaders_crossbow = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 30:
message.degreaser = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 31:
message.demo_cannon = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 32:
message.demo_sultan_sword = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 33:
message.detonator = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 34:
message.gatling_gun = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 35:
message.holymackerel = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 36:
message.jag = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 37:
message.lochnload = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 38:
message.powerjack = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 39:
message.quadball = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 40:
message.reserve_shooter = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 41:
message.riding_crop = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 42:
message.russian_riot = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 43:
message.scimitar = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 44:
message.scorch_shot = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 45:
message.shortstop = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 46:
message.soda_popper = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 47:
message.tele_shotgun = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 48:
message.tomislav = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 49:
message.trenchgun = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
case 50:
message.winger_pistol = $root.CMsgPaintKit_Definition.Item.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgPaintKit_Definition message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Definition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Definition} CMsgPaintKit_Definition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgPaintKit_Definition.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgPaintKit_Definition message.
* @function verify
* @memberof CMsgPaintKit_Definition
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgPaintKit_Definition.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.loc_desctoken != null && message.hasOwnProperty("loc_desctoken"))
if (!$util.isString(message.loc_desctoken))
return "loc_desctoken: string expected";
if (message.operation_template != null && message.hasOwnProperty("operation_template")) {
var error = $root.CMsgProtoDefID.verify(message.operation_template);
if (error)
return "operation_template." + error;
}
if (message.has_team_textures != null && message.hasOwnProperty("has_team_textures"))
if (typeof message.has_team_textures !== "boolean")
return "has_team_textures: boolean expected";
if (message.item != null && message.hasOwnProperty("item")) {
if (!Array.isArray(message.item))
return "item: array expected";
for (var i = 0; i < message.item.length; ++i) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.item[i]);
if (error)
return "item." + error;
}
}
if (message.paintkit_tool != null && message.hasOwnProperty("paintkit_tool")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.paintkit_tool);
if (error)
return "paintkit_tool." + error;
}
if (message.flamethrower != null && message.hasOwnProperty("flamethrower")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.flamethrower);
if (error)
return "flamethrower." + error;
}
if (message.grenadelauncher != null && message.hasOwnProperty("grenadelauncher")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.grenadelauncher);
if (error)
return "grenadelauncher." + error;
}
if (message.knife != null && message.hasOwnProperty("knife")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.knife);
if (error)
return "knife." + error;
}
if (message.medigun != null && message.hasOwnProperty("medigun")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.medigun);
if (error)
return "medigun." + error;
}
if (message.minigun != null && message.hasOwnProperty("minigun")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.minigun);
if (error)
return "minigun." + error;
}
if (message.pistol != null && message.hasOwnProperty("pistol")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.pistol);
if (error)
return "pistol." + error;
}
if (message.revolver != null && message.hasOwnProperty("revolver")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.revolver);
if (error)
return "revolver." + error;
}
if (message.rocketlauncher != null && message.hasOwnProperty("rocketlauncher")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.rocketlauncher);
if (error)
return "rocketlauncher." + error;
}
if (message.scattergun != null && message.hasOwnProperty("scattergun")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.scattergun);
if (error)
return "scattergun." + error;
}
if (message.shotgun != null && message.hasOwnProperty("shotgun")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.shotgun);
if (error)
return "shotgun." + error;
}
if (message.smg != null && message.hasOwnProperty("smg")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.smg);
if (error)
return "smg." + error;
}
if (message.sniperrifle != null && message.hasOwnProperty("sniperrifle")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.sniperrifle);
if (error)
return "sniperrifle." + error;
}
if (message.stickybomb_launcher != null && message.hasOwnProperty("stickybomb_launcher")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.stickybomb_launcher);
if (error)
return "stickybomb_launcher." + error;
}
if (message.ubersaw != null && message.hasOwnProperty("ubersaw")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.ubersaw);
if (error)
return "ubersaw." + error;
}
if (message.wrench != null && message.hasOwnProperty("wrench")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.wrench);
if (error)
return "wrench." + error;
}
if (message.amputator != null && message.hasOwnProperty("amputator")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.amputator);
if (error)
return "amputator." + error;
}
if (message.atom_launcher != null && message.hasOwnProperty("atom_launcher")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.atom_launcher);
if (error)
return "atom_launcher." + error;
}
if (message.back_scratcher != null && message.hasOwnProperty("back_scratcher")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.back_scratcher);
if (error)
return "back_scratcher." + error;
}
if (message.battleaxe != null && message.hasOwnProperty("battleaxe")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.battleaxe);
if (error)
return "battleaxe." + error;
}
if (message.bazaar_sniper != null && message.hasOwnProperty("bazaar_sniper")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.bazaar_sniper);
if (error)
return "bazaar_sniper." + error;
}
if (message.blackbox != null && message.hasOwnProperty("blackbox")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.blackbox);
if (error)
return "blackbox." + error;
}
if (message.claidheamohmor != null && message.hasOwnProperty("claidheamohmor")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.claidheamohmor);
if (error)
return "claidheamohmor." + error;
}
if (message.crusaders_crossbow != null && message.hasOwnProperty("crusaders_crossbow")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.crusaders_crossbow);
if (error)
return "crusaders_crossbow." + error;
}
if (message.degreaser != null && message.hasOwnProperty("degreaser")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.degreaser);
if (error)
return "degreaser." + error;
}
if (message.demo_cannon != null && message.hasOwnProperty("demo_cannon")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.demo_cannon);
if (error)
return "demo_cannon." + error;
}
if (message.demo_sultan_sword != null && message.hasOwnProperty("demo_sultan_sword")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.demo_sultan_sword);
if (error)
return "demo_sultan_sword." + error;
}
if (message.detonator != null && message.hasOwnProperty("detonator")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.detonator);
if (error)
return "detonator." + error;
}
if (message.gatling_gun != null && message.hasOwnProperty("gatling_gun")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.gatling_gun);
if (error)
return "gatling_gun." + error;
}
if (message.holymackerel != null && message.hasOwnProperty("holymackerel")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.holymackerel);
if (error)
return "holymackerel." + error;
}
if (message.jag != null && message.hasOwnProperty("jag")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.jag);
if (error)
return "jag." + error;
}
if (message.lochnload != null && message.hasOwnProperty("lochnload")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.lochnload);
if (error)
return "lochnload." + error;
}
if (message.powerjack != null && message.hasOwnProperty("powerjack")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.powerjack);
if (error)
return "powerjack." + error;
}
if (message.quadball != null && message.hasOwnProperty("quadball")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.quadball);
if (error)
return "quadball." + error;
}
if (message.reserve_shooter != null && message.hasOwnProperty("reserve_shooter")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.reserve_shooter);
if (error)
return "reserve_shooter." + error;
}
if (message.riding_crop != null && message.hasOwnProperty("riding_crop")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.riding_crop);
if (error)
return "riding_crop." + error;
}
if (message.russian_riot != null && message.hasOwnProperty("russian_riot")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.russian_riot);
if (error)
return "russian_riot." + error;
}
if (message.scimitar != null && message.hasOwnProperty("scimitar")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.scimitar);
if (error)
return "scimitar." + error;
}
if (message.scorch_shot != null && message.hasOwnProperty("scorch_shot")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.scorch_shot);
if (error)
return "scorch_shot." + error;
}
if (message.shortstop != null && message.hasOwnProperty("shortstop")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.shortstop);
if (error)
return "shortstop." + error;
}
if (message.soda_popper != null && message.hasOwnProperty("soda_popper")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.soda_popper);
if (error)
return "soda_popper." + error;
}
if (message.tele_shotgun != null && message.hasOwnProperty("tele_shotgun")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.tele_shotgun);
if (error)
return "tele_shotgun." + error;
}
if (message.tomislav != null && message.hasOwnProperty("tomislav")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.tomislav);
if (error)
return "tomislav." + error;
}
if (message.trenchgun != null && message.hasOwnProperty("trenchgun")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.trenchgun);
if (error)
return "trenchgun." + error;
}
if (message.winger_pistol != null && message.hasOwnProperty("winger_pistol")) {
var error = $root.CMsgPaintKit_Definition.Item.verify(message.winger_pistol);
if (error)
return "winger_pistol." + error;
}
return null;
};
/**
* Creates a CMsgPaintKit_Definition message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Definition
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Definition} CMsgPaintKit_Definition
*/
CMsgPaintKit_Definition.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Definition)
return object;
var message = new $root.CMsgPaintKit_Definition();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgPaintKit_Definition.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.loc_desctoken != null)
message.loc_desctoken = String(object.loc_desctoken);
if (object.operation_template != null) {
if (typeof object.operation_template !== "object")
throw TypeError(".CMsgPaintKit_Definition.operation_template: object expected");
message.operation_template = $root.CMsgProtoDefID.fromObject(object.operation_template);
}
if (object.has_team_textures != null)
message.has_team_textures = Boolean(object.has_team_textures);
if (object.item) {
if (!Array.isArray(object.item))
throw TypeError(".CMsgPaintKit_Definition.item: array expected");
message.item = [];
for (var i = 0; i < object.item.length; ++i) {
if (typeof object.item[i] !== "object")
throw TypeError(".CMsgPaintKit_Definition.item: object expected");
message.item[i] = $root.CMsgPaintKit_Definition.Item.fromObject(object.item[i]);
}
}
if (object.paintkit_tool != null) {
if (typeof object.paintkit_tool !== "object")
throw TypeError(".CMsgPaintKit_Definition.paintkit_tool: object expected");
message.paintkit_tool = $root.CMsgPaintKit_Definition.Item.fromObject(object.paintkit_tool);
}
if (object.flamethrower != null) {
if (typeof object.flamethrower !== "object")
throw TypeError(".CMsgPaintKit_Definition.flamethrower: object expected");
message.flamethrower = $root.CMsgPaintKit_Definition.Item.fromObject(object.flamethrower);
}
if (object.grenadelauncher != null) {
if (typeof object.grenadelauncher !== "object")
throw TypeError(".CMsgPaintKit_Definition.grenadelauncher: object expected");
message.grenadelauncher = $root.CMsgPaintKit_Definition.Item.fromObject(object.grenadelauncher);
}
if (object.knife != null) {
if (typeof object.knife !== "object")
throw TypeError(".CMsgPaintKit_Definition.knife: object expected");
message.knife = $root.CMsgPaintKit_Definition.Item.fromObject(object.knife);
}
if (object.medigun != null) {
if (typeof object.medigun !== "object")
throw TypeError(".CMsgPaintKit_Definition.medigun: object expected");
message.medigun = $root.CMsgPaintKit_Definition.Item.fromObject(object.medigun);
}
if (object.minigun != null) {
if (typeof object.minigun !== "object")
throw TypeError(".CMsgPaintKit_Definition.minigun: object expected");
message.minigun = $root.CMsgPaintKit_Definition.Item.fromObject(object.minigun);
}
if (object.pistol != null) {
if (typeof object.pistol !== "object")
throw TypeError(".CMsgPaintKit_Definition.pistol: object expected");
message.pistol = $root.CMsgPaintKit_Definition.Item.fromObject(object.pistol);
}
if (object.revolver != null) {
if (typeof object.revolver !== "object")
throw TypeError(".CMsgPaintKit_Definition.revolver: object expected");
message.revolver = $root.CMsgPaintKit_Definition.Item.fromObject(object.revolver);
}
if (object.rocketlauncher != null) {
if (typeof object.rocketlauncher !== "object")
throw TypeError(".CMsgPaintKit_Definition.rocketlauncher: object expected");
message.rocketlauncher = $root.CMsgPaintKit_Definition.Item.fromObject(object.rocketlauncher);
}
if (object.scattergun != null) {
if (typeof object.scattergun !== "object")
throw TypeError(".CMsgPaintKit_Definition.scattergun: object expected");
message.scattergun = $root.CMsgPaintKit_Definition.Item.fromObject(object.scattergun);
}
if (object.shotgun != null) {
if (typeof object.shotgun !== "object")
throw TypeError(".CMsgPaintKit_Definition.shotgun: object expected");
message.shotgun = $root.CMsgPaintKit_Definition.Item.fromObject(object.shotgun);
}
if (object.smg != null) {
if (typeof object.smg !== "object")
throw TypeError(".CMsgPaintKit_Definition.smg: object expected");
message.smg = $root.CMsgPaintKit_Definition.Item.fromObject(object.smg);
}
if (object.sniperrifle != null) {
if (typeof object.sniperrifle !== "object")
throw TypeError(".CMsgPaintKit_Definition.sniperrifle: object expected");
message.sniperrifle = $root.CMsgPaintKit_Definition.Item.fromObject(object.sniperrifle);
}
if (object.stickybomb_launcher != null) {
if (typeof object.stickybomb_launcher !== "object")
throw TypeError(".CMsgPaintKit_Definition.stickybomb_launcher: object expected");
message.stickybomb_launcher = $root.CMsgPaintKit_Definition.Item.fromObject(object.stickybomb_launcher);
}
if (object.ubersaw != null) {
if (typeof object.ubersaw !== "object")
throw TypeError(".CMsgPaintKit_Definition.ubersaw: object expected");
message.ubersaw = $root.CMsgPaintKit_Definition.Item.fromObject(object.ubersaw);
}
if (object.wrench != null) {
if (typeof object.wrench !== "object")
throw TypeError(".CMsgPaintKit_Definition.wrench: object expected");
message.wrench = $root.CMsgPaintKit_Definition.Item.fromObject(object.wrench);
}
if (object.amputator != null) {
if (typeof object.amputator !== "object")
throw TypeError(".CMsgPaintKit_Definition.amputator: object expected");
message.amputator = $root.CMsgPaintKit_Definition.Item.fromObject(object.amputator);
}
if (object.atom_launcher != null) {
if (typeof object.atom_launcher !== "object")
throw TypeError(".CMsgPaintKit_Definition.atom_launcher: object expected");
message.atom_launcher = $root.CMsgPaintKit_Definition.Item.fromObject(object.atom_launcher);
}
if (object.back_scratcher != null) {
if (typeof object.back_scratcher !== "object")
throw TypeError(".CMsgPaintKit_Definition.back_scratcher: object expected");
message.back_scratcher = $root.CMsgPaintKit_Definition.Item.fromObject(object.back_scratcher);
}
if (object.battleaxe != null) {
if (typeof object.battleaxe !== "object")
throw TypeError(".CMsgPaintKit_Definition.battleaxe: object expected");
message.battleaxe = $root.CMsgPaintKit_Definition.Item.fromObject(object.battleaxe);
}
if (object.bazaar_sniper != null) {
if (typeof object.bazaar_sniper !== "object")
throw TypeError(".CMsgPaintKit_Definition.bazaar_sniper: object expected");
message.bazaar_sniper = $root.CMsgPaintKit_Definition.Item.fromObject(object.bazaar_sniper);
}
if (object.blackbox != null) {
if (typeof object.blackbox !== "object")
throw TypeError(".CMsgPaintKit_Definition.blackbox: object expected");
message.blackbox = $root.CMsgPaintKit_Definition.Item.fromObject(object.blackbox);
}
if (object.claidheamohmor != null) {
if (typeof object.claidheamohmor !== "object")
throw TypeError(".CMsgPaintKit_Definition.claidheamohmor: object expected");
message.claidheamohmor = $root.CMsgPaintKit_Definition.Item.fromObject(object.claidheamohmor);
}
if (object.crusaders_crossbow != null) {
if (typeof object.crusaders_crossbow !== "object")
throw TypeError(".CMsgPaintKit_Definition.crusaders_crossbow: object expected");
message.crusaders_crossbow = $root.CMsgPaintKit_Definition.Item.fromObject(object.crusaders_crossbow);
}
if (object.degreaser != null) {
if (typeof object.degreaser !== "object")
throw TypeError(".CMsgPaintKit_Definition.degreaser: object expected");
message.degreaser = $root.CMsgPaintKit_Definition.Item.fromObject(object.degreaser);
}
if (object.demo_cannon != null) {
if (typeof object.demo_cannon !== "object")
throw TypeError(".CMsgPaintKit_Definition.demo_cannon: object expected");
message.demo_cannon = $root.CMsgPaintKit_Definition.Item.fromObject(object.demo_cannon);
}
if (object.demo_sultan_sword != null) {
if (typeof object.demo_sultan_sword !== "object")
throw TypeError(".CMsgPaintKit_Definition.demo_sultan_sword: object expected");
message.demo_sultan_sword = $root.CMsgPaintKit_Definition.Item.fromObject(object.demo_sultan_sword);
}
if (object.detonator != null) {
if (typeof object.detonator !== "object")
throw TypeError(".CMsgPaintKit_Definition.detonator: object expected");
message.detonator = $root.CMsgPaintKit_Definition.Item.fromObject(object.detonator);
}
if (object.gatling_gun != null) {
if (typeof object.gatling_gun !== "object")
throw TypeError(".CMsgPaintKit_Definition.gatling_gun: object expected");
message.gatling_gun = $root.CMsgPaintKit_Definition.Item.fromObject(object.gatling_gun);
}
if (object.holymackerel != null) {
if (typeof object.holymackerel !== "object")
throw TypeError(".CMsgPaintKit_Definition.holymackerel: object expected");
message.holymackerel = $root.CMsgPaintKit_Definition.Item.fromObject(object.holymackerel);
}
if (object.jag != null) {
if (typeof object.jag !== "object")
throw TypeError(".CMsgPaintKit_Definition.jag: object expected");
message.jag = $root.CMsgPaintKit_Definition.Item.fromObject(object.jag);
}
if (object.lochnload != null) {
if (typeof object.lochnload !== "object")
throw TypeError(".CMsgPaintKit_Definition.lochnload: object expected");
message.lochnload = $root.CMsgPaintKit_Definition.Item.fromObject(object.lochnload);
}
if (object.powerjack != null) {
if (typeof object.powerjack !== "object")
throw TypeError(".CMsgPaintKit_Definition.powerjack: object expected");
message.powerjack = $root.CMsgPaintKit_Definition.Item.fromObject(object.powerjack);
}
if (object.quadball != null) {
if (typeof object.quadball !== "object")
throw TypeError(".CMsgPaintKit_Definition.quadball: object expected");
message.quadball = $root.CMsgPaintKit_Definition.Item.fromObject(object.quadball);
}
if (object.reserve_shooter != null) {
if (typeof object.reserve_shooter !== "object")
throw TypeError(".CMsgPaintKit_Definition.reserve_shooter: object expected");
message.reserve_shooter = $root.CMsgPaintKit_Definition.Item.fromObject(object.reserve_shooter);
}
if (object.riding_crop != null) {
if (typeof object.riding_crop !== "object")
throw TypeError(".CMsgPaintKit_Definition.riding_crop: object expected");
message.riding_crop = $root.CMsgPaintKit_Definition.Item.fromObject(object.riding_crop);
}
if (object.russian_riot != null) {
if (typeof object.russian_riot !== "object")
throw TypeError(".CMsgPaintKit_Definition.russian_riot: object expected");
message.russian_riot = $root.CMsgPaintKit_Definition.Item.fromObject(object.russian_riot);
}
if (object.scimitar != null) {
if (typeof object.scimitar !== "object")
throw TypeError(".CMsgPaintKit_Definition.scimitar: object expected");
message.scimitar = $root.CMsgPaintKit_Definition.Item.fromObject(object.scimitar);
}
if (object.scorch_shot != null) {
if (typeof object.scorch_shot !== "object")
throw TypeError(".CMsgPaintKit_Definition.scorch_shot: object expected");
message.scorch_shot = $root.CMsgPaintKit_Definition.Item.fromObject(object.scorch_shot);
}
if (object.shortstop != null) {
if (typeof object.shortstop !== "object")
throw TypeError(".CMsgPaintKit_Definition.shortstop: object expected");
message.shortstop = $root.CMsgPaintKit_Definition.Item.fromObject(object.shortstop);
}
if (object.soda_popper != null) {
if (typeof object.soda_popper !== "object")
throw TypeError(".CMsgPaintKit_Definition.soda_popper: object expected");
message.soda_popper = $root.CMsgPaintKit_Definition.Item.fromObject(object.soda_popper);
}
if (object.tele_shotgun != null) {
if (typeof object.tele_shotgun !== "object")
throw TypeError(".CMsgPaintKit_Definition.tele_shotgun: object expected");
message.tele_shotgun = $root.CMsgPaintKit_Definition.Item.fromObject(object.tele_shotgun);
}
if (object.tomislav != null) {
if (typeof object.tomislav !== "object")
throw TypeError(".CMsgPaintKit_Definition.tomislav: object expected");
message.tomislav = $root.CMsgPaintKit_Definition.Item.fromObject(object.tomislav);
}
if (object.trenchgun != null) {
if (typeof object.trenchgun !== "object")
throw TypeError(".CMsgPaintKit_Definition.trenchgun: object expected");
message.trenchgun = $root.CMsgPaintKit_Definition.Item.fromObject(object.trenchgun);
}
if (object.winger_pistol != null) {
if (typeof object.winger_pistol !== "object")
throw TypeError(".CMsgPaintKit_Definition.winger_pistol: object expected");
message.winger_pistol = $root.CMsgPaintKit_Definition.Item.fromObject(object.winger_pistol);
}
return message;
};
/**
* Creates a plain object from a CMsgPaintKit_Definition message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Definition
* @static
* @param {CMsgPaintKit_Definition} message CMsgPaintKit_Definition
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgPaintKit_Definition.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.item = [];
if (options.defaults) {
object.header = null;
object.loc_desctoken = "";
object.operation_template = null;
object.has_team_textures = false;
object.paintkit_tool = null;
object.flamethrower = null;
object.grenadelauncher = null;
object.knife = null;
object.medigun = null;
object.minigun = null;
object.pistol = null;
object.revolver = null;
object.rocketlauncher = null;
object.scattergun = null;
object.shotgun = null;
object.smg = null;
object.sniperrifle = null;
object.stickybomb_launcher = null;
object.ubersaw = null;
object.wrench = null;
object.amputator = null;
object.atom_launcher = null;
object.back_scratcher = null;
object.battleaxe = null;
object.bazaar_sniper = null;
object.blackbox = null;
object.claidheamohmor = null;
object.crusaders_crossbow = null;
object.degreaser = null;
object.demo_cannon = null;
object.demo_sultan_sword = null;
object.detonator = null;
object.gatling_gun = null;
object.holymackerel = null;
object.jag = null;
object.lochnload = null;
object.powerjack = null;
object.quadball = null;
object.reserve_shooter = null;
object.riding_crop = null;
object.russian_riot = null;
object.scimitar = null;
object.scorch_shot = null;
object.shortstop = null;
object.soda_popper = null;
object.tele_shotgun = null;
object.tomislav = null;
object.trenchgun = null;
object.winger_pistol = null;
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.loc_desctoken != null && message.hasOwnProperty("loc_desctoken"))
object.loc_desctoken = message.loc_desctoken;
if (message.operation_template != null && message.hasOwnProperty("operation_template"))
object.operation_template = $root.CMsgProtoDefID.toObject(message.operation_template, options);
if (message.has_team_textures != null && message.hasOwnProperty("has_team_textures"))
object.has_team_textures = message.has_team_textures;
if (message.item && message.item.length) {
object.item = [];
for (var j = 0; j < message.item.length; ++j)
object.item[j] = $root.CMsgPaintKit_Definition.Item.toObject(message.item[j], options);
}
if (message.paintkit_tool != null && message.hasOwnProperty("paintkit_tool"))
object.paintkit_tool = $root.CMsgPaintKit_Definition.Item.toObject(message.paintkit_tool, options);
if (message.flamethrower != null && message.hasOwnProperty("flamethrower"))
object.flamethrower = $root.CMsgPaintKit_Definition.Item.toObject(message.flamethrower, options);
if (message.grenadelauncher != null && message.hasOwnProperty("grenadelauncher"))
object.grenadelauncher = $root.CMsgPaintKit_Definition.Item.toObject(message.grenadelauncher, options);
if (message.knife != null && message.hasOwnProperty("knife"))
object.knife = $root.CMsgPaintKit_Definition.Item.toObject(message.knife, options);
if (message.medigun != null && message.hasOwnProperty("medigun"))
object.medigun = $root.CMsgPaintKit_Definition.Item.toObject(message.medigun, options);
if (message.minigun != null && message.hasOwnProperty("minigun"))
object.minigun = $root.CMsgPaintKit_Definition.Item.toObject(message.minigun, options);
if (message.pistol != null && message.hasOwnProperty("pistol"))
object.pistol = $root.CMsgPaintKit_Definition.Item.toObject(message.pistol, options);
if (message.revolver != null && message.hasOwnProperty("revolver"))
object.revolver = $root.CMsgPaintKit_Definition.Item.toObject(message.revolver, options);
if (message.rocketlauncher != null && message.hasOwnProperty("rocketlauncher"))
object.rocketlauncher = $root.CMsgPaintKit_Definition.Item.toObject(message.rocketlauncher, options);
if (message.scattergun != null && message.hasOwnProperty("scattergun"))
object.scattergun = $root.CMsgPaintKit_Definition.Item.toObject(message.scattergun, options);
if (message.shotgun != null && message.hasOwnProperty("shotgun"))
object.shotgun = $root.CMsgPaintKit_Definition.Item.toObject(message.shotgun, options);
if (message.smg != null && message.hasOwnProperty("smg"))
object.smg = $root.CMsgPaintKit_Definition.Item.toObject(message.smg, options);
if (message.sniperrifle != null && message.hasOwnProperty("sniperrifle"))
object.sniperrifle = $root.CMsgPaintKit_Definition.Item.toObject(message.sniperrifle, options);
if (message.stickybomb_launcher != null && message.hasOwnProperty("stickybomb_launcher"))
object.stickybomb_launcher = $root.CMsgPaintKit_Definition.Item.toObject(message.stickybomb_launcher, options);
if (message.ubersaw != null && message.hasOwnProperty("ubersaw"))
object.ubersaw = $root.CMsgPaintKit_Definition.Item.toObject(message.ubersaw, options);
if (message.wrench != null && message.hasOwnProperty("wrench"))
object.wrench = $root.CMsgPaintKit_Definition.Item.toObject(message.wrench, options);
if (message.amputator != null && message.hasOwnProperty("amputator"))
object.amputator = $root.CMsgPaintKit_Definition.Item.toObject(message.amputator, options);
if (message.atom_launcher != null && message.hasOwnProperty("atom_launcher"))
object.atom_launcher = $root.CMsgPaintKit_Definition.Item.toObject(message.atom_launcher, options);
if (message.back_scratcher != null && message.hasOwnProperty("back_scratcher"))
object.back_scratcher = $root.CMsgPaintKit_Definition.Item.toObject(message.back_scratcher, options);
if (message.battleaxe != null && message.hasOwnProperty("battleaxe"))
object.battleaxe = $root.CMsgPaintKit_Definition.Item.toObject(message.battleaxe, options);
if (message.bazaar_sniper != null && message.hasOwnProperty("bazaar_sniper"))
object.bazaar_sniper = $root.CMsgPaintKit_Definition.Item.toObject(message.bazaar_sniper, options);
if (message.blackbox != null && message.hasOwnProperty("blackbox"))
object.blackbox = $root.CMsgPaintKit_Definition.Item.toObject(message.blackbox, options);
if (message.claidheamohmor != null && message.hasOwnProperty("claidheamohmor"))
object.claidheamohmor = $root.CMsgPaintKit_Definition.Item.toObject(message.claidheamohmor, options);
if (message.crusaders_crossbow != null && message.hasOwnProperty("crusaders_crossbow"))
object.crusaders_crossbow = $root.CMsgPaintKit_Definition.Item.toObject(message.crusaders_crossbow, options);
if (message.degreaser != null && message.hasOwnProperty("degreaser"))
object.degreaser = $root.CMsgPaintKit_Definition.Item.toObject(message.degreaser, options);
if (message.demo_cannon != null && message.hasOwnProperty("demo_cannon"))
object.demo_cannon = $root.CMsgPaintKit_Definition.Item.toObject(message.demo_cannon, options);
if (message.demo_sultan_sword != null && message.hasOwnProperty("demo_sultan_sword"))
object.demo_sultan_sword = $root.CMsgPaintKit_Definition.Item.toObject(message.demo_sultan_sword, options);
if (message.detonator != null && message.hasOwnProperty("detonator"))
object.detonator = $root.CMsgPaintKit_Definition.Item.toObject(message.detonator, options);
if (message.gatling_gun != null && message.hasOwnProperty("gatling_gun"))
object.gatling_gun = $root.CMsgPaintKit_Definition.Item.toObject(message.gatling_gun, options);
if (message.holymackerel != null && message.hasOwnProperty("holymackerel"))
object.holymackerel = $root.CMsgPaintKit_Definition.Item.toObject(message.holymackerel, options);
if (message.jag != null && message.hasOwnProperty("jag"))
object.jag = $root.CMsgPaintKit_Definition.Item.toObject(message.jag, options);
if (message.lochnload != null && message.hasOwnProperty("lochnload"))
object.lochnload = $root.CMsgPaintKit_Definition.Item.toObject(message.lochnload, options);
if (message.powerjack != null && message.hasOwnProperty("powerjack"))
object.powerjack = $root.CMsgPaintKit_Definition.Item.toObject(message.powerjack, options);
if (message.quadball != null && message.hasOwnProperty("quadball"))
object.quadball = $root.CMsgPaintKit_Definition.Item.toObject(message.quadball, options);
if (message.reserve_shooter != null && message.hasOwnProperty("reserve_shooter"))
object.reserve_shooter = $root.CMsgPaintKit_Definition.Item.toObject(message.reserve_shooter, options);
if (message.riding_crop != null && message.hasOwnProperty("riding_crop"))
object.riding_crop = $root.CMsgPaintKit_Definition.Item.toObject(message.riding_crop, options);
if (message.russian_riot != null && message.hasOwnProperty("russian_riot"))
object.russian_riot = $root.CMsgPaintKit_Definition.Item.toObject(message.russian_riot, options);
if (message.scimitar != null && message.hasOwnProperty("scimitar"))
object.scimitar = $root.CMsgPaintKit_Definition.Item.toObject(message.scimitar, options);
if (message.scorch_shot != null && message.hasOwnProperty("scorch_shot"))
object.scorch_shot = $root.CMsgPaintKit_Definition.Item.toObject(message.scorch_shot, options);
if (message.shortstop != null && message.hasOwnProperty("shortstop"))
object.shortstop = $root.CMsgPaintKit_Definition.Item.toObject(message.shortstop, options);
if (message.soda_popper != null && message.hasOwnProperty("soda_popper"))
object.soda_popper = $root.CMsgPaintKit_Definition.Item.toObject(message.soda_popper, options);
if (message.tele_shotgun != null && message.hasOwnProperty("tele_shotgun"))
object.tele_shotgun = $root.CMsgPaintKit_Definition.Item.toObject(message.tele_shotgun, options);
if (message.tomislav != null && message.hasOwnProperty("tomislav"))
object.tomislav = $root.CMsgPaintKit_Definition.Item.toObject(message.tomislav, options);
if (message.trenchgun != null && message.hasOwnProperty("trenchgun"))
object.trenchgun = $root.CMsgPaintKit_Definition.Item.toObject(message.trenchgun, options);
if (message.winger_pistol != null && message.hasOwnProperty("winger_pistol"))
object.winger_pistol = $root.CMsgPaintKit_Definition.Item.toObject(message.winger_pistol, options);
return object;
};
/**
* Converts this CMsgPaintKit_Definition to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Definition
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgPaintKit_Definition.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
CMsgPaintKit_Definition.Item = (function() {
/**
* Properties of an Item.
* @memberof CMsgPaintKit_Definition
* @interface IItem
* @property {ICMsgProtoDefID} item_definition_template Item item_definition_template
* @property {CMsgPaintKit_Definition.Item.IItemData|null} [data] Item data
*/
/**
* Constructs a new Item.
* @memberof CMsgPaintKit_Definition
* @classdesc Represents an Item.
* @implements IItem
* @constructor
* @param {CMsgPaintKit_Definition.IItem=} [properties] Properties to set
*/
function Item(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Item item_definition_template.
* @member {ICMsgProtoDefID} item_definition_template
* @memberof CMsgPaintKit_Definition.Item
* @instance
*/
Item.prototype.item_definition_template = null;
/**
* Item data.
* @member {CMsgPaintKit_Definition.Item.IItemData|null|undefined} data
* @memberof CMsgPaintKit_Definition.Item
* @instance
*/
Item.prototype.data = null;
/**
* Creates a new Item instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Definition.Item
* @static
* @param {CMsgPaintKit_Definition.IItem=} [properties] Properties to set
* @returns {CMsgPaintKit_Definition.Item} Item instance
*/
Item.create = function create(properties) {
return new Item(properties);
};
/**
* Encodes the specified Item message. Does not implicitly {@link CMsgPaintKit_Definition.Item.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Definition.Item
* @static
* @param {CMsgPaintKit_Definition.IItem} message Item message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Item.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefID.encode(message.item_definition_template, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.data != null && message.hasOwnProperty("data"))
$root.CMsgPaintKit_Definition.Item.ItemData.encode(message.data, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
return writer;
};
/**
* Encodes the specified Item message, length delimited. Does not implicitly {@link CMsgPaintKit_Definition.Item.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Definition.Item
* @static
* @param {CMsgPaintKit_Definition.IItem} message Item message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Item.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an Item message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Definition.Item
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Definition.Item} Item
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Item.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Definition.Item();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.item_definition_template = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
case 5:
message.data = $root.CMsgPaintKit_Definition.Item.ItemData.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("item_definition_template"))
throw $util.ProtocolError("missing required 'item_definition_template'", { instance: message });
return message;
};
/**
* Decodes an Item message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Definition.Item
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Definition.Item} Item
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Item.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an Item message.
* @function verify
* @memberof CMsgPaintKit_Definition.Item
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Item.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefID.verify(message.item_definition_template);
if (error)
return "item_definition_template." + error;
}
if (message.data != null && message.hasOwnProperty("data")) {
var error = $root.CMsgPaintKit_Definition.Item.ItemData.verify(message.data);
if (error)
return "data." + error;
}
return null;
};
/**
* Creates an Item message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Definition.Item
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Definition.Item} Item
*/
Item.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Definition.Item)
return object;
var message = new $root.CMsgPaintKit_Definition.Item();
if (object.item_definition_template != null) {
if (typeof object.item_definition_template !== "object")
throw TypeError(".CMsgPaintKit_Definition.Item.item_definition_template: object expected");
message.item_definition_template = $root.CMsgProtoDefID.fromObject(object.item_definition_template);
}
if (object.data != null) {
if (typeof object.data !== "object")
throw TypeError(".CMsgPaintKit_Definition.Item.data: object expected");
message.data = $root.CMsgPaintKit_Definition.Item.ItemData.fromObject(object.data);
}
return message;
};
/**
* Creates a plain object from an Item message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Definition.Item
* @static
* @param {CMsgPaintKit_Definition.Item} message Item
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Item.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.item_definition_template = null;
object.data = null;
}
if (message.item_definition_template != null && message.hasOwnProperty("item_definition_template"))
object.item_definition_template = $root.CMsgProtoDefID.toObject(message.item_definition_template, options);
if (message.data != null && message.hasOwnProperty("data"))
object.data = $root.CMsgPaintKit_Definition.Item.ItemData.toObject(message.data, options);
return object;
};
/**
* Converts this Item to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Definition.Item
* @instance
* @returns {Object.<string,*>} JSON object
*/
Item.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
Item.ItemData = (function() {
/**
* Properties of an ItemData.
* @memberof CMsgPaintKit_Definition.Item
* @interface IItemData
* @property {boolean|null} [can_apply_paintkit] ItemData can_apply_paintkit
* @property {string|null} [material_override] ItemData material_override
* @property {Array.<ICMsgVarField>|null} [variable] ItemData variable
*/
/**
* Constructs a new ItemData.
* @memberof CMsgPaintKit_Definition.Item
* @classdesc Represents an ItemData.
* @implements IItemData
* @constructor
* @param {CMsgPaintKit_Definition.Item.IItemData=} [properties] Properties to set
*/
function ItemData(properties) {
this.variable = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ItemData can_apply_paintkit.
* @member {boolean} can_apply_paintkit
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @instance
*/
ItemData.prototype.can_apply_paintkit = true;
/**
* ItemData material_override.
* @member {string} material_override
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @instance
*/
ItemData.prototype.material_override = "";
/**
* ItemData variable.
* @member {Array.<ICMsgVarField>} variable
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @instance
*/
ItemData.prototype.variable = $util.emptyArray;
/**
* Creates a new ItemData instance using the specified properties.
* @function create
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @static
* @param {CMsgPaintKit_Definition.Item.IItemData=} [properties] Properties to set
* @returns {CMsgPaintKit_Definition.Item.ItemData} ItemData instance
*/
ItemData.create = function create(properties) {
return new ItemData(properties);
};
/**
* Encodes the specified ItemData message. Does not implicitly {@link CMsgPaintKit_Definition.Item.ItemData.verify|verify} messages.
* @function encode
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @static
* @param {CMsgPaintKit_Definition.Item.IItemData} message ItemData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ItemData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.can_apply_paintkit != null && message.hasOwnProperty("can_apply_paintkit"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.can_apply_paintkit);
if (message.material_override != null && message.hasOwnProperty("material_override"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.material_override);
if (message.variable != null && message.variable.length)
for (var i = 0; i < message.variable.length; ++i)
$root.CMsgVarField.encode(message.variable[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ItemData message, length delimited. Does not implicitly {@link CMsgPaintKit_Definition.Item.ItemData.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @static
* @param {CMsgPaintKit_Definition.Item.IItemData} message ItemData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ItemData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ItemData message from the specified reader or buffer.
* @function decode
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgPaintKit_Definition.Item.ItemData} ItemData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ItemData.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgPaintKit_Definition.Item.ItemData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 2:
message.can_apply_paintkit = reader.bool();
break;
case 3:
message.material_override = reader.string();
break;
case 4:
if (!(message.variable && message.variable.length))
message.variable = [];
message.variable.push($root.CMsgVarField.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ItemData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgPaintKit_Definition.Item.ItemData} ItemData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ItemData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ItemData message.
* @function verify
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ItemData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.can_apply_paintkit != null && message.hasOwnProperty("can_apply_paintkit"))
if (typeof message.can_apply_paintkit !== "boolean")
return "can_apply_paintkit: boolean expected";
if (message.material_override != null && message.hasOwnProperty("material_override"))
if (!$util.isString(message.material_override))
return "material_override: string expected";
if (message.variable != null && message.hasOwnProperty("variable")) {
if (!Array.isArray(message.variable))
return "variable: array expected";
for (var i = 0; i < message.variable.length; ++i) {
var error = $root.CMsgVarField.verify(message.variable[i]);
if (error)
return "variable." + error;
}
}
return null;
};
/**
* Creates an ItemData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgPaintKit_Definition.Item.ItemData} ItemData
*/
ItemData.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgPaintKit_Definition.Item.ItemData)
return object;
var message = new $root.CMsgPaintKit_Definition.Item.ItemData();
if (object.can_apply_paintkit != null)
message.can_apply_paintkit = Boolean(object.can_apply_paintkit);
if (object.material_override != null)
message.material_override = String(object.material_override);
if (object.variable) {
if (!Array.isArray(object.variable))
throw TypeError(".CMsgPaintKit_Definition.Item.ItemData.variable: array expected");
message.variable = [];
for (var i = 0; i < object.variable.length; ++i) {
if (typeof object.variable[i] !== "object")
throw TypeError(".CMsgPaintKit_Definition.Item.ItemData.variable: object expected");
message.variable[i] = $root.CMsgVarField.fromObject(object.variable[i]);
}
}
return message;
};
/**
* Creates a plain object from an ItemData message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @static
* @param {CMsgPaintKit_Definition.Item.ItemData} message ItemData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ItemData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.variable = [];
if (options.defaults) {
object.can_apply_paintkit = true;
object.material_override = "";
}
if (message.can_apply_paintkit != null && message.hasOwnProperty("can_apply_paintkit"))
object.can_apply_paintkit = message.can_apply_paintkit;
if (message.material_override != null && message.hasOwnProperty("material_override"))
object.material_override = message.material_override;
if (message.variable && message.variable.length) {
object.variable = [];
for (var j = 0; j < message.variable.length; ++j)
object.variable[j] = $root.CMsgVarField.toObject(message.variable[j], options);
}
return object;
};
/**
* Converts this ItemData to JSON.
* @function toJSON
* @memberof CMsgPaintKit_Definition.Item.ItemData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ItemData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return ItemData;
})();
return Item;
})();
return CMsgPaintKit_Definition;
})();
$root.CMsgQuestTheme = (function() {
/**
* Properties of a CMsgQuestTheme.
* @exports ICMsgQuestTheme
* @interface ICMsgQuestTheme
* @property {ICMsgProtoDefHeader} header CMsgQuestTheme header
* @property {string|null} [notification_res] CMsgQuestTheme notification_res
* @property {string|null} [quest_item_res] CMsgQuestTheme quest_item_res
* @property {string|null} [in_game_tracker_res] CMsgQuestTheme in_game_tracker_res
* @property {Array.<CMsgQuestTheme.IWeightedStringSet>|null} [give_sounds] CMsgQuestTheme give_sounds
* @property {Array.<CMsgQuestTheme.IWeightedStringSet>|null} [complete_sounds] CMsgQuestTheme complete_sounds
* @property {Array.<CMsgQuestTheme.IWeightedStringSet>|null} [fully_complete_sounds] CMsgQuestTheme fully_complete_sounds
* @property {string|null} [reward_sound] CMsgQuestTheme reward_sound
* @property {string|null} [discard_sound] CMsgQuestTheme discard_sound
* @property {string|null} [reveal_sound] CMsgQuestTheme reveal_sound
*/
/**
* Constructs a new CMsgQuestTheme.
* @exports CMsgQuestTheme
* @classdesc Represents a CMsgQuestTheme.
* @implements ICMsgQuestTheme
* @constructor
* @param {ICMsgQuestTheme=} [properties] Properties to set
*/
function CMsgQuestTheme(properties) {
this.give_sounds = [];
this.complete_sounds = [];
this.fully_complete_sounds = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgQuestTheme header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.header = null;
/**
* CMsgQuestTheme notification_res.
* @member {string} notification_res
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.notification_res = "";
/**
* CMsgQuestTheme quest_item_res.
* @member {string} quest_item_res
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.quest_item_res = "";
/**
* CMsgQuestTheme in_game_tracker_res.
* @member {string} in_game_tracker_res
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.in_game_tracker_res = "";
/**
* CMsgQuestTheme give_sounds.
* @member {Array.<CMsgQuestTheme.IWeightedStringSet>} give_sounds
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.give_sounds = $util.emptyArray;
/**
* CMsgQuestTheme complete_sounds.
* @member {Array.<CMsgQuestTheme.IWeightedStringSet>} complete_sounds
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.complete_sounds = $util.emptyArray;
/**
* CMsgQuestTheme fully_complete_sounds.
* @member {Array.<CMsgQuestTheme.IWeightedStringSet>} fully_complete_sounds
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.fully_complete_sounds = $util.emptyArray;
/**
* CMsgQuestTheme reward_sound.
* @member {string} reward_sound
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.reward_sound = "";
/**
* CMsgQuestTheme discard_sound.
* @member {string} discard_sound
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.discard_sound = "";
/**
* CMsgQuestTheme reveal_sound.
* @member {string} reveal_sound
* @memberof CMsgQuestTheme
* @instance
*/
CMsgQuestTheme.prototype.reveal_sound = "";
/**
* Creates a new CMsgQuestTheme instance using the specified properties.
* @function create
* @memberof CMsgQuestTheme
* @static
* @param {ICMsgQuestTheme=} [properties] Properties to set
* @returns {CMsgQuestTheme} CMsgQuestTheme instance
*/
CMsgQuestTheme.create = function create(properties) {
return new CMsgQuestTheme(properties);
};
/**
* Encodes the specified CMsgQuestTheme message. Does not implicitly {@link CMsgQuestTheme.verify|verify} messages.
* @function encode
* @memberof CMsgQuestTheme
* @static
* @param {ICMsgQuestTheme} message CMsgQuestTheme message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestTheme.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.notification_res != null && message.hasOwnProperty("notification_res"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.notification_res);
if (message.quest_item_res != null && message.hasOwnProperty("quest_item_res"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.quest_item_res);
if (message.in_game_tracker_res != null && message.hasOwnProperty("in_game_tracker_res"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.in_game_tracker_res);
if (message.give_sounds != null && message.give_sounds.length)
for (var i = 0; i < message.give_sounds.length; ++i)
$root.CMsgQuestTheme.WeightedStringSet.encode(message.give_sounds[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.complete_sounds != null && message.complete_sounds.length)
for (var i = 0; i < message.complete_sounds.length; ++i)
$root.CMsgQuestTheme.WeightedStringSet.encode(message.complete_sounds[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.fully_complete_sounds != null && message.fully_complete_sounds.length)
for (var i = 0; i < message.fully_complete_sounds.length; ++i)
$root.CMsgQuestTheme.WeightedStringSet.encode(message.fully_complete_sounds[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.reward_sound != null && message.hasOwnProperty("reward_sound"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.reward_sound);
if (message.discard_sound != null && message.hasOwnProperty("discard_sound"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.discard_sound);
if (message.reveal_sound != null && message.hasOwnProperty("reveal_sound"))
writer.uint32(/* id 10, wireType 2 =*/82).string(message.reveal_sound);
return writer;
};
/**
* Encodes the specified CMsgQuestTheme message, length delimited. Does not implicitly {@link CMsgQuestTheme.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestTheme
* @static
* @param {ICMsgQuestTheme} message CMsgQuestTheme message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestTheme.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestTheme message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestTheme
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestTheme} CMsgQuestTheme
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestTheme.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestTheme();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
case 2:
message.notification_res = reader.string();
break;
case 3:
message.quest_item_res = reader.string();
break;
case 4:
message.in_game_tracker_res = reader.string();
break;
case 5:
if (!(message.give_sounds && message.give_sounds.length))
message.give_sounds = [];
message.give_sounds.push($root.CMsgQuestTheme.WeightedStringSet.decode(reader, reader.uint32()));
break;
case 6:
if (!(message.complete_sounds && message.complete_sounds.length))
message.complete_sounds = [];
message.complete_sounds.push($root.CMsgQuestTheme.WeightedStringSet.decode(reader, reader.uint32()));
break;
case 7:
if (!(message.fully_complete_sounds && message.fully_complete_sounds.length))
message.fully_complete_sounds = [];
message.fully_complete_sounds.push($root.CMsgQuestTheme.WeightedStringSet.decode(reader, reader.uint32()));
break;
case 8:
message.reward_sound = reader.string();
break;
case 9:
message.discard_sound = reader.string();
break;
case 10:
message.reveal_sound = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestTheme message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestTheme
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestTheme} CMsgQuestTheme
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestTheme.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestTheme message.
* @function verify
* @memberof CMsgQuestTheme
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestTheme.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
if (message.notification_res != null && message.hasOwnProperty("notification_res"))
if (!$util.isString(message.notification_res))
return "notification_res: string expected";
if (message.quest_item_res != null && message.hasOwnProperty("quest_item_res"))
if (!$util.isString(message.quest_item_res))
return "quest_item_res: string expected";
if (message.in_game_tracker_res != null && message.hasOwnProperty("in_game_tracker_res"))
if (!$util.isString(message.in_game_tracker_res))
return "in_game_tracker_res: string expected";
if (message.give_sounds != null && message.hasOwnProperty("give_sounds")) {
if (!Array.isArray(message.give_sounds))
return "give_sounds: array expected";
for (var i = 0; i < message.give_sounds.length; ++i) {
var error = $root.CMsgQuestTheme.WeightedStringSet.verify(message.give_sounds[i]);
if (error)
return "give_sounds." + error;
}
}
if (message.complete_sounds != null && message.hasOwnProperty("complete_sounds")) {
if (!Array.isArray(message.complete_sounds))
return "complete_sounds: array expected";
for (var i = 0; i < message.complete_sounds.length; ++i) {
var error = $root.CMsgQuestTheme.WeightedStringSet.verify(message.complete_sounds[i]);
if (error)
return "complete_sounds." + error;
}
}
if (message.fully_complete_sounds != null && message.hasOwnProperty("fully_complete_sounds")) {
if (!Array.isArray(message.fully_complete_sounds))
return "fully_complete_sounds: array expected";
for (var i = 0; i < message.fully_complete_sounds.length; ++i) {
var error = $root.CMsgQuestTheme.WeightedStringSet.verify(message.fully_complete_sounds[i]);
if (error)
return "fully_complete_sounds." + error;
}
}
if (message.reward_sound != null && message.hasOwnProperty("reward_sound"))
if (!$util.isString(message.reward_sound))
return "reward_sound: string expected";
if (message.discard_sound != null && message.hasOwnProperty("discard_sound"))
if (!$util.isString(message.discard_sound))
return "discard_sound: string expected";
if (message.reveal_sound != null && message.hasOwnProperty("reveal_sound"))
if (!$util.isString(message.reveal_sound))
return "reveal_sound: string expected";
return null;
};
/**
* Creates a CMsgQuestTheme message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestTheme
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestTheme} CMsgQuestTheme
*/
CMsgQuestTheme.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestTheme)
return object;
var message = new $root.CMsgQuestTheme();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgQuestTheme.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
if (object.notification_res != null)
message.notification_res = String(object.notification_res);
if (object.quest_item_res != null)
message.quest_item_res = String(object.quest_item_res);
if (object.in_game_tracker_res != null)
message.in_game_tracker_res = String(object.in_game_tracker_res);
if (object.give_sounds) {
if (!Array.isArray(object.give_sounds))
throw TypeError(".CMsgQuestTheme.give_sounds: array expected");
message.give_sounds = [];
for (var i = 0; i < object.give_sounds.length; ++i) {
if (typeof object.give_sounds[i] !== "object")
throw TypeError(".CMsgQuestTheme.give_sounds: object expected");
message.give_sounds[i] = $root.CMsgQuestTheme.WeightedStringSet.fromObject(object.give_sounds[i]);
}
}
if (object.complete_sounds) {
if (!Array.isArray(object.complete_sounds))
throw TypeError(".CMsgQuestTheme.complete_sounds: array expected");
message.complete_sounds = [];
for (var i = 0; i < object.complete_sounds.length; ++i) {
if (typeof object.complete_sounds[i] !== "object")
throw TypeError(".CMsgQuestTheme.complete_sounds: object expected");
message.complete_sounds[i] = $root.CMsgQuestTheme.WeightedStringSet.fromObject(object.complete_sounds[i]);
}
}
if (object.fully_complete_sounds) {
if (!Array.isArray(object.fully_complete_sounds))
throw TypeError(".CMsgQuestTheme.fully_complete_sounds: array expected");
message.fully_complete_sounds = [];
for (var i = 0; i < object.fully_complete_sounds.length; ++i) {
if (typeof object.fully_complete_sounds[i] !== "object")
throw TypeError(".CMsgQuestTheme.fully_complete_sounds: object expected");
message.fully_complete_sounds[i] = $root.CMsgQuestTheme.WeightedStringSet.fromObject(object.fully_complete_sounds[i]);
}
}
if (object.reward_sound != null)
message.reward_sound = String(object.reward_sound);
if (object.discard_sound != null)
message.discard_sound = String(object.discard_sound);
if (object.reveal_sound != null)
message.reveal_sound = String(object.reveal_sound);
return message;
};
/**
* Creates a plain object from a CMsgQuestTheme message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestTheme
* @static
* @param {CMsgQuestTheme} message CMsgQuestTheme
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestTheme.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.give_sounds = [];
object.complete_sounds = [];
object.fully_complete_sounds = [];
}
if (options.defaults) {
object.header = null;
object.notification_res = "";
object.quest_item_res = "";
object.in_game_tracker_res = "";
object.reward_sound = "";
object.discard_sound = "";
object.reveal_sound = "";
}
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
if (message.notification_res != null && message.hasOwnProperty("notification_res"))
object.notification_res = message.notification_res;
if (message.quest_item_res != null && message.hasOwnProperty("quest_item_res"))
object.quest_item_res = message.quest_item_res;
if (message.in_game_tracker_res != null && message.hasOwnProperty("in_game_tracker_res"))
object.in_game_tracker_res = message.in_game_tracker_res;
if (message.give_sounds && message.give_sounds.length) {
object.give_sounds = [];
for (var j = 0; j < message.give_sounds.length; ++j)
object.give_sounds[j] = $root.CMsgQuestTheme.WeightedStringSet.toObject(message.give_sounds[j], options);
}
if (message.complete_sounds && message.complete_sounds.length) {
object.complete_sounds = [];
for (var j = 0; j < message.complete_sounds.length; ++j)
object.complete_sounds[j] = $root.CMsgQuestTheme.WeightedStringSet.toObject(message.complete_sounds[j], options);
}
if (message.fully_complete_sounds && message.fully_complete_sounds.length) {
object.fully_complete_sounds = [];
for (var j = 0; j < message.fully_complete_sounds.length; ++j)
object.fully_complete_sounds[j] = $root.CMsgQuestTheme.WeightedStringSet.toObject(message.fully_complete_sounds[j], options);
}
if (message.reward_sound != null && message.hasOwnProperty("reward_sound"))
object.reward_sound = message.reward_sound;
if (message.discard_sound != null && message.hasOwnProperty("discard_sound"))
object.discard_sound = message.discard_sound;
if (message.reveal_sound != null && message.hasOwnProperty("reveal_sound"))
object.reveal_sound = message.reveal_sound;
return object;
};
/**
* Converts this CMsgQuestTheme to JSON.
* @function toJSON
* @memberof CMsgQuestTheme
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestTheme.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
CMsgQuestTheme.WeightedString = (function() {
/**
* Properties of a WeightedString.
* @memberof CMsgQuestTheme
* @interface IWeightedString
* @property {string|null} [string] WeightedString string
* @property {number|null} [weight] WeightedString weight
*/
/**
* Constructs a new WeightedString.
* @memberof CMsgQuestTheme
* @classdesc Represents a WeightedString.
* @implements IWeightedString
* @constructor
* @param {CMsgQuestTheme.IWeightedString=} [properties] Properties to set
*/
function WeightedString(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]];
}
/**
* WeightedString string.
* @member {string} string
* @memberof CMsgQuestTheme.WeightedString
* @instance
*/
WeightedString.prototype.string = "";
/**
* WeightedString weight.
* @member {number} weight
* @memberof CMsgQuestTheme.WeightedString
* @instance
*/
WeightedString.prototype.weight = 0;
/**
* Creates a new WeightedString instance using the specified properties.
* @function create
* @memberof CMsgQuestTheme.WeightedString
* @static
* @param {CMsgQuestTheme.IWeightedString=} [properties] Properties to set
* @returns {CMsgQuestTheme.WeightedString} WeightedString instance
*/
WeightedString.create = function create(properties) {
return new WeightedString(properties);
};
/**
* Encodes the specified WeightedString message. Does not implicitly {@link CMsgQuestTheme.WeightedString.verify|verify} messages.
* @function encode
* @memberof CMsgQuestTheme.WeightedString
* @static
* @param {CMsgQuestTheme.IWeightedString} message WeightedString message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
WeightedString.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.string != null && message.hasOwnProperty("string"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.string);
if (message.weight != null && message.hasOwnProperty("weight"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.weight);
return writer;
};
/**
* Encodes the specified WeightedString message, length delimited. Does not implicitly {@link CMsgQuestTheme.WeightedString.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestTheme.WeightedString
* @static
* @param {CMsgQuestTheme.IWeightedString} message WeightedString message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
WeightedString.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a WeightedString message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestTheme.WeightedString
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestTheme.WeightedString} WeightedString
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
WeightedString.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestTheme.WeightedString();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.string = reader.string();
break;
case 2:
message.weight = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a WeightedString message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestTheme.WeightedString
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestTheme.WeightedString} WeightedString
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
WeightedString.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a WeightedString message.
* @function verify
* @memberof CMsgQuestTheme.WeightedString
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
WeightedString.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.string != null && message.hasOwnProperty("string"))
if (!$util.isString(message.string))
return "string: string expected";
if (message.weight != null && message.hasOwnProperty("weight"))
if (!$util.isInteger(message.weight))
return "weight: integer expected";
return null;
};
/**
* Creates a WeightedString message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestTheme.WeightedString
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestTheme.WeightedString} WeightedString
*/
WeightedString.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestTheme.WeightedString)
return object;
var message = new $root.CMsgQuestTheme.WeightedString();
if (object.string != null)
message.string = String(object.string);
if (object.weight != null)
message.weight = object.weight >>> 0;
return message;
};
/**
* Creates a plain object from a WeightedString message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestTheme.WeightedString
* @static
* @param {CMsgQuestTheme.WeightedString} message WeightedString
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
WeightedString.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.string = "";
object.weight = 0;
}
if (message.string != null && message.hasOwnProperty("string"))
object.string = message.string;
if (message.weight != null && message.hasOwnProperty("weight"))
object.weight = message.weight;
return object;
};
/**
* Converts this WeightedString to JSON.
* @function toJSON
* @memberof CMsgQuestTheme.WeightedString
* @instance
* @returns {Object.<string,*>} JSON object
*/
WeightedString.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return WeightedString;
})();
CMsgQuestTheme.WeightedStringSet = (function() {
/**
* Properties of a WeightedStringSet.
* @memberof CMsgQuestTheme
* @interface IWeightedStringSet
* @property {Array.<CMsgQuestTheme.IWeightedString>|null} [weighted_strings] WeightedStringSet weighted_strings
*/
/**
* Constructs a new WeightedStringSet.
* @memberof CMsgQuestTheme
* @classdesc Represents a WeightedStringSet.
* @implements IWeightedStringSet
* @constructor
* @param {CMsgQuestTheme.IWeightedStringSet=} [properties] Properties to set
*/
function WeightedStringSet(properties) {
this.weighted_strings = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* WeightedStringSet weighted_strings.
* @member {Array.<CMsgQuestTheme.IWeightedString>} weighted_strings
* @memberof CMsgQuestTheme.WeightedStringSet
* @instance
*/
WeightedStringSet.prototype.weighted_strings = $util.emptyArray;
/**
* Creates a new WeightedStringSet instance using the specified properties.
* @function create
* @memberof CMsgQuestTheme.WeightedStringSet
* @static
* @param {CMsgQuestTheme.IWeightedStringSet=} [properties] Properties to set
* @returns {CMsgQuestTheme.WeightedStringSet} WeightedStringSet instance
*/
WeightedStringSet.create = function create(properties) {
return new WeightedStringSet(properties);
};
/**
* Encodes the specified WeightedStringSet message. Does not implicitly {@link CMsgQuestTheme.WeightedStringSet.verify|verify} messages.
* @function encode
* @memberof CMsgQuestTheme.WeightedStringSet
* @static
* @param {CMsgQuestTheme.IWeightedStringSet} message WeightedStringSet message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
WeightedStringSet.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.weighted_strings != null && message.weighted_strings.length)
for (var i = 0; i < message.weighted_strings.length; ++i)
$root.CMsgQuestTheme.WeightedString.encode(message.weighted_strings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified WeightedStringSet message, length delimited. Does not implicitly {@link CMsgQuestTheme.WeightedStringSet.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestTheme.WeightedStringSet
* @static
* @param {CMsgQuestTheme.IWeightedStringSet} message WeightedStringSet message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
WeightedStringSet.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a WeightedStringSet message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestTheme.WeightedStringSet
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestTheme.WeightedStringSet} WeightedStringSet
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
WeightedStringSet.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestTheme.WeightedStringSet();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.weighted_strings && message.weighted_strings.length))
message.weighted_strings = [];
message.weighted_strings.push($root.CMsgQuestTheme.WeightedString.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a WeightedStringSet message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestTheme.WeightedStringSet
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestTheme.WeightedStringSet} WeightedStringSet
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
WeightedStringSet.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a WeightedStringSet message.
* @function verify
* @memberof CMsgQuestTheme.WeightedStringSet
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
WeightedStringSet.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.weighted_strings != null && message.hasOwnProperty("weighted_strings")) {
if (!Array.isArray(message.weighted_strings))
return "weighted_strings: array expected";
for (var i = 0; i < message.weighted_strings.length; ++i) {
var error = $root.CMsgQuestTheme.WeightedString.verify(message.weighted_strings[i]);
if (error)
return "weighted_strings." + error;
}
}
return null;
};
/**
* Creates a WeightedStringSet message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestTheme.WeightedStringSet
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestTheme.WeightedStringSet} WeightedStringSet
*/
WeightedStringSet.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestTheme.WeightedStringSet)
return object;
var message = new $root.CMsgQuestTheme.WeightedStringSet();
if (object.weighted_strings) {
if (!Array.isArray(object.weighted_strings))
throw TypeError(".CMsgQuestTheme.WeightedStringSet.weighted_strings: array expected");
message.weighted_strings = [];
for (var i = 0; i < object.weighted_strings.length; ++i) {
if (typeof object.weighted_strings[i] !== "object")
throw TypeError(".CMsgQuestTheme.WeightedStringSet.weighted_strings: object expected");
message.weighted_strings[i] = $root.CMsgQuestTheme.WeightedString.fromObject(object.weighted_strings[i]);
}
}
return message;
};
/**
* Creates a plain object from a WeightedStringSet message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestTheme.WeightedStringSet
* @static
* @param {CMsgQuestTheme.WeightedStringSet} message WeightedStringSet
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
WeightedStringSet.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.weighted_strings = [];
if (message.weighted_strings && message.weighted_strings.length) {
object.weighted_strings = [];
for (var j = 0; j < message.weighted_strings.length; ++j)
object.weighted_strings[j] = $root.CMsgQuestTheme.WeightedString.toObject(message.weighted_strings[j], options);
}
return object;
};
/**
* Converts this WeightedStringSet to JSON.
* @function toJSON
* @memberof CMsgQuestTheme.WeightedStringSet
* @instance
* @returns {Object.<string,*>} JSON object
*/
WeightedStringSet.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return WeightedStringSet;
})();
return CMsgQuestTheme;
})();
$root.CMsgQuestMapNodeCondition_NodeState = (function() {
/**
* Properties of a CMsgQuestMapNodeCondition_NodeState.
* @exports ICMsgQuestMapNodeCondition_NodeState
* @interface ICMsgQuestMapNodeCondition_NodeState
* @property {number|null} [bonus_objectives_required] CMsgQuestMapNodeCondition_NodeState bonus_objectives_required
* @property {ICMsgProtoDefID} target_node_defid CMsgQuestMapNodeCondition_NodeState target_node_defid
*/
/**
* Constructs a new CMsgQuestMapNodeCondition_NodeState.
* @exports CMsgQuestMapNodeCondition_NodeState
* @classdesc Represents a CMsgQuestMapNodeCondition_NodeState.
* @implements ICMsgQuestMapNodeCondition_NodeState
* @constructor
* @param {ICMsgQuestMapNodeCondition_NodeState=} [properties] Properties to set
*/
function CMsgQuestMapNodeCondition_NodeState(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]];
}
/**
* CMsgQuestMapNodeCondition_NodeState bonus_objectives_required.
* @member {number} bonus_objectives_required
* @memberof CMsgQuestMapNodeCondition_NodeState
* @instance
*/
CMsgQuestMapNodeCondition_NodeState.prototype.bonus_objectives_required = 0;
/**
* CMsgQuestMapNodeCondition_NodeState target_node_defid.
* @member {ICMsgProtoDefID} target_node_defid
* @memberof CMsgQuestMapNodeCondition_NodeState
* @instance
*/
CMsgQuestMapNodeCondition_NodeState.prototype.target_node_defid = null;
/**
* Creates a new CMsgQuestMapNodeCondition_NodeState instance using the specified properties.
* @function create
* @memberof CMsgQuestMapNodeCondition_NodeState
* @static
* @param {ICMsgQuestMapNodeCondition_NodeState=} [properties] Properties to set
* @returns {CMsgQuestMapNodeCondition_NodeState} CMsgQuestMapNodeCondition_NodeState instance
*/
CMsgQuestMapNodeCondition_NodeState.create = function create(properties) {
return new CMsgQuestMapNodeCondition_NodeState(properties);
};
/**
* Encodes the specified CMsgQuestMapNodeCondition_NodeState message. Does not implicitly {@link CMsgQuestMapNodeCondition_NodeState.verify|verify} messages.
* @function encode
* @memberof CMsgQuestMapNodeCondition_NodeState
* @static
* @param {ICMsgQuestMapNodeCondition_NodeState} message CMsgQuestMapNodeCondition_NodeState message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapNodeCondition_NodeState.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.bonus_objectives_required != null && message.hasOwnProperty("bonus_objectives_required"))
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.bonus_objectives_required);
$root.CMsgProtoDefID.encode(message.target_node_defid, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgQuestMapNodeCondition_NodeState message, length delimited. Does not implicitly {@link CMsgQuestMapNodeCondition_NodeState.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestMapNodeCondition_NodeState
* @static
* @param {ICMsgQuestMapNodeCondition_NodeState} message CMsgQuestMapNodeCondition_NodeState message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapNodeCondition_NodeState.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestMapNodeCondition_NodeState message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestMapNodeCondition_NodeState
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestMapNodeCondition_NodeState} CMsgQuestMapNodeCondition_NodeState
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapNodeCondition_NodeState.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestMapNodeCondition_NodeState();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.bonus_objectives_required = reader.uint32();
break;
case 2:
message.target_node_defid = $root.CMsgProtoDefID.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("target_node_defid"))
throw $util.ProtocolError("missing required 'target_node_defid'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestMapNodeCondition_NodeState message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestMapNodeCondition_NodeState
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestMapNodeCondition_NodeState} CMsgQuestMapNodeCondition_NodeState
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapNodeCondition_NodeState.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestMapNodeCondition_NodeState message.
* @function verify
* @memberof CMsgQuestMapNodeCondition_NodeState
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestMapNodeCondition_NodeState.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.bonus_objectives_required != null && message.hasOwnProperty("bonus_objectives_required"))
if (!$util.isInteger(message.bonus_objectives_required))
return "bonus_objectives_required: integer expected";
{
var error = $root.CMsgProtoDefID.verify(message.target_node_defid);
if (error)
return "target_node_defid." + error;
}
return null;
};
/**
* Creates a CMsgQuestMapNodeCondition_NodeState message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestMapNodeCondition_NodeState
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestMapNodeCondition_NodeState} CMsgQuestMapNodeCondition_NodeState
*/
CMsgQuestMapNodeCondition_NodeState.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestMapNodeCondition_NodeState)
return object;
var message = new $root.CMsgQuestMapNodeCondition_NodeState();
if (object.bonus_objectives_required != null)
message.bonus_objectives_required = object.bonus_objectives_required >>> 0;
if (object.target_node_defid != null) {
if (typeof object.target_node_defid !== "object")
throw TypeError(".CMsgQuestMapNodeCondition_NodeState.target_node_defid: object expected");
message.target_node_defid = $root.CMsgProtoDefID.fromObject(object.target_node_defid);
}
return message;
};
/**
* Creates a plain object from a CMsgQuestMapNodeCondition_NodeState message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestMapNodeCondition_NodeState
* @static
* @param {CMsgQuestMapNodeCondition_NodeState} message CMsgQuestMapNodeCondition_NodeState
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestMapNodeCondition_NodeState.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.bonus_objectives_required = 0;
object.target_node_defid = null;
}
if (message.bonus_objectives_required != null && message.hasOwnProperty("bonus_objectives_required"))
object.bonus_objectives_required = message.bonus_objectives_required;
if (message.target_node_defid != null && message.hasOwnProperty("target_node_defid"))
object.target_node_defid = $root.CMsgProtoDefID.toObject(message.target_node_defid, options);
return object;
};
/**
* Converts this CMsgQuestMapNodeCondition_NodeState to JSON.
* @function toJSON
* @memberof CMsgQuestMapNodeCondition_NodeState
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestMapNodeCondition_NodeState.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgQuestMapNodeCondition_NodeState;
})();
$root.CMsgQuestMapNodeCondition_Logic = (function() {
/**
* Properties of a CMsgQuestMapNodeCondition_Logic.
* @exports ICMsgQuestMapNodeCondition_Logic
* @interface ICMsgQuestMapNodeCondition_Logic
* @property {LogicalOperation} operation CMsgQuestMapNodeCondition_Logic operation
* @property {Array.<ICMsgQuestMapNodeCondition>|null} [sub_conditions] CMsgQuestMapNodeCondition_Logic sub_conditions
*/
/**
* Constructs a new CMsgQuestMapNodeCondition_Logic.
* @exports CMsgQuestMapNodeCondition_Logic
* @classdesc Represents a CMsgQuestMapNodeCondition_Logic.
* @implements ICMsgQuestMapNodeCondition_Logic
* @constructor
* @param {ICMsgQuestMapNodeCondition_Logic=} [properties] Properties to set
*/
function CMsgQuestMapNodeCondition_Logic(properties) {
this.sub_conditions = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CMsgQuestMapNodeCondition_Logic operation.
* @member {LogicalOperation} operation
* @memberof CMsgQuestMapNodeCondition_Logic
* @instance
*/
CMsgQuestMapNodeCondition_Logic.prototype.operation = 0;
/**
* CMsgQuestMapNodeCondition_Logic sub_conditions.
* @member {Array.<ICMsgQuestMapNodeCondition>} sub_conditions
* @memberof CMsgQuestMapNodeCondition_Logic
* @instance
*/
CMsgQuestMapNodeCondition_Logic.prototype.sub_conditions = $util.emptyArray;
/**
* Creates a new CMsgQuestMapNodeCondition_Logic instance using the specified properties.
* @function create
* @memberof CMsgQuestMapNodeCondition_Logic
* @static
* @param {ICMsgQuestMapNodeCondition_Logic=} [properties] Properties to set
* @returns {CMsgQuestMapNodeCondition_Logic} CMsgQuestMapNodeCondition_Logic instance
*/
CMsgQuestMapNodeCondition_Logic.create = function create(properties) {
return new CMsgQuestMapNodeCondition_Logic(properties);
};
/**
* Encodes the specified CMsgQuestMapNodeCondition_Logic message. Does not implicitly {@link CMsgQuestMapNodeCondition_Logic.verify|verify} messages.
* @function encode
* @memberof CMsgQuestMapNodeCondition_Logic
* @static
* @param {ICMsgQuestMapNodeCondition_Logic} message CMsgQuestMapNodeCondition_Logic message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapNodeCondition_Logic.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operation);
if (message.sub_conditions != null && message.sub_conditions.length)
for (var i = 0; i < message.sub_conditions.length; ++i)
$root.CMsgQuestMapNodeCondition.encode(message.sub_conditions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgQuestMapNodeCondition_Logic message, length delimited. Does not implicitly {@link CMsgQuestMapNodeCondition_Logic.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestMapNodeCondition_Logic
* @static
* @param {ICMsgQuestMapNodeCondition_Logic} message CMsgQuestMapNodeCondition_Logic message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapNodeCondition_Logic.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestMapNodeCondition_Logic message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestMapNodeCondition_Logic
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestMapNodeCondition_Logic} CMsgQuestMapNodeCondition_Logic
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapNodeCondition_Logic.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestMapNodeCondition_Logic();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.operation = reader.int32();
break;
case 2:
if (!(message.sub_conditions && message.sub_conditions.length))
message.sub_conditions = [];
message.sub_conditions.push($root.CMsgQuestMapNodeCondition.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("operation"))
throw $util.ProtocolError("missing required 'operation'", { instance: message });
return message;
};
/**
* Decodes a CMsgQuestMapNodeCondition_Logic message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestMapNodeCondition_Logic
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestMapNodeCondition_Logic} CMsgQuestMapNodeCondition_Logic
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapNodeCondition_Logic.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestMapNodeCondition_Logic message.
* @function verify
* @memberof CMsgQuestMapNodeCondition_Logic
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestMapNodeCondition_Logic.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
switch (message.operation) {
default:
return "operation: enum value expected";
case 0:
case 1:
case 2:
break;
}
if (message.sub_conditions != null && message.hasOwnProperty("sub_conditions")) {
if (!Array.isArray(message.sub_conditions))
return "sub_conditions: array expected";
for (var i = 0; i < message.sub_conditions.length; ++i) {
var error = $root.CMsgQuestMapNodeCondition.verify(message.sub_conditions[i]);
if (error)
return "sub_conditions." + error;
}
}
return null;
};
/**
* Creates a CMsgQuestMapNodeCondition_Logic message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestMapNodeCondition_Logic
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestMapNodeCondition_Logic} CMsgQuestMapNodeCondition_Logic
*/
CMsgQuestMapNodeCondition_Logic.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestMapNodeCondition_Logic)
return object;
var message = new $root.CMsgQuestMapNodeCondition_Logic();
switch (object.operation) {
case "AND":
case 0:
message.operation = 0;
break;
case "OR":
case 1:
message.operation = 1;
break;
case "NOT":
case 2:
message.operation = 2;
break;
}
if (object.sub_conditions) {
if (!Array.isArray(object.sub_conditions))
throw TypeError(".CMsgQuestMapNodeCondition_Logic.sub_conditions: array expected");
message.sub_conditions = [];
for (var i = 0; i < object.sub_conditions.length; ++i) {
if (typeof object.sub_conditions[i] !== "object")
throw TypeError(".CMsgQuestMapNodeCondition_Logic.sub_conditions: object expected");
message.sub_conditions[i] = $root.CMsgQuestMapNodeCondition.fromObject(object.sub_conditions[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgQuestMapNodeCondition_Logic message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestMapNodeCondition_Logic
* @static
* @param {CMsgQuestMapNodeCondition_Logic} message CMsgQuestMapNodeCondition_Logic
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestMapNodeCondition_Logic.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.sub_conditions = [];
if (options.defaults)
object.operation = options.enums === String ? "AND" : 0;
if (message.operation != null && message.hasOwnProperty("operation"))
object.operation = options.enums === String ? $root.LogicalOperation[message.operation] : message.operation;
if (message.sub_conditions && message.sub_conditions.length) {
object.sub_conditions = [];
for (var j = 0; j < message.sub_conditions.length; ++j)
object.sub_conditions[j] = $root.CMsgQuestMapNodeCondition.toObject(message.sub_conditions[j], options);
}
return object;
};
/**
* Converts this CMsgQuestMapNodeCondition_Logic to JSON.
* @function toJSON
* @memberof CMsgQuestMapNodeCondition_Logic
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestMapNodeCondition_Logic.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgQuestMapNodeCondition_Logic;
})();
$root.CMsgQuestMapNodeCondition = (function() {
/**
* Properties of a CMsgQuestMapNodeCondition.
* @exports ICMsgQuestMapNodeCondition
* @interface ICMsgQuestMapNodeCondition
* @property {ICMsgQuestMapNodeCondition_NodeState|null} [node_state] CMsgQuestMapNodeCondition node_state
* @property {ICMsgQuestMapNodeCondition_Logic|null} [logical] CMsgQuestMapNodeCondition logical
*/
/**
* Constructs a new CMsgQuestMapNodeCondition.
* @exports CMsgQuestMapNodeCondition
* @classdesc Represents a CMsgQuestMapNodeCondition.
* @implements ICMsgQuestMapNodeCondition
* @constructor
* @param {ICMsgQuestMapNodeCondition=} [properties] Properties to set
*/
function CMsgQuestMapNodeCondition(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]];
}
/**
* CMsgQuestMapNodeCondition node_state.
* @member {ICMsgQuestMapNodeCondition_NodeState|null|undefined} node_state
* @memberof CMsgQuestMapNodeCondition
* @instance
*/
CMsgQuestMapNodeCondition.prototype.node_state = null;
/**
* CMsgQuestMapNodeCondition logical.
* @member {ICMsgQuestMapNodeCondition_Logic|null|undefined} logical
* @memberof CMsgQuestMapNodeCondition
* @instance
*/
CMsgQuestMapNodeCondition.prototype.logical = null;
// OneOf field names bound to virtual getters and setters
var $oneOfFields;
/**
* CMsgQuestMapNodeCondition operation.
* @member {"node_state"|"logical"|undefined} operation
* @memberof CMsgQuestMapNodeCondition
* @instance
*/
Object.defineProperty(CMsgQuestMapNodeCondition.prototype, "operation", {
get: $util.oneOfGetter($oneOfFields = ["node_state", "logical"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Creates a new CMsgQuestMapNodeCondition instance using the specified properties.
* @function create
* @memberof CMsgQuestMapNodeCondition
* @static
* @param {ICMsgQuestMapNodeCondition=} [properties] Properties to set
* @returns {CMsgQuestMapNodeCondition} CMsgQuestMapNodeCondition instance
*/
CMsgQuestMapNodeCondition.create = function create(properties) {
return new CMsgQuestMapNodeCondition(properties);
};
/**
* Encodes the specified CMsgQuestMapNodeCondition message. Does not implicitly {@link CMsgQuestMapNodeCondition.verify|verify} messages.
* @function encode
* @memberof CMsgQuestMapNodeCondition
* @static
* @param {ICMsgQuestMapNodeCondition} message CMsgQuestMapNodeCondition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapNodeCondition.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.node_state != null && message.hasOwnProperty("node_state"))
$root.CMsgQuestMapNodeCondition_NodeState.encode(message.node_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.logical != null && message.hasOwnProperty("logical"))
$root.CMsgQuestMapNodeCondition_Logic.encode(message.logical, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgQuestMapNodeCondition message, length delimited. Does not implicitly {@link CMsgQuestMapNodeCondition.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgQuestMapNodeCondition
* @static
* @param {ICMsgQuestMapNodeCondition} message CMsgQuestMapNodeCondition message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgQuestMapNodeCondition.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgQuestMapNodeCondition message from the specified reader or buffer.
* @function decode
* @memberof CMsgQuestMapNodeCondition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgQuestMapNodeCondition} CMsgQuestMapNodeCondition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapNodeCondition.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgQuestMapNodeCondition();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.node_state = $root.CMsgQuestMapNodeCondition_NodeState.decode(reader, reader.uint32());
break;
case 2:
message.logical = $root.CMsgQuestMapNodeCondition_Logic.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgQuestMapNodeCondition message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgQuestMapNodeCondition
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgQuestMapNodeCondition} CMsgQuestMapNodeCondition
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgQuestMapNodeCondition.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgQuestMapNodeCondition message.
* @function verify
* @memberof CMsgQuestMapNodeCondition
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgQuestMapNodeCondition.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
var properties = {};
if (message.node_state != null && message.hasOwnProperty("node_state")) {
properties.operation = 1;
{
var error = $root.CMsgQuestMapNodeCondition_NodeState.verify(message.node_state);
if (error)
return "node_state." + error;
}
}
if (message.logical != null && message.hasOwnProperty("logical")) {
if (properties.operation === 1)
return "operation: multiple values";
properties.operation = 1;
{
var error = $root.CMsgQuestMapNodeCondition_Logic.verify(message.logical);
if (error)
return "logical." + error;
}
}
return null;
};
/**
* Creates a CMsgQuestMapNodeCondition message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgQuestMapNodeCondition
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgQuestMapNodeCondition} CMsgQuestMapNodeCondition
*/
CMsgQuestMapNodeCondition.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgQuestMapNodeCondition)
return object;
var message = new $root.CMsgQuestMapNodeCondition();
if (object.node_state != null) {
if (typeof object.node_state !== "object")
throw TypeError(".CMsgQuestMapNodeCondition.node_state: object expected");
message.node_state = $root.CMsgQuestMapNodeCondition_NodeState.fromObject(object.node_state);
}
if (object.logical != null) {
if (typeof object.logical !== "object")
throw TypeError(".CMsgQuestMapNodeCondition.logical: object expected");
message.logical = $root.CMsgQuestMapNodeCondition_Logic.fromObject(object.logical);
}
return message;
};
/**
* Creates a plain object from a CMsgQuestMapNodeCondition message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgQuestMapNodeCondition
* @static
* @param {CMsgQuestMapNodeCondition} message CMsgQuestMapNodeCondition
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgQuestMapNodeCondition.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (message.node_state != null && message.hasOwnProperty("node_state")) {
object.node_state = $root.CMsgQuestMapNodeCondition_NodeState.toObject(message.node_state, options);
if (options.oneofs)
object.operation = "node_state";
}
if (message.logical != null && message.hasOwnProperty("logical")) {
object.logical = $root.CMsgQuestMapNodeCondition_Logic.toObject(message.logical, options);
if (options.oneofs)
object.operation = "logical";
}
return object;
};
/**
* Converts this CMsgQuestMapNodeCondition to JSON.
* @function toJSON
* @memberof CMsgQuestMapNodeCondition
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgQuestMapNodeCondition.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgQuestMapNodeCondition;
})();
$root.CMsgHeaderOnly = (function() {
/**
* Properties of a CMsgHeaderOnly.
* @exports ICMsgHeaderOnly
* @interface ICMsgHeaderOnly
* @property {ICMsgProtoDefHeader} header CMsgHeaderOnly header
*/
/**
* Constructs a new CMsgHeaderOnly.
* @exports CMsgHeaderOnly
* @classdesc Represents a CMsgHeaderOnly.
* @implements ICMsgHeaderOnly
* @constructor
* @param {ICMsgHeaderOnly=} [properties] Properties to set
*/
function CMsgHeaderOnly(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]];
}
/**
* CMsgHeaderOnly header.
* @member {ICMsgProtoDefHeader} header
* @memberof CMsgHeaderOnly
* @instance
*/
CMsgHeaderOnly.prototype.header = null;
/**
* Creates a new CMsgHeaderOnly instance using the specified properties.
* @function create
* @memberof CMsgHeaderOnly
* @static
* @param {ICMsgHeaderOnly=} [properties] Properties to set
* @returns {CMsgHeaderOnly} CMsgHeaderOnly instance
*/
CMsgHeaderOnly.create = function create(properties) {
return new CMsgHeaderOnly(properties);
};
/**
* Encodes the specified CMsgHeaderOnly message. Does not implicitly {@link CMsgHeaderOnly.verify|verify} messages.
* @function encode
* @memberof CMsgHeaderOnly
* @static
* @param {ICMsgHeaderOnly} message CMsgHeaderOnly message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgHeaderOnly.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
$root.CMsgProtoDefHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgHeaderOnly message, length delimited. Does not implicitly {@link CMsgHeaderOnly.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgHeaderOnly
* @static
* @param {ICMsgHeaderOnly} message CMsgHeaderOnly message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgHeaderOnly.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgHeaderOnly message from the specified reader or buffer.
* @function decode
* @memberof CMsgHeaderOnly
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgHeaderOnly} CMsgHeaderOnly
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgHeaderOnly.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgHeaderOnly();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = $root.CMsgProtoDefHeader.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("header"))
throw $util.ProtocolError("missing required 'header'", { instance: message });
return message;
};
/**
* Decodes a CMsgHeaderOnly message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgHeaderOnly
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgHeaderOnly} CMsgHeaderOnly
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgHeaderOnly.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgHeaderOnly message.
* @function verify
* @memberof CMsgHeaderOnly
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgHeaderOnly.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
{
var error = $root.CMsgProtoDefHeader.verify(message.header);
if (error)
return "header." + error;
}
return null;
};
/**
* Creates a CMsgHeaderOnly message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgHeaderOnly
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgHeaderOnly} CMsgHeaderOnly
*/
CMsgHeaderOnly.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgHeaderOnly)
return object;
var message = new $root.CMsgHeaderOnly();
if (object.header != null) {
if (typeof object.header !== "object")
throw TypeError(".CMsgHeaderOnly.header: object expected");
message.header = $root.CMsgProtoDefHeader.fromObject(object.header);
}
return message;
};
/**
* Creates a plain object from a CMsgHeaderOnly message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgHeaderOnly
* @static
* @param {CMsgHeaderOnly} message CMsgHeaderOnly
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgHeaderOnly.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.header = null;
if (message.header != null && message.hasOwnProperty("header"))
object.header = $root.CMsgProtoDefHeader.toObject(message.header, options);
return object;
};
/**
* Converts this CMsgHeaderOnly to JSON.
* @function toJSON
* @memberof CMsgHeaderOnly
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgHeaderOnly.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgHeaderOnly;
})();
$root.google = (function() {
/**
* Namespace google.
* @exports google
* @namespace
*/
var google = {};
google.protobuf = (function() {
/**
* Namespace protobuf.
* @memberof google
* @namespace
*/
var protobuf = {};
protobuf.FileDescriptorSet = (function() {
/**
* Properties of a FileDescriptorSet.
* @memberof google.protobuf
* @interface IFileDescriptorSet
* @property {Array.<google.protobuf.IFileDescriptorProto>|null} [file] FileDescriptorSet file
*/
/**
* Constructs a new FileDescriptorSet.
* @memberof google.protobuf
* @classdesc Represents a FileDescriptorSet.
* @implements IFileDescriptorSet
* @constructor
* @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
*/
function FileDescriptorSet(properties) {
this.file = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* FileDescriptorSet file.
* @member {Array.<google.protobuf.IFileDescriptorProto>} file
* @memberof google.protobuf.FileDescriptorSet
* @instance
*/
FileDescriptorSet.prototype.file = $util.emptyArray;
/**
* Creates a new FileDescriptorSet instance using the specified properties.
* @function create
* @memberof google.protobuf.FileDescriptorSet
* @static
* @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
* @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance
*/
FileDescriptorSet.create = function create(properties) {
return new FileDescriptorSet(properties);
};
/**
* Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
* @function encode
* @memberof google.protobuf.FileDescriptorSet
* @static
* @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FileDescriptorSet.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.file != null && message.file.length)
for (var i = 0; i < message.file.length; ++i)
$root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.FileDescriptorSet
* @static
* @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a FileDescriptorSet message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.FileDescriptorSet
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FileDescriptorSet.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.file && message.file.length))
message.file = [];
message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.FileDescriptorSet
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a FileDescriptorSet message.
* @function verify
* @memberof google.protobuf.FileDescriptorSet
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
FileDescriptorSet.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.file != null && message.hasOwnProperty("file")) {
if (!Array.isArray(message.file))
return "file: array expected";
for (var i = 0; i < message.file.length; ++i) {
var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]);
if (error)
return "file." + error;
}
}
return null;
};
/**
* Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.FileDescriptorSet
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
*/
FileDescriptorSet.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.FileDescriptorSet)
return object;
var message = new $root.google.protobuf.FileDescriptorSet();
if (object.file) {
if (!Array.isArray(object.file))
throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected");
message.file = [];
for (var i = 0; i < object.file.length; ++i) {
if (typeof object.file[i] !== "object")
throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected");
message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]);
}
}
return message;
};
/**
* Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.FileDescriptorSet
* @static
* @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
FileDescriptorSet.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.file = [];
if (message.file && message.file.length) {
object.file = [];
for (var j = 0; j < message.file.length; ++j)
object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options);
}
return object;
};
/**
* Converts this FileDescriptorSet to JSON.
* @function toJSON
* @memberof google.protobuf.FileDescriptorSet
* @instance
* @returns {Object.<string,*>} JSON object
*/
FileDescriptorSet.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return FileDescriptorSet;
})();
protobuf.FileDescriptorProto = (function() {
/**
* Properties of a FileDescriptorProto.
* @memberof google.protobuf
* @interface IFileDescriptorProto
* @property {string|null} [name] FileDescriptorProto name
* @property {string|null} ["package"] FileDescriptorProto package
* @property {Array.<string>|null} [dependency] FileDescriptorProto dependency
* @property {Array.<google.protobuf.IDescriptorProto>|null} [message_type] FileDescriptorProto message_type
* @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enum_type] FileDescriptorProto enum_type
* @property {Array.<google.protobuf.IServiceDescriptorProto>|null} [service] FileDescriptorProto service
* @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] FileDescriptorProto extension
* @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options
* @property {google.protobuf.ISourceCodeInfo|null} [source_code_info] FileDescriptorProto source_code_info
*/
/**
* Constructs a new FileDescriptorProto.
* @memberof google.protobuf
* @classdesc Represents a FileDescriptorProto.
* @implements IFileDescriptorProto
* @constructor
* @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
*/
function FileDescriptorProto(properties) {
this.dependency = [];
this.message_type = [];
this.enum_type = [];
this.service = [];
this.extension = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* FileDescriptorProto name.
* @member {string} name
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype.name = "";
/**
* FileDescriptorProto package.
* @member {string} package
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype["package"] = "";
/**
* FileDescriptorProto dependency.
* @member {Array.<string>} dependency
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype.dependency = $util.emptyArray;
/**
* FileDescriptorProto message_type.
* @member {Array.<google.protobuf.IDescriptorProto>} message_type
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype.message_type = $util.emptyArray;
/**
* FileDescriptorProto enum_type.
* @member {Array.<google.protobuf.IEnumDescriptorProto>} enum_type
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype.enum_type = $util.emptyArray;
/**
* FileDescriptorProto service.
* @member {Array.<google.protobuf.IServiceDescriptorProto>} service
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype.service = $util.emptyArray;
/**
* FileDescriptorProto extension.
* @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype.extension = $util.emptyArray;
/**
* FileDescriptorProto options.
* @member {google.protobuf.IFileOptions|null|undefined} options
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype.options = null;
/**
* FileDescriptorProto source_code_info.
* @member {google.protobuf.ISourceCodeInfo|null|undefined} source_code_info
* @memberof google.protobuf.FileDescriptorProto
* @instance
*/
FileDescriptorProto.prototype.source_code_info = null;
/**
* Creates a new FileDescriptorProto instance using the specified properties.
* @function create
* @memberof google.protobuf.FileDescriptorProto
* @static
* @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
* @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance
*/
FileDescriptorProto.create = function create(properties) {
return new FileDescriptorProto(properties);
};
/**
* Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
* @function encode
* @memberof google.protobuf.FileDescriptorProto
* @static
* @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FileDescriptorProto.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message["package"] != null && message.hasOwnProperty("package"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]);
if (message.dependency != null && message.dependency.length)
for (var i = 0; i < message.dependency.length; ++i)
writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]);
if (message.message_type != null && message.message_type.length)
for (var i = 0; i < message.message_type.length; ++i)
$root.google.protobuf.DescriptorProto.encode(message.message_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.enum_type != null && message.enum_type.length)
for (var i = 0; i < message.enum_type.length; ++i)
$root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.service != null && message.service.length)
for (var i = 0; i < message.service.length; ++i)
$root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.extension != null && message.extension.length)
for (var i = 0; i < message.extension.length; ++i)
$root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.options != null && message.hasOwnProperty("options"))
$root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
if (message.source_code_info != null && message.hasOwnProperty("source_code_info"))
$root.google.protobuf.SourceCodeInfo.encode(message.source_code_info, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
return writer;
};
/**
* Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.FileDescriptorProto
* @static
* @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a FileDescriptorProto message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.FileDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FileDescriptorProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
message["package"] = reader.string();
break;
case 3:
if (!(message.dependency && message.dependency.length))
message.dependency = [];
message.dependency.push(reader.string());
break;
case 4:
if (!(message.message_type && message.message_type.length))
message.message_type = [];
message.message_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
break;
case 5:
if (!(message.enum_type && message.enum_type.length))
message.enum_type = [];
message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
break;
case 6:
if (!(message.service && message.service.length))
message.service = [];
message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32()));
break;
case 7:
if (!(message.extension && message.extension.length))
message.extension = [];
message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
break;
case 8:
message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32());
break;
case 9:
message.source_code_info = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.FileDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a FileDescriptorProto message.
* @function verify
* @memberof google.protobuf.FileDescriptorProto
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package"))
if (!$util.isString(message["package"]))
return "package: string expected";
if (message.dependency != null && message.hasOwnProperty("dependency")) {
if (!Array.isArray(message.dependency))
return "dependency: array expected";
for (var i = 0; i < message.dependency.length; ++i)
if (!$util.isString(message.dependency[i]))
return "dependency: string[] expected";
}
if (message.message_type != null && message.hasOwnProperty("message_type")) {
if (!Array.isArray(message.message_type))
return "message_type: array expected";
for (var i = 0; i < message.message_type.length; ++i) {
var error = $root.google.protobuf.DescriptorProto.verify(message.message_type[i]);
if (error)
return "message_type." + error;
}
}
if (message.enum_type != null && message.hasOwnProperty("enum_type")) {
if (!Array.isArray(message.enum_type))
return "enum_type: array expected";
for (var i = 0; i < message.enum_type.length; ++i) {
var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]);
if (error)
return "enum_type." + error;
}
}
if (message.service != null && message.hasOwnProperty("service")) {
if (!Array.isArray(message.service))
return "service: array expected";
for (var i = 0; i < message.service.length; ++i) {
var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]);
if (error)
return "service." + error;
}
}
if (message.extension != null && message.hasOwnProperty("extension")) {
if (!Array.isArray(message.extension))
return "extension: array expected";
for (var i = 0; i < message.extension.length; ++i) {
var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
if (error)
return "extension." + error;
}
}
if (message.options != null && message.hasOwnProperty("options")) {
var error = $root.google.protobuf.FileOptions.verify(message.options);
if (error)
return "options." + error;
}
if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) {
var error = $root.google.protobuf.SourceCodeInfo.verify(message.source_code_info);
if (error)
return "source_code_info." + error;
}
return null;
};
/**
* Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.FileDescriptorProto
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
*/
FileDescriptorProto.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.FileDescriptorProto)
return object;
var message = new $root.google.protobuf.FileDescriptorProto();
if (object.name != null)
message.name = String(object.name);
if (object["package"] != null)
message["package"] = String(object["package"]);
if (object.dependency) {
if (!Array.isArray(object.dependency))
throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected");
message.dependency = [];
for (var i = 0; i < object.dependency.length; ++i)
message.dependency[i] = String(object.dependency[i]);
}
if (object.message_type) {
if (!Array.isArray(object.message_type))
throw TypeError(".google.protobuf.FileDescriptorProto.message_type: array expected");
message.message_type = [];
for (var i = 0; i < object.message_type.length; ++i) {
if (typeof object.message_type[i] !== "object")
throw TypeError(".google.protobuf.FileDescriptorProto.message_type: object expected");
message.message_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.message_type[i]);
}
}
if (object.enum_type) {
if (!Array.isArray(object.enum_type))
throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: array expected");
message.enum_type = [];
for (var i = 0; i < object.enum_type.length; ++i) {
if (typeof object.enum_type[i] !== "object")
throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: object expected");
message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]);
}
}
if (object.service) {
if (!Array.isArray(object.service))
throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected");
message.service = [];
for (var i = 0; i < object.service.length; ++i) {
if (typeof object.service[i] !== "object")
throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected");
message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]);
}
}
if (object.extension) {
if (!Array.isArray(object.extension))
throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected");
message.extension = [];
for (var i = 0; i < object.extension.length; ++i) {
if (typeof object.extension[i] !== "object")
throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected");
message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
}
}
if (object.options != null) {
if (typeof object.options !== "object")
throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected");
message.options = $root.google.protobuf.FileOptions.fromObject(object.options);
}
if (object.source_code_info != null) {
if (typeof object.source_code_info !== "object")
throw TypeError(".google.protobuf.FileDescriptorProto.source_code_info: object expected");
message.source_code_info = $root.google.protobuf.SourceCodeInfo.fromObject(object.source_code_info);
}
return message;
};
/**
* Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.FileDescriptorProto
* @static
* @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
FileDescriptorProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.dependency = [];
object.message_type = [];
object.enum_type = [];
object.service = [];
object.extension = [];
}
if (options.defaults) {
object.name = "";
object["package"] = "";
object.options = null;
object.source_code_info = null;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message["package"] != null && message.hasOwnProperty("package"))
object["package"] = message["package"];
if (message.dependency && message.dependency.length) {
object.dependency = [];
for (var j = 0; j < message.dependency.length; ++j)
object.dependency[j] = message.dependency[j];
}
if (message.message_type && message.message_type.length) {
object.message_type = [];
for (var j = 0; j < message.message_type.length; ++j)
object.message_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.message_type[j], options);
}
if (message.enum_type && message.enum_type.length) {
object.enum_type = [];
for (var j = 0; j < message.enum_type.length; ++j)
object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options);
}
if (message.service && message.service.length) {
object.service = [];
for (var j = 0; j < message.service.length; ++j)
object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options);
}
if (message.extension && message.extension.length) {
object.extension = [];
for (var j = 0; j < message.extension.length; ++j)
object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
}
if (message.options != null && message.hasOwnProperty("options"))
object.options = $root.google.protobuf.FileOptions.toObject(message.options, options);
if (message.source_code_info != null && message.hasOwnProperty("source_code_info"))
object.source_code_info = $root.google.protobuf.SourceCodeInfo.toObject(message.source_code_info, options);
return object;
};
/**
* Converts this FileDescriptorProto to JSON.
* @function toJSON
* @memberof google.protobuf.FileDescriptorProto
* @instance
* @returns {Object.<string,*>} JSON object
*/
FileDescriptorProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return FileDescriptorProto;
})();
protobuf.DescriptorProto = (function() {
/**
* Properties of a DescriptorProto.
* @memberof google.protobuf
* @interface IDescriptorProto
* @property {string|null} [name] DescriptorProto name
* @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [field] DescriptorProto field
* @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] DescriptorProto extension
* @property {Array.<google.protobuf.IDescriptorProto>|null} [nested_type] DescriptorProto nested_type
* @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enum_type] DescriptorProto enum_type
* @property {Array.<google.protobuf.DescriptorProto.IExtensionRange>|null} [extension_range] DescriptorProto extension_range
* @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options
*/
/**
* Constructs a new DescriptorProto.
* @memberof google.protobuf
* @classdesc Represents a DescriptorProto.
* @implements IDescriptorProto
* @constructor
* @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
*/
function DescriptorProto(properties) {
this.field = [];
this.extension = [];
this.nested_type = [];
this.enum_type = [];
this.extension_range = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* DescriptorProto name.
* @member {string} name
* @memberof google.protobuf.DescriptorProto
* @instance
*/
DescriptorProto.prototype.name = "";
/**
* DescriptorProto field.
* @member {Array.<google.protobuf.IFieldDescriptorProto>} field
* @memberof google.protobuf.DescriptorProto
* @instance
*/
DescriptorProto.prototype.field = $util.emptyArray;
/**
* DescriptorProto extension.
* @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
* @memberof google.protobuf.DescriptorProto
* @instance
*/
DescriptorProto.prototype.extension = $util.emptyArray;
/**
* DescriptorProto nested_type.
* @member {Array.<google.protobuf.IDescriptorProto>} nested_type
* @memberof google.protobuf.DescriptorProto
* @instance
*/
DescriptorProto.prototype.nested_type = $util.emptyArray;
/**
* DescriptorProto enum_type.
* @member {Array.<google.protobuf.IEnumDescriptorProto>} enum_type
* @memberof google.protobuf.DescriptorProto
* @instance
*/
DescriptorProto.prototype.enum_type = $util.emptyArray;
/**
* DescriptorProto extension_range.
* @member {Array.<google.protobuf.DescriptorProto.IExtensionRange>} extension_range
* @memberof google.protobuf.DescriptorProto
* @instance
*/
DescriptorProto.prototype.extension_range = $util.emptyArray;
/**
* DescriptorProto options.
* @member {google.protobuf.IMessageOptions|null|undefined} options
* @memberof google.protobuf.DescriptorProto
* @instance
*/
DescriptorProto.prototype.options = null;
/**
* Creates a new DescriptorProto instance using the specified properties.
* @function create
* @memberof google.protobuf.DescriptorProto
* @static
* @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
* @returns {google.protobuf.DescriptorProto} DescriptorProto instance
*/
DescriptorProto.create = function create(properties) {
return new DescriptorProto(properties);
};
/**
* Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
* @function encode
* @memberof google.protobuf.DescriptorProto
* @static
* @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DescriptorProto.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.field != null && message.field.length)
for (var i = 0; i < message.field.length; ++i)
$root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.nested_type != null && message.nested_type.length)
for (var i = 0; i < message.nested_type.length; ++i)
$root.google.protobuf.DescriptorProto.encode(message.nested_type[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.enum_type != null && message.enum_type.length)
for (var i = 0; i < message.enum_type.length; ++i)
$root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.extension_range != null && message.extension_range.length)
for (var i = 0; i < message.extension_range.length; ++i)
$root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extension_range[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.extension != null && message.extension.length)
for (var i = 0; i < message.extension.length; ++i)
$root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.options != null && message.hasOwnProperty("options"))
$root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
return writer;
};
/**
* Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.DescriptorProto
* @static
* @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a DescriptorProto message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.DescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.DescriptorProto} DescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DescriptorProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
if (!(message.field && message.field.length))
message.field = [];
message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
break;
case 6:
if (!(message.extension && message.extension.length))
message.extension = [];
message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
break;
case 3:
if (!(message.nested_type && message.nested_type.length))
message.nested_type = [];
message.nested_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
break;
case 4:
if (!(message.enum_type && message.enum_type.length))
message.enum_type = [];
message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
break;
case 5:
if (!(message.extension_range && message.extension_range.length))
message.extension_range = [];
message.extension_range.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32()));
break;
case 7:
message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a DescriptorProto message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.DescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.DescriptorProto} DescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DescriptorProto.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a DescriptorProto message.
* @function verify
* @memberof google.protobuf.DescriptorProto
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
DescriptorProto.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.field != null && message.hasOwnProperty("field")) {
if (!Array.isArray(message.field))
return "field: array expected";
for (var i = 0; i < message.field.length; ++i) {
var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]);
if (error)
return "field." + error;
}
}
if (message.extension != null && message.hasOwnProperty("extension")) {
if (!Array.isArray(message.extension))
return "extension: array expected";
for (var i = 0; i < message.extension.length; ++i) {
var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
if (error)
return "extension." + error;
}
}
if (message.nested_type != null && message.hasOwnProperty("nested_type")) {
if (!Array.isArray(message.nested_type))
return "nested_type: array expected";
for (var i = 0; i < message.nested_type.length; ++i) {
var error = $root.google.protobuf.DescriptorProto.verify(message.nested_type[i]);
if (error)
return "nested_type." + error;
}
}
if (message.enum_type != null && message.hasOwnProperty("enum_type")) {
if (!Array.isArray(message.enum_type))
return "enum_type: array expected";
for (var i = 0; i < message.enum_type.length; ++i) {
var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]);
if (error)
return "enum_type." + error;
}
}
if (message.extension_range != null && message.hasOwnProperty("extension_range")) {
if (!Array.isArray(message.extension_range))
return "extension_range: array expected";
for (var i = 0; i < message.extension_range.length; ++i) {
var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extension_range[i]);
if (error)
return "extension_range." + error;
}
}
if (message.options != null && message.hasOwnProperty("options")) {
var error = $root.google.protobuf.MessageOptions.verify(message.options);
if (error)
return "options." + error;
}
return null;
};
/**
* Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.DescriptorProto
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.DescriptorProto} DescriptorProto
*/
DescriptorProto.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.DescriptorProto)
return object;
var message = new $root.google.protobuf.DescriptorProto();
if (object.name != null)
message.name = String(object.name);
if (object.field) {
if (!Array.isArray(object.field))
throw TypeError(".google.protobuf.DescriptorProto.field: array expected");
message.field = [];
for (var i = 0; i < object.field.length; ++i) {
if (typeof object.field[i] !== "object")
throw TypeError(".google.protobuf.DescriptorProto.field: object expected");
message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]);
}
}
if (object.extension) {
if (!Array.isArray(object.extension))
throw TypeError(".google.protobuf.DescriptorProto.extension: array expected");
message.extension = [];
for (var i = 0; i < object.extension.length; ++i) {
if (typeof object.extension[i] !== "object")
throw TypeError(".google.protobuf.DescriptorProto.extension: object expected");
message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
}
}
if (object.nested_type) {
if (!Array.isArray(object.nested_type))
throw TypeError(".google.protobuf.DescriptorProto.nested_type: array expected");
message.nested_type = [];
for (var i = 0; i < object.nested_type.length; ++i) {
if (typeof object.nested_type[i] !== "object")
throw TypeError(".google.protobuf.DescriptorProto.nested_type: object expected");
message.nested_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nested_type[i]);
}
}
if (object.enum_type) {
if (!Array.isArray(object.enum_type))
throw TypeError(".google.protobuf.DescriptorProto.enum_type: array expected");
message.enum_type = [];
for (var i = 0; i < object.enum_type.length; ++i) {
if (typeof object.enum_type[i] !== "object")
throw TypeError(".google.protobuf.DescriptorProto.enum_type: object expected");
message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]);
}
}
if (object.extension_range) {
if (!Array.isArray(object.extension_range))
throw TypeError(".google.protobuf.DescriptorProto.extension_range: array expected");
message.extension_range = [];
for (var i = 0; i < object.extension_range.length; ++i) {
if (typeof object.extension_range[i] !== "object")
throw TypeError(".google.protobuf.DescriptorProto.extension_range: object expected");
message.extension_range[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extension_range[i]);
}
}
if (object.options != null) {
if (typeof object.options !== "object")
throw TypeError(".google.protobuf.DescriptorProto.options: object expected");
message.options = $root.google.protobuf.MessageOptions.fromObject(object.options);
}
return message;
};
/**
* Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.DescriptorProto
* @static
* @param {google.protobuf.DescriptorProto} message DescriptorProto
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
DescriptorProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.field = [];
object.nested_type = [];
object.enum_type = [];
object.extension_range = [];
object.extension = [];
}
if (options.defaults) {
object.name = "";
object.options = null;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.field && message.field.length) {
object.field = [];
for (var j = 0; j < message.field.length; ++j)
object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options);
}
if (message.nested_type && message.nested_type.length) {
object.nested_type = [];
for (var j = 0; j < message.nested_type.length; ++j)
object.nested_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.nested_type[j], options);
}
if (message.enum_type && message.enum_type.length) {
object.enum_type = [];
for (var j = 0; j < message.enum_type.length; ++j)
object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options);
}
if (message.extension_range && message.extension_range.length) {
object.extension_range = [];
for (var j = 0; j < message.extension_range.length; ++j)
object.extension_range[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extension_range[j], options);
}
if (message.extension && message.extension.length) {
object.extension = [];
for (var j = 0; j < message.extension.length; ++j)
object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
}
if (message.options != null && message.hasOwnProperty("options"))
object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options);
return object;
};
/**
* Converts this DescriptorProto to JSON.
* @function toJSON
* @memberof google.protobuf.DescriptorProto
* @instance
* @returns {Object.<string,*>} JSON object
*/
DescriptorProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
DescriptorProto.ExtensionRange = (function() {
/**
* Properties of an ExtensionRange.
* @memberof google.protobuf.DescriptorProto
* @interface IExtensionRange
* @property {number|null} [start] ExtensionRange start
* @property {number|null} [end] ExtensionRange end
*/
/**
* Constructs a new ExtensionRange.
* @memberof google.protobuf.DescriptorProto
* @classdesc Represents an ExtensionRange.
* @implements IExtensionRange
* @constructor
* @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
*/
function ExtensionRange(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]];
}
/**
* ExtensionRange start.
* @member {number} start
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @instance
*/
ExtensionRange.prototype.start = 0;
/**
* ExtensionRange end.
* @member {number} end
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @instance
*/
ExtensionRange.prototype.end = 0;
/**
* Creates a new ExtensionRange instance using the specified properties.
* @function create
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @static
* @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
* @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance
*/
ExtensionRange.create = function create(properties) {
return new ExtensionRange(properties);
};
/**
* Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
* @function encode
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @static
* @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ExtensionRange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.start != null && message.hasOwnProperty("start"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
if (message.end != null && message.hasOwnProperty("end"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
return writer;
};
/**
* Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @static
* @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ExtensionRange message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ExtensionRange.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.start = reader.int32();
break;
case 2:
message.end = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ExtensionRange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ExtensionRange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ExtensionRange message.
* @function verify
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ExtensionRange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.start != null && message.hasOwnProperty("start"))
if (!$util.isInteger(message.start))
return "start: integer expected";
if (message.end != null && message.hasOwnProperty("end"))
if (!$util.isInteger(message.end))
return "end: integer expected";
return null;
};
/**
* Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
*/
ExtensionRange.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange)
return object;
var message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
if (object.start != null)
message.start = object.start | 0;
if (object.end != null)
message.end = object.end | 0;
return message;
};
/**
* Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @static
* @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ExtensionRange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.start = 0;
object.end = 0;
}
if (message.start != null && message.hasOwnProperty("start"))
object.start = message.start;
if (message.end != null && message.hasOwnProperty("end"))
object.end = message.end;
return object;
};
/**
* Converts this ExtensionRange to JSON.
* @function toJSON
* @memberof google.protobuf.DescriptorProto.ExtensionRange
* @instance
* @returns {Object.<string,*>} JSON object
*/
ExtensionRange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return ExtensionRange;
})();
return DescriptorProto;
})();
protobuf.FieldDescriptorProto = (function() {
/**
* Properties of a FieldDescriptorProto.
* @memberof google.protobuf
* @interface IFieldDescriptorProto
* @property {string|null} [name] FieldDescriptorProto name
* @property {number|null} [number] FieldDescriptorProto number
* @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label
* @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type
* @property {string|null} [type_name] FieldDescriptorProto type_name
* @property {string|null} [extendee] FieldDescriptorProto extendee
* @property {string|null} [default_value] FieldDescriptorProto default_value
* @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options
*/
/**
* Constructs a new FieldDescriptorProto.
* @memberof google.protobuf
* @classdesc Represents a FieldDescriptorProto.
* @implements IFieldDescriptorProto
* @constructor
* @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
*/
function FieldDescriptorProto(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]];
}
/**
* FieldDescriptorProto name.
* @member {string} name
* @memberof google.protobuf.FieldDescriptorProto
* @instance
*/
FieldDescriptorProto.prototype.name = "";
/**
* FieldDescriptorProto number.
* @member {number} number
* @memberof google.protobuf.FieldDescriptorProto
* @instance
*/
FieldDescriptorProto.prototype.number = 0;
/**
* FieldDescriptorProto label.
* @member {google.protobuf.FieldDescriptorProto.Label} label
* @memberof google.protobuf.FieldDescriptorProto
* @instance
*/
FieldDescriptorProto.prototype.label = 1;
/**
* FieldDescriptorProto type.
* @member {google.protobuf.FieldDescriptorProto.Type} type
* @memberof google.protobuf.FieldDescriptorProto
* @instance
*/
FieldDescriptorProto.prototype.type = 1;
/**
* FieldDescriptorProto type_name.
* @member {string} type_name
* @memberof google.protobuf.FieldDescriptorProto
* @instance
*/
FieldDescriptorProto.prototype.type_name = "";
/**
* FieldDescriptorProto extendee.
* @member {string} extendee
* @memberof google.protobuf.FieldDescriptorProto
* @instance
*/
FieldDescriptorProto.prototype.extendee = "";
/**
* FieldDescriptorProto default_value.
* @member {string} default_value
* @memberof google.protobuf.FieldDescriptorProto
* @instance
*/
FieldDescriptorProto.prototype.default_value = "";
/**
* FieldDescriptorProto options.
* @member {google.protobuf.IFieldOptions|null|undefined} options
* @memberof google.protobuf.FieldDescriptorProto
* @instance
*/
FieldDescriptorProto.prototype.options = null;
/**
* Creates a new FieldDescriptorProto instance using the specified properties.
* @function create
* @memberof google.protobuf.FieldDescriptorProto
* @static
* @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
* @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance
*/
FieldDescriptorProto.create = function create(properties) {
return new FieldDescriptorProto(properties);
};
/**
* Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
* @function encode
* @memberof google.protobuf.FieldDescriptorProto
* @static
* @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FieldDescriptorProto.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.extendee != null && message.hasOwnProperty("extendee"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee);
if (message.number != null && message.hasOwnProperty("number"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number);
if (message.label != null && message.hasOwnProperty("label"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label);
if (message.type != null && message.hasOwnProperty("type"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);
if (message.type_name != null && message.hasOwnProperty("type_name"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.type_name);
if (message.default_value != null && message.hasOwnProperty("default_value"))
writer.uint32(/* id 7, wireType 2 =*/58).string(message.default_value);
if (message.options != null && message.hasOwnProperty("options"))
$root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
return writer;
};
/**
* Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.FieldDescriptorProto
* @static
* @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a FieldDescriptorProto message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.FieldDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FieldDescriptorProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 3:
message.number = reader.int32();
break;
case 4:
message.label = reader.int32();
break;
case 5:
message.type = reader.int32();
break;
case 6:
message.type_name = reader.string();
break;
case 2:
message.extendee = reader.string();
break;
case 7:
message.default_value = reader.string();
break;
case 8:
message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.FieldDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a FieldDescriptorProto message.
* @function verify
* @memberof google.protobuf.FieldDescriptorProto
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
FieldDescriptorProto.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.number != null && message.hasOwnProperty("number"))
if (!$util.isInteger(message.number))
return "number: integer expected";
if (message.label != null && message.hasOwnProperty("label"))
switch (message.label) {
default:
return "label: enum value expected";
case 1:
case 2:
case 3:
break;
}
if (message.type != null && message.hasOwnProperty("type"))
switch (message.type) {
default:
return "type: enum value expected";
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
break;
}
if (message.type_name != null && message.hasOwnProperty("type_name"))
if (!$util.isString(message.type_name))
return "type_name: string expected";
if (message.extendee != null && message.hasOwnProperty("extendee"))
if (!$util.isString(message.extendee))
return "extendee: string expected";
if (message.default_value != null && message.hasOwnProperty("default_value"))
if (!$util.isString(message.default_value))
return "default_value: string expected";
if (message.options != null && message.hasOwnProperty("options")) {
var error = $root.google.protobuf.FieldOptions.verify(message.options);
if (error)
return "options." + error;
}
return null;
};
/**
* Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.FieldDescriptorProto
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
*/
FieldDescriptorProto.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.FieldDescriptorProto)
return object;
var message = new $root.google.protobuf.FieldDescriptorProto();
if (object.name != null)
message.name = String(object.name);
if (object.number != null)
message.number = object.number | 0;
switch (object.label) {
case "LABEL_OPTIONAL":
case 1:
message.label = 1;
break;
case "LABEL_REQUIRED":
case 2:
message.label = 2;
break;
case "LABEL_REPEATED":
case 3:
message.label = 3;
break;
}
switch (object.type) {
case "TYPE_DOUBLE":
case 1:
message.type = 1;
break;
case "TYPE_FLOAT":
case 2:
message.type = 2;
break;
case "TYPE_INT64":
case 3:
message.type = 3;
break;
case "TYPE_UINT64":
case 4:
message.type = 4;
break;
case "TYPE_INT32":
case 5:
message.type = 5;
break;
case "TYPE_FIXED64":
case 6:
message.type = 6;
break;
case "TYPE_FIXED32":
case 7:
message.type = 7;
break;
case "TYPE_BOOL":
case 8:
message.type = 8;
break;
case "TYPE_STRING":
case 9:
message.type = 9;
break;
case "TYPE_GROUP":
case 10:
message.type = 10;
break;
case "TYPE_MESSAGE":
case 11:
message.type = 11;
break;
case "TYPE_BYTES":
case 12:
message.type = 12;
break;
case "TYPE_UINT32":
case 13:
message.type = 13;
break;
case "TYPE_ENUM":
case 14:
message.type = 14;
break;
case "TYPE_SFIXED32":
case 15:
message.type = 15;
break;
case "TYPE_SFIXED64":
case 16:
message.type = 16;
break;
case "TYPE_SINT32":
case 17:
message.type = 17;
break;
case "TYPE_SINT64":
case 18:
message.type = 18;
break;
}
if (object.type_name != null)
message.type_name = String(object.type_name);
if (object.extendee != null)
message.extendee = String(object.extendee);
if (object.default_value != null)
message.default_value = String(object.default_value);
if (object.options != null) {
if (typeof object.options !== "object")
throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");
message.options = $root.google.protobuf.FieldOptions.fromObject(object.options);
}
return message;
};
/**
* Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.FieldDescriptorProto
* @static
* @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
FieldDescriptorProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.name = "";
object.extendee = "";
object.number = 0;
object.label = options.enums === String ? "LABEL_OPTIONAL" : 1;
object.type = options.enums === String ? "TYPE_DOUBLE" : 1;
object.type_name = "";
object.default_value = "";
object.options = null;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.extendee != null && message.hasOwnProperty("extendee"))
object.extendee = message.extendee;
if (message.number != null && message.hasOwnProperty("number"))
object.number = message.number;
if (message.label != null && message.hasOwnProperty("label"))
object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label;
if (message.type != null && message.hasOwnProperty("type"))
object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type;
if (message.type_name != null && message.hasOwnProperty("type_name"))
object.type_name = message.type_name;
if (message.default_value != null && message.hasOwnProperty("default_value"))
object.default_value = message.default_value;
if (message.options != null && message.hasOwnProperty("options"))
object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options);
return object;
};
/**
* Converts this FieldDescriptorProto to JSON.
* @function toJSON
* @memberof google.protobuf.FieldDescriptorProto
* @instance
* @returns {Object.<string,*>} JSON object
*/
FieldDescriptorProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Type enum.
* @name google.protobuf.FieldDescriptorProto.Type
* @enum {string}
* @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value
* @property {number} TYPE_FLOAT=2 TYPE_FLOAT value
* @property {number} TYPE_INT64=3 TYPE_INT64 value
* @property {number} TYPE_UINT64=4 TYPE_UINT64 value
* @property {number} TYPE_INT32=5 TYPE_INT32 value
* @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value
* @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value
* @property {number} TYPE_BOOL=8 TYPE_BOOL value
* @property {number} TYPE_STRING=9 TYPE_STRING value
* @property {number} TYPE_GROUP=10 TYPE_GROUP value
* @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value
* @property {number} TYPE_BYTES=12 TYPE_BYTES value
* @property {number} TYPE_UINT32=13 TYPE_UINT32 value
* @property {number} TYPE_ENUM=14 TYPE_ENUM value
* @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value
* @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value
* @property {number} TYPE_SINT32=17 TYPE_SINT32 value
* @property {number} TYPE_SINT64=18 TYPE_SINT64 value
*/
FieldDescriptorProto.Type = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "TYPE_DOUBLE"] = 1;
values[valuesById[2] = "TYPE_FLOAT"] = 2;
values[valuesById[3] = "TYPE_INT64"] = 3;
values[valuesById[4] = "TYPE_UINT64"] = 4;
values[valuesById[5] = "TYPE_INT32"] = 5;
values[valuesById[6] = "TYPE_FIXED64"] = 6;
values[valuesById[7] = "TYPE_FIXED32"] = 7;
values[valuesById[8] = "TYPE_BOOL"] = 8;
values[valuesById[9] = "TYPE_STRING"] = 9;
values[valuesById[10] = "TYPE_GROUP"] = 10;
values[valuesById[11] = "TYPE_MESSAGE"] = 11;
values[valuesById[12] = "TYPE_BYTES"] = 12;
values[valuesById[13] = "TYPE_UINT32"] = 13;
values[valuesById[14] = "TYPE_ENUM"] = 14;
values[valuesById[15] = "TYPE_SFIXED32"] = 15;
values[valuesById[16] = "TYPE_SFIXED64"] = 16;
values[valuesById[17] = "TYPE_SINT32"] = 17;
values[valuesById[18] = "TYPE_SINT64"] = 18;
return values;
})();
/**
* Label enum.
* @name google.protobuf.FieldDescriptorProto.Label
* @enum {string}
* @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value
* @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value
* @property {number} LABEL_REPEATED=3 LABEL_REPEATED value
*/
FieldDescriptorProto.Label = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "LABEL_OPTIONAL"] = 1;
values[valuesById[2] = "LABEL_REQUIRED"] = 2;
values[valuesById[3] = "LABEL_REPEATED"] = 3;
return values;
})();
return FieldDescriptorProto;
})();
protobuf.EnumDescriptorProto = (function() {
/**
* Properties of an EnumDescriptorProto.
* @memberof google.protobuf
* @interface IEnumDescriptorProto
* @property {string|null} [name] EnumDescriptorProto name
* @property {Array.<google.protobuf.IEnumValueDescriptorProto>|null} [value] EnumDescriptorProto value
* @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options
*/
/**
* Constructs a new EnumDescriptorProto.
* @memberof google.protobuf
* @classdesc Represents an EnumDescriptorProto.
* @implements IEnumDescriptorProto
* @constructor
* @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
*/
function EnumDescriptorProto(properties) {
this.value = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* EnumDescriptorProto name.
* @member {string} name
* @memberof google.protobuf.EnumDescriptorProto
* @instance
*/
EnumDescriptorProto.prototype.name = "";
/**
* EnumDescriptorProto value.
* @member {Array.<google.protobuf.IEnumValueDescriptorProto>} value
* @memberof google.protobuf.EnumDescriptorProto
* @instance
*/
EnumDescriptorProto.prototype.value = $util.emptyArray;
/**
* EnumDescriptorProto options.
* @member {google.protobuf.IEnumOptions|null|undefined} options
* @memberof google.protobuf.EnumDescriptorProto
* @instance
*/
EnumDescriptorProto.prototype.options = null;
/**
* Creates a new EnumDescriptorProto instance using the specified properties.
* @function create
* @memberof google.protobuf.EnumDescriptorProto
* @static
* @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
* @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance
*/
EnumDescriptorProto.create = function create(properties) {
return new EnumDescriptorProto(properties);
};
/**
* Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
* @function encode
* @memberof google.protobuf.EnumDescriptorProto
* @static
* @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
EnumDescriptorProto.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.value != null && message.value.length)
for (var i = 0; i < message.value.length; ++i)
$root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.options != null && message.hasOwnProperty("options"))
$root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.EnumDescriptorProto
* @static
* @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EnumDescriptorProto message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.EnumDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
EnumDescriptorProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
if (!(message.value && message.value.length))
message.value = [];
message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32()));
break;
case 3:
message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.EnumDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EnumDescriptorProto message.
* @function verify
* @memberof google.protobuf.EnumDescriptorProto
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) {
if (!Array.isArray(message.value))
return "value: array expected";
for (var i = 0; i < message.value.length; ++i) {
var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]);
if (error)
return "value." + error;
}
}
if (message.options != null && message.hasOwnProperty("options")) {
var error = $root.google.protobuf.EnumOptions.verify(message.options);
if (error)
return "options." + error;
}
return null;
};
/**
* Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.EnumDescriptorProto
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
*/
EnumDescriptorProto.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.EnumDescriptorProto)
return object;
var message = new $root.google.protobuf.EnumDescriptorProto();
if (object.name != null)
message.name = String(object.name);
if (object.value) {
if (!Array.isArray(object.value))
throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected");
message.value = [];
for (var i = 0; i < object.value.length; ++i) {
if (typeof object.value[i] !== "object")
throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected");
message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]);
}
}
if (object.options != null) {
if (typeof object.options !== "object")
throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected");
message.options = $root.google.protobuf.EnumOptions.fromObject(object.options);
}
return message;
};
/**
* Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.EnumDescriptorProto
* @static
* @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EnumDescriptorProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.value = [];
if (options.defaults) {
object.name = "";
object.options = null;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.value && message.value.length) {
object.value = [];
for (var j = 0; j < message.value.length; ++j)
object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options);
}
if (message.options != null && message.hasOwnProperty("options"))
object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options);
return object;
};
/**
* Converts this EnumDescriptorProto to JSON.
* @function toJSON
* @memberof google.protobuf.EnumDescriptorProto
* @instance
* @returns {Object.<string,*>} JSON object
*/
EnumDescriptorProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return EnumDescriptorProto;
})();
protobuf.EnumValueDescriptorProto = (function() {
/**
* Properties of an EnumValueDescriptorProto.
* @memberof google.protobuf
* @interface IEnumValueDescriptorProto
* @property {string|null} [name] EnumValueDescriptorProto name
* @property {number|null} [number] EnumValueDescriptorProto number
* @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options
*/
/**
* Constructs a new EnumValueDescriptorProto.
* @memberof google.protobuf
* @classdesc Represents an EnumValueDescriptorProto.
* @implements IEnumValueDescriptorProto
* @constructor
* @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
*/
function EnumValueDescriptorProto(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]];
}
/**
* EnumValueDescriptorProto name.
* @member {string} name
* @memberof google.protobuf.EnumValueDescriptorProto
* @instance
*/
EnumValueDescriptorProto.prototype.name = "";
/**
* EnumValueDescriptorProto number.
* @member {number} number
* @memberof google.protobuf.EnumValueDescriptorProto
* @instance
*/
EnumValueDescriptorProto.prototype.number = 0;
/**
* EnumValueDescriptorProto options.
* @member {google.protobuf.IEnumValueOptions|null|undefined} options
* @memberof google.protobuf.EnumValueDescriptorProto
* @instance
*/
EnumValueDescriptorProto.prototype.options = null;
/**
* Creates a new EnumValueDescriptorProto instance using the specified properties.
* @function create
* @memberof google.protobuf.EnumValueDescriptorProto
* @static
* @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
* @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance
*/
EnumValueDescriptorProto.create = function create(properties) {
return new EnumValueDescriptorProto(properties);
};
/**
* Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
* @function encode
* @memberof google.protobuf.EnumValueDescriptorProto
* @static
* @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
EnumValueDescriptorProto.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.number != null && message.hasOwnProperty("number"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number);
if (message.options != null && message.hasOwnProperty("options"))
$root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.EnumValueDescriptorProto
* @static
* @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EnumValueDescriptorProto message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.EnumValueDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
EnumValueDescriptorProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
message.number = reader.int32();
break;
case 3:
message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.EnumValueDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EnumValueDescriptorProto message.
* @function verify
* @memberof google.protobuf.EnumValueDescriptorProto
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number"))
if (!$util.isInteger(message.number))
return "number: integer expected";
if (message.options != null && message.hasOwnProperty("options")) {
var error = $root.google.protobuf.EnumValueOptions.verify(message.options);
if (error)
return "options." + error;
}
return null;
};
/**
* Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.EnumValueDescriptorProto
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
*/
EnumValueDescriptorProto.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)
return object;
var message = new $root.google.protobuf.EnumValueDescriptorProto();
if (object.name != null)
message.name = String(object.name);
if (object.number != null)
message.number = object.number | 0;
if (object.options != null) {
if (typeof object.options !== "object")
throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");
message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options);
}
return message;
};
/**
* Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.EnumValueDescriptorProto
* @static
* @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EnumValueDescriptorProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.name = "";
object.number = 0;
object.options = null;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.number != null && message.hasOwnProperty("number"))
object.number = message.number;
if (message.options != null && message.hasOwnProperty("options"))
object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options);
return object;
};
/**
* Converts this EnumValueDescriptorProto to JSON.
* @function toJSON
* @memberof google.protobuf.EnumValueDescriptorProto
* @instance
* @returns {Object.<string,*>} JSON object
*/
EnumValueDescriptorProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return EnumValueDescriptorProto;
})();
protobuf.ServiceDescriptorProto = (function() {
/**
* Properties of a ServiceDescriptorProto.
* @memberof google.protobuf
* @interface IServiceDescriptorProto
* @property {string|null} [name] ServiceDescriptorProto name
* @property {Array.<google.protobuf.IMethodDescriptorProto>|null} [method] ServiceDescriptorProto method
* @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options
*/
/**
* Constructs a new ServiceDescriptorProto.
* @memberof google.protobuf
* @classdesc Represents a ServiceDescriptorProto.
* @implements IServiceDescriptorProto
* @constructor
* @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
*/
function ServiceDescriptorProto(properties) {
this.method = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ServiceDescriptorProto name.
* @member {string} name
* @memberof google.protobuf.ServiceDescriptorProto
* @instance
*/
ServiceDescriptorProto.prototype.name = "";
/**
* ServiceDescriptorProto method.
* @member {Array.<google.protobuf.IMethodDescriptorProto>} method
* @memberof google.protobuf.ServiceDescriptorProto
* @instance
*/
ServiceDescriptorProto.prototype.method = $util.emptyArray;
/**
* ServiceDescriptorProto options.
* @member {google.protobuf.IServiceOptions|null|undefined} options
* @memberof google.protobuf.ServiceDescriptorProto
* @instance
*/
ServiceDescriptorProto.prototype.options = null;
/**
* Creates a new ServiceDescriptorProto instance using the specified properties.
* @function create
* @memberof google.protobuf.ServiceDescriptorProto
* @static
* @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
* @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance
*/
ServiceDescriptorProto.create = function create(properties) {
return new ServiceDescriptorProto(properties);
};
/**
* Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
* @function encode
* @memberof google.protobuf.ServiceDescriptorProto
* @static
* @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ServiceDescriptorProto.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.method != null && message.method.length)
for (var i = 0; i < message.method.length; ++i)
$root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.options != null && message.hasOwnProperty("options"))
$root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.ServiceDescriptorProto
* @static
* @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ServiceDescriptorProto message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.ServiceDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ServiceDescriptorProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
if (!(message.method && message.method.length))
message.method = [];
message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32()));
break;
case 3:
message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.ServiceDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ServiceDescriptorProto message.
* @function verify
* @memberof google.protobuf.ServiceDescriptorProto
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) {
if (!Array.isArray(message.method))
return "method: array expected";
for (var i = 0; i < message.method.length; ++i) {
var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]);
if (error)
return "method." + error;
}
}
if (message.options != null && message.hasOwnProperty("options")) {
var error = $root.google.protobuf.ServiceOptions.verify(message.options);
if (error)
return "options." + error;
}
return null;
};
/**
* Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.ServiceDescriptorProto
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
*/
ServiceDescriptorProto.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.ServiceDescriptorProto)
return object;
var message = new $root.google.protobuf.ServiceDescriptorProto();
if (object.name != null)
message.name = String(object.name);
if (object.method) {
if (!Array.isArray(object.method))
throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected");
message.method = [];
for (var i = 0; i < object.method.length; ++i) {
if (typeof object.method[i] !== "object")
throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected");
message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]);
}
}
if (object.options != null) {
if (typeof object.options !== "object")
throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected");
message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options);
}
return message;
};
/**
* Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.ServiceDescriptorProto
* @static
* @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ServiceDescriptorProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.method = [];
if (options.defaults) {
object.name = "";
object.options = null;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.method && message.method.length) {
object.method = [];
for (var j = 0; j < message.method.length; ++j)
object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options);
}
if (message.options != null && message.hasOwnProperty("options"))
object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options);
return object;
};
/**
* Converts this ServiceDescriptorProto to JSON.
* @function toJSON
* @memberof google.protobuf.ServiceDescriptorProto
* @instance
* @returns {Object.<string,*>} JSON object
*/
ServiceDescriptorProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return ServiceDescriptorProto;
})();
protobuf.MethodDescriptorProto = (function() {
/**
* Properties of a MethodDescriptorProto.
* @memberof google.protobuf
* @interface IMethodDescriptorProto
* @property {string|null} [name] MethodDescriptorProto name
* @property {string|null} [input_type] MethodDescriptorProto input_type
* @property {string|null} [output_type] MethodDescriptorProto output_type
* @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options
*/
/**
* Constructs a new MethodDescriptorProto.
* @memberof google.protobuf
* @classdesc Represents a MethodDescriptorProto.
* @implements IMethodDescriptorProto
* @constructor
* @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
*/
function MethodDescriptorProto(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]];
}
/**
* MethodDescriptorProto name.
* @member {string} name
* @memberof google.protobuf.MethodDescriptorProto
* @instance
*/
MethodDescriptorProto.prototype.name = "";
/**
* MethodDescriptorProto input_type.
* @member {string} input_type
* @memberof google.protobuf.MethodDescriptorProto
* @instance
*/
MethodDescriptorProto.prototype.input_type = "";
/**
* MethodDescriptorProto output_type.
* @member {string} output_type
* @memberof google.protobuf.MethodDescriptorProto
* @instance
*/
MethodDescriptorProto.prototype.output_type = "";
/**
* MethodDescriptorProto options.
* @member {google.protobuf.IMethodOptions|null|undefined} options
* @memberof google.protobuf.MethodDescriptorProto
* @instance
*/
MethodDescriptorProto.prototype.options = null;
/**
* Creates a new MethodDescriptorProto instance using the specified properties.
* @function create
* @memberof google.protobuf.MethodDescriptorProto
* @static
* @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
* @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance
*/
MethodDescriptorProto.create = function create(properties) {
return new MethodDescriptorProto(properties);
};
/**
* Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
* @function encode
* @memberof google.protobuf.MethodDescriptorProto
* @static
* @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MethodDescriptorProto.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.hasOwnProperty("name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.input_type != null && message.hasOwnProperty("input_type"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.input_type);
if (message.output_type != null && message.hasOwnProperty("output_type"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.output_type);
if (message.options != null && message.hasOwnProperty("options"))
$root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
return writer;
};
/**
* Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.MethodDescriptorProto
* @static
* @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MethodDescriptorProto message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.MethodDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MethodDescriptorProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
message.input_type = reader.string();
break;
case 3:
message.output_type = reader.string();
break;
case 4:
message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.MethodDescriptorProto
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MethodDescriptorProto message.
* @function verify
* @memberof google.protobuf.MethodDescriptorProto
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MethodDescriptorProto.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.input_type != null && message.hasOwnProperty("input_type"))
if (!$util.isString(message.input_type))
return "input_type: string expected";
if (message.output_type != null && message.hasOwnProperty("output_type"))
if (!$util.isString(message.output_type))
return "output_type: string expected";
if (message.options != null && message.hasOwnProperty("options")) {
var error = $root.google.protobuf.MethodOptions.verify(message.options);
if (error)
return "options." + error;
}
return null;
};
/**
* Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.MethodDescriptorProto
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
*/
MethodDescriptorProto.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.MethodDescriptorProto)
return object;
var message = new $root.google.protobuf.MethodDescriptorProto();
if (object.name != null)
message.name = String(object.name);
if (object.input_type != null)
message.input_type = String(object.input_type);
if (object.output_type != null)
message.output_type = String(object.output_type);
if (object.options != null) {
if (typeof object.options !== "object")
throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");
message.options = $root.google.protobuf.MethodOptions.fromObject(object.options);
}
return message;
};
/**
* Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.MethodDescriptorProto
* @static
* @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
MethodDescriptorProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.name = "";
object.input_type = "";
object.output_type = "";
object.options = null;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.input_type != null && message.hasOwnProperty("input_type"))
object.input_type = message.input_type;
if (message.output_type != null && message.hasOwnProperty("output_type"))
object.output_type = message.output_type;
if (message.options != null && message.hasOwnProperty("options"))
object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options);
return object;
};
/**
* Converts this MethodDescriptorProto to JSON.
* @function toJSON
* @memberof google.protobuf.MethodDescriptorProto
* @instance
* @returns {Object.<string,*>} JSON object
*/
MethodDescriptorProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return MethodDescriptorProto;
})();
protobuf.FileOptions = (function() {
/**
* Properties of a FileOptions.
* @memberof google.protobuf
* @interface IFileOptions
* @property {string|null} [java_package] FileOptions java_package
* @property {string|null} [java_outer_classname] FileOptions java_outer_classname
* @property {boolean|null} [java_multiple_files] FileOptions java_multiple_files
* @property {boolean|null} [java_generate_equals_and_hash] FileOptions java_generate_equals_and_hash
* @property {google.protobuf.FileOptions.OptimizeMode|null} [optimize_for] FileOptions optimize_for
* @property {boolean|null} [cc_generic_services] FileOptions cc_generic_services
* @property {boolean|null} [java_generic_services] FileOptions java_generic_services
* @property {boolean|null} [py_generic_services] FileOptions py_generic_services
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpreted_option] FileOptions uninterpreted_option
*/
/**
* Constructs a new FileOptions.
* @memberof google.protobuf
* @classdesc Represents a FileOptions.
* @implements IFileOptions
* @constructor
* @param {google.protobuf.IFileOptions=} [properties] Properties to set
*/
function FileOptions(properties) {
this.uninterpreted_option = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* FileOptions java_package.
* @member {string} java_package
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.java_package = "";
/**
* FileOptions java_outer_classname.
* @member {string} java_outer_classname
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.java_outer_classname = "";
/**
* FileOptions java_multiple_files.
* @member {boolean} java_multiple_files
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.java_multiple_files = false;
/**
* FileOptions java_generate_equals_and_hash.
* @member {boolean} java_generate_equals_and_hash
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.java_generate_equals_and_hash = false;
/**
* FileOptions optimize_for.
* @member {google.protobuf.FileOptions.OptimizeMode} optimize_for
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.optimize_for = 1;
/**
* FileOptions cc_generic_services.
* @member {boolean} cc_generic_services
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.cc_generic_services = false;
/**
* FileOptions java_generic_services.
* @member {boolean} java_generic_services
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.java_generic_services = false;
/**
* FileOptions py_generic_services.
* @member {boolean} py_generic_services
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.py_generic_services = false;
/**
* FileOptions uninterpreted_option.
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpreted_option
* @memberof google.protobuf.FileOptions
* @instance
*/
FileOptions.prototype.uninterpreted_option = $util.emptyArray;
/**
* Creates a new FileOptions instance using the specified properties.
* @function create
* @memberof google.protobuf.FileOptions
* @static
* @param {google.protobuf.IFileOptions=} [properties] Properties to set
* @returns {google.protobuf.FileOptions} FileOptions instance
*/
FileOptions.create = function create(properties) {
return new FileOptions(properties);
};
/**
* Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
* @function encode
* @memberof google.protobuf.FileOptions
* @static
* @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FileOptions.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.java_package != null && message.hasOwnProperty("java_package"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.java_package);
if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.java_outer_classname);
if (message.optimize_for != null && message.hasOwnProperty("optimize_for"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimize_for);
if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files"))
writer.uint32(/* id 10, wireType 0 =*/80).bool(message.java_multiple_files);
if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services"))
writer.uint32(/* id 16, wireType 0 =*/128).bool(message.cc_generic_services);
if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services"))
writer.uint32(/* id 17, wireType 0 =*/136).bool(message.java_generic_services);
if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services"))
writer.uint32(/* id 18, wireType 0 =*/144).bool(message.py_generic_services);
if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash"))
writer.uint32(/* id 20, wireType 0 =*/160).bool(message.java_generate_equals_and_hash);
if (message.uninterpreted_option != null && message.uninterpreted_option.length)
for (var i = 0; i < message.uninterpreted_option.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
return writer;
};
/**
* Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.FileOptions
* @static
* @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FileOptions.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a FileOptions message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.FileOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.FileOptions} FileOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FileOptions.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.java_package = reader.string();
break;
case 8:
message.java_outer_classname = reader.string();
break;
case 10:
message.java_multiple_files = reader.bool();
break;
case 20:
message.java_generate_equals_and_hash = reader.bool();
break;
case 9:
message.optimize_for = reader.int32();
break;
case 16:
message.cc_generic_services = reader.bool();
break;
case 17:
message.java_generic_services = reader.bool();
break;
case 18:
message.py_generic_services = reader.bool();
break;
case 999:
if (!(message.uninterpreted_option && message.uninterpreted_option.length))
message.uninterpreted_option = [];
message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a FileOptions message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.FileOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.FileOptions} FileOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FileOptions.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a FileOptions message.
* @function verify
* @memberof google.protobuf.FileOptions
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
FileOptions.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.java_package != null && message.hasOwnProperty("java_package"))
if (!$util.isString(message.java_package))
return "java_package: string expected";
if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname"))
if (!$util.isString(message.java_outer_classname))
return "java_outer_classname: string expected";
if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files"))
if (typeof message.java_multiple_files !== "boolean")
return "java_multiple_files: boolean expected";
if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash"))
if (typeof message.java_generate_equals_and_hash !== "boolean")
return "java_generate_equals_and_hash: boolean expected";
if (message.optimize_for != null && message.hasOwnProperty("optimize_for"))
switch (message.optimize_for) {
default:
return "optimize_for: enum value expected";
case 1:
case 2:
case 3:
break;
}
if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services"))
if (typeof message.cc_generic_services !== "boolean")
return "cc_generic_services: boolean expected";
if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services"))
if (typeof message.java_generic_services !== "boolean")
return "java_generic_services: boolean expected";
if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services"))
if (typeof message.py_generic_services !== "boolean")
return "py_generic_services: boolean expected";
if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) {
if (!Array.isArray(message.uninterpreted_option))
return "uninterpreted_option: array expected";
for (var i = 0; i < message.uninterpreted_option.length; ++i) {
var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]);
if (error)
return "uninterpreted_option." + error;
}
}
return null;
};
/**
* Creates a FileOptions message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.FileOptions
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.FileOptions} FileOptions
*/
FileOptions.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.FileOptions)
return object;
var message = new $root.google.protobuf.FileOptions();
if (object.java_package != null)
message.java_package = String(object.java_package);
if (object.java_outer_classname != null)
message.java_outer_classname = String(object.java_outer_classname);
if (object.java_multiple_files != null)
message.java_multiple_files = Boolean(object.java_multiple_files);
if (object.java_generate_equals_and_hash != null)
message.java_generate_equals_and_hash = Boolean(object.java_generate_equals_and_hash);
switch (object.optimize_for) {
case "SPEED":
case 1:
message.optimize_for = 1;
break;
case "CODE_SIZE":
case 2:
message.optimize_for = 2;
break;
case "LITE_RUNTIME":
case 3:
message.optimize_for = 3;
break;
}
if (object.cc_generic_services != null)
message.cc_generic_services = Boolean(object.cc_generic_services);
if (object.java_generic_services != null)
message.java_generic_services = Boolean(object.java_generic_services);
if (object.py_generic_services != null)
message.py_generic_services = Boolean(object.py_generic_services);
if (object.uninterpreted_option) {
if (!Array.isArray(object.uninterpreted_option))
throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: array expected");
message.uninterpreted_option = [];
for (var i = 0; i < object.uninterpreted_option.length; ++i) {
if (typeof object.uninterpreted_option[i] !== "object")
throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: object expected");
message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]);
}
}
return message;
};
/**
* Creates a plain object from a FileOptions message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.FileOptions
* @static
* @param {google.protobuf.FileOptions} message FileOptions
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
FileOptions.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.uninterpreted_option = [];
if (options.defaults) {
object.java_package = "";
object.java_outer_classname = "";
object.optimize_for = options.enums === String ? "SPEED" : 1;
object.java_multiple_files = false;
object.cc_generic_services = false;
object.java_generic_services = false;
object.py_generic_services = false;
object.java_generate_equals_and_hash = false;
}
if (message.java_package != null && message.hasOwnProperty("java_package"))
object.java_package = message.java_package;
if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname"))
object.java_outer_classname = message.java_outer_classname;
if (message.optimize_for != null && message.hasOwnProperty("optimize_for"))
object.optimize_for = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimize_for] : message.optimize_for;
if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files"))
object.java_multiple_files = message.java_multiple_files;
if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services"))
object.cc_generic_services = message.cc_generic_services;
if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services"))
object.java_generic_services = message.java_generic_services;
if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services"))
object.py_generic_services = message.py_generic_services;
if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash"))
object.java_generate_equals_and_hash = message.java_generate_equals_and_hash;
if (message.uninterpreted_option && message.uninterpreted_option.length) {
object.uninterpreted_option = [];
for (var j = 0; j < message.uninterpreted_option.length; ++j)
object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options);
}
return object;
};
/**
* Converts this FileOptions to JSON.
* @function toJSON
* @memberof google.protobuf.FileOptions
* @instance
* @returns {Object.<string,*>} JSON object
*/
FileOptions.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* OptimizeMode enum.
* @name google.protobuf.FileOptions.OptimizeMode
* @enum {string}
* @property {number} SPEED=1 SPEED value
* @property {number} CODE_SIZE=2 CODE_SIZE value
* @property {number} LITE_RUNTIME=3 LITE_RUNTIME value
*/
FileOptions.OptimizeMode = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "SPEED"] = 1;
values[valuesById[2] = "CODE_SIZE"] = 2;
values[valuesById[3] = "LITE_RUNTIME"] = 3;
return values;
})();
return FileOptions;
})();
protobuf.MessageOptions = (function() {
/**
* Properties of a MessageOptions.
* @memberof google.protobuf
* @interface IMessageOptions
* @property {boolean|null} [message_set_wire_format] MessageOptions message_set_wire_format
* @property {boolean|null} [no_standard_descriptor_accessor] MessageOptions no_standard_descriptor_accessor
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpreted_option] MessageOptions uninterpreted_option
* @property {boolean|null} [".start_expanded"] MessageOptions .start_expanded
*/
/**
* Constructs a new MessageOptions.
* @memberof google.protobuf
* @classdesc Represents a MessageOptions.
* @implements IMessageOptions
* @constructor
* @param {google.protobuf.IMessageOptions=} [properties] Properties to set
*/
function MessageOptions(properties) {
this.uninterpreted_option = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* MessageOptions message_set_wire_format.
* @member {boolean} message_set_wire_format
* @memberof google.protobuf.MessageOptions
* @instance
*/
MessageOptions.prototype.message_set_wire_format = false;
/**
* MessageOptions no_standard_descriptor_accessor.
* @member {boolean} no_standard_descriptor_accessor
* @memberof google.protobuf.MessageOptions
* @instance
*/
MessageOptions.prototype.no_standard_descriptor_accessor = false;
/**
* MessageOptions uninterpreted_option.
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpreted_option
* @memberof google.protobuf.MessageOptions
* @instance
*/
MessageOptions.prototype.uninterpreted_option = $util.emptyArray;
/**
* MessageOptions .start_expanded.
* @member {boolean} .start_expanded
* @memberof google.protobuf.MessageOptions
* @instance
*/
MessageOptions.prototype[".start_expanded"] = true;
/**
* Creates a new MessageOptions instance using the specified properties.
* @function create
* @memberof google.protobuf.MessageOptions
* @static
* @param {google.protobuf.IMessageOptions=} [properties] Properties to set
* @returns {google.protobuf.MessageOptions} MessageOptions instance
*/
MessageOptions.create = function create(properties) {
return new MessageOptions(properties);
};
/**
* Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
* @function encode
* @memberof google.protobuf.MessageOptions
* @static
* @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MessageOptions.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format"))
writer.uint32(/* id 1, wireType 0 =*/8).bool(message.message_set_wire_format);
if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_standard_descriptor_accessor);
if (message.uninterpreted_option != null && message.uninterpreted_option.length)
for (var i = 0; i < message.uninterpreted_option.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
if (message[".start_expanded"] != null && message.hasOwnProperty(".start_expanded"))
writer.uint32(/* id 80000, wireType 0 =*/640000).bool(message[".start_expanded"]);
return writer;
};
/**
* Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.MessageOptions
* @static
* @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MessageOptions.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MessageOptions message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.MessageOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.MessageOptions} MessageOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MessageOptions.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.message_set_wire_format = reader.bool();
break;
case 2:
message.no_standard_descriptor_accessor = reader.bool();
break;
case 999:
if (!(message.uninterpreted_option && message.uninterpreted_option.length))
message.uninterpreted_option = [];
message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
case 80000:
message[".start_expanded"] = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MessageOptions message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.MessageOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.MessageOptions} MessageOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MessageOptions.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MessageOptions message.
* @function verify
* @memberof google.protobuf.MessageOptions
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MessageOptions.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format"))
if (typeof message.message_set_wire_format !== "boolean")
return "message_set_wire_format: boolean expected";
if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor"))
if (typeof message.no_standard_descriptor_accessor !== "boolean")
return "no_standard_descriptor_accessor: boolean expected";
if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) {
if (!Array.isArray(message.uninterpreted_option))
return "uninterpreted_option: array expected";
for (var i = 0; i < message.uninterpreted_option.length; ++i) {
var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]);
if (error)
return "uninterpreted_option." + error;
}
}
if (message[".start_expanded"] != null && message.hasOwnProperty(".start_expanded"))
if (typeof message[".start_expanded"] !== "boolean")
return ".start_expanded: boolean expected";
return null;
};
/**
* Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.MessageOptions
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.MessageOptions} MessageOptions
*/
MessageOptions.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.MessageOptions)
return object;
var message = new $root.google.protobuf.MessageOptions();
if (object.message_set_wire_format != null)
message.message_set_wire_format = Boolean(object.message_set_wire_format);
if (object.no_standard_descriptor_accessor != null)
message.no_standard_descriptor_accessor = Boolean(object.no_standard_descriptor_accessor);
if (object.uninterpreted_option) {
if (!Array.isArray(object.uninterpreted_option))
throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: array expected");
message.uninterpreted_option = [];
for (var i = 0; i < object.uninterpreted_option.length; ++i) {
if (typeof object.uninterpreted_option[i] !== "object")
throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: object expected");
message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]);
}
}
if (object[".start_expanded"] != null)
message[".start_expanded"] = Boolean(object[".start_expanded"]);
return message;
};
/**
* Creates a plain object from a MessageOptions message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.MessageOptions
* @static
* @param {google.protobuf.MessageOptions} message MessageOptions
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
MessageOptions.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.uninterpreted_option = [];
if (options.defaults) {
object.message_set_wire_format = false;
object.no_standard_descriptor_accessor = false;
object[".start_expanded"] = true;
}
if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format"))
object.message_set_wire_format = message.message_set_wire_format;
if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor"))
object.no_standard_descriptor_accessor = message.no_standard_descriptor_accessor;
if (message.uninterpreted_option && message.uninterpreted_option.length) {
object.uninterpreted_option = [];
for (var j = 0; j < message.uninterpreted_option.length; ++j)
object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options);
}
if (message[".start_expanded"] != null && message.hasOwnProperty(".start_expanded"))
object[".start_expanded"] = message[".start_expanded"];
return object;
};
/**
* Converts this MessageOptions to JSON.
* @function toJSON
* @memberof google.protobuf.MessageOptions
* @instance
* @returns {Object.<string,*>} JSON object
*/
MessageOptions.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return MessageOptions;
})();
protobuf.FieldOptions = (function() {
/**
* Properties of a FieldOptions.
* @memberof google.protobuf
* @interface IFieldOptions
* @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype
* @property {boolean|null} [packed] FieldOptions packed
* @property {boolean|null} [deprecated] FieldOptions deprecated
* @property {string|null} [experimental_map_key] FieldOptions experimental_map_key
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpreted_option] FieldOptions uninterpreted_option
* @property {ProtoDefTypes|null} [".valid_type"] FieldOptions .valid_type
* @property {boolean|null} [".editable"] FieldOptions .editable
* @property {boolean|null} [".localized"] FieldOptions .localized
* @property {boolean|null} [".do_not_inherit"] FieldOptions .do_not_inherit
* @property {string|null} [".display_name"] FieldOptions .display_name
* @property {string|null} [".comment"] FieldOptions .comment
* @property {number|null} [".max_count"] FieldOptions .max_count
* @property {boolean|null} [".allow_add"] FieldOptions .allow_add
* @property {boolean|null} [".allow_delete"] FieldOptions .allow_delete
* @property {string|null} [".panel_class_override"] FieldOptions .panel_class_override
* @property {string|null} [".message_inherhitance_key_field_name"] FieldOptions .message_inherhitance_key_field_name
* @property {boolean|null} [".inherit_reference_variables"] FieldOptions .inherit_reference_variables
* @property {boolean|null} [".self_inherit_only"] FieldOptions .self_inherit_only
* @property {EVarFieldType|null} [".var_field_type"] FieldOptions .var_field_type
* @property {boolean|null} [".merging_key_field"] FieldOptions .merging_key_field
*/
/**
* Constructs a new FieldOptions.
* @memberof google.protobuf
* @classdesc Represents a FieldOptions.
* @implements IFieldOptions
* @constructor
* @param {google.protobuf.IFieldOptions=} [properties] Properties to set
*/
function FieldOptions(properties) {
this.uninterpreted_option = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* FieldOptions ctype.
* @member {google.protobuf.FieldOptions.CType} ctype
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype.ctype = 0;
/**
* FieldOptions packed.
* @member {boolean} packed
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype.packed = false;
/**
* FieldOptions deprecated.
* @member {boolean} deprecated
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype.deprecated = false;
/**
* FieldOptions experimental_map_key.
* @member {string} experimental_map_key
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype.experimental_map_key = "";
/**
* FieldOptions uninterpreted_option.
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpreted_option
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype.uninterpreted_option = $util.emptyArray;
/**
* FieldOptions .valid_type.
* @member {ProtoDefTypes} .valid_type
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".valid_type"] = 0;
/**
* FieldOptions .editable.
* @member {boolean} .editable
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".editable"] = true;
/**
* FieldOptions .localized.
* @member {boolean} .localized
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".localized"] = false;
/**
* FieldOptions .do_not_inherit.
* @member {boolean} .do_not_inherit
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".do_not_inherit"] = false;
/**
* FieldOptions .display_name.
* @member {string} .display_name
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".display_name"] = "";
/**
* FieldOptions .comment.
* @member {string} .comment
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".comment"] = "";
/**
* FieldOptions .max_count.
* @member {number} .max_count
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".max_count"] = 0;
/**
* FieldOptions .allow_add.
* @member {boolean} .allow_add
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".allow_add"] = true;
/**
* FieldOptions .allow_delete.
* @member {boolean} .allow_delete
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".allow_delete"] = true;
/**
* FieldOptions .panel_class_override.
* @member {string} .panel_class_override
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".panel_class_override"] = "";
/**
* FieldOptions .message_inherhitance_key_field_name.
* @member {string} .message_inherhitance_key_field_name
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".message_inherhitance_key_field_name"] = "";
/**
* FieldOptions .inherit_reference_variables.
* @member {boolean} .inherit_reference_variables
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".inherit_reference_variables"] = false;
/**
* FieldOptions .self_inherit_only.
* @member {boolean} .self_inherit_only
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".self_inherit_only"] = false;
/**
* FieldOptions .var_field_type.
* @member {EVarFieldType} .var_field_type
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".var_field_type"] = 1;
/**
* FieldOptions .merging_key_field.
* @member {boolean} .merging_key_field
* @memberof google.protobuf.FieldOptions
* @instance
*/
FieldOptions.prototype[".merging_key_field"] = false;
/**
* Creates a new FieldOptions instance using the specified properties.
* @function create
* @memberof google.protobuf.FieldOptions
* @static
* @param {google.protobuf.IFieldOptions=} [properties] Properties to set
* @returns {google.protobuf.FieldOptions} FieldOptions instance
*/
FieldOptions.create = function create(properties) {
return new FieldOptions(properties);
};
/**
* Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
* @function encode
* @memberof google.protobuf.FieldOptions
* @static
* @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FieldOptions.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.ctype != null && message.hasOwnProperty("ctype"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype);
if (message.packed != null && message.hasOwnProperty("packed"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed);
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
if (message.experimental_map_key != null && message.hasOwnProperty("experimental_map_key"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.experimental_map_key);
if (message.uninterpreted_option != null && message.uninterpreted_option.length)
for (var i = 0; i < message.uninterpreted_option.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
if (message[".valid_type"] != null && message.hasOwnProperty(".valid_type"))
writer.uint32(/* id 70000, wireType 0 =*/560000).int32(message[".valid_type"]);
if (message[".editable"] != null && message.hasOwnProperty(".editable"))
writer.uint32(/* id 70001, wireType 0 =*/560008).bool(message[".editable"]);
if (message[".localized"] != null && message.hasOwnProperty(".localized"))
writer.uint32(/* id 70002, wireType 0 =*/560016).bool(message[".localized"]);
if (message[".do_not_inherit"] != null && message.hasOwnProperty(".do_not_inherit"))
writer.uint32(/* id 70003, wireType 0 =*/560024).bool(message[".do_not_inherit"]);
if (message[".display_name"] != null && message.hasOwnProperty(".display_name"))
writer.uint32(/* id 70004, wireType 2 =*/560034).string(message[".display_name"]);
if (message[".comment"] != null && message.hasOwnProperty(".comment"))
writer.uint32(/* id 70005, wireType 2 =*/560042).string(message[".comment"]);
if (message[".max_count"] != null && message.hasOwnProperty(".max_count"))
writer.uint32(/* id 70007, wireType 0 =*/560056).uint32(message[".max_count"]);
if (message[".allow_add"] != null && message.hasOwnProperty(".allow_add"))
writer.uint32(/* id 70008, wireType 0 =*/560064).bool(message[".allow_add"]);
if (message[".allow_delete"] != null && message.hasOwnProperty(".allow_delete"))
writer.uint32(/* id 70009, wireType 0 =*/560072).bool(message[".allow_delete"]);
if (message[".panel_class_override"] != null && message.hasOwnProperty(".panel_class_override"))
writer.uint32(/* id 70010, wireType 2 =*/560082).string(message[".panel_class_override"]);
if (message[".message_inherhitance_key_field_name"] != null && message.hasOwnProperty(".message_inherhitance_key_field_name"))
writer.uint32(/* id 70011, wireType 2 =*/560090).string(message[".message_inherhitance_key_field_name"]);
if (message[".inherit_reference_variables"] != null && message.hasOwnProperty(".inherit_reference_variables"))
writer.uint32(/* id 70012, wireType 0 =*/560096).bool(message[".inherit_reference_variables"]);
if (message[".self_inherit_only"] != null && message.hasOwnProperty(".self_inherit_only"))
writer.uint32(/* id 70013, wireType 0 =*/560104).bool(message[".self_inherit_only"]);
if (message[".var_field_type"] != null && message.hasOwnProperty(".var_field_type"))
writer.uint32(/* id 70014, wireType 0 =*/560112).int32(message[".var_field_type"]);
if (message[".merging_key_field"] != null && message.hasOwnProperty(".merging_key_field"))
writer.uint32(/* id 70015, wireType 0 =*/560120).bool(message[".merging_key_field"]);
return writer;
};
/**
* Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.FieldOptions
* @static
* @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a FieldOptions message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.FieldOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.FieldOptions} FieldOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FieldOptions.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.ctype = reader.int32();
break;
case 2:
message.packed = reader.bool();
break;
case 3:
message.deprecated = reader.bool();
break;
case 9:
message.experimental_map_key = reader.string();
break;
case 999:
if (!(message.uninterpreted_option && message.uninterpreted_option.length))
message.uninterpreted_option = [];
message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
case 70000:
message[".valid_type"] = reader.int32();
break;
case 70001:
message[".editable"] = reader.bool();
break;
case 70002:
message[".localized"] = reader.bool();
break;
case 70003:
message[".do_not_inherit"] = reader.bool();
break;
case 70004:
message[".display_name"] = reader.string();
break;
case 70005:
message[".comment"] = reader.string();
break;
case 70007:
message[".max_count"] = reader.uint32();
break;
case 70008:
message[".allow_add"] = reader.bool();
break;
case 70009:
message[".allow_delete"] = reader.bool();
break;
case 70010:
message[".panel_class_override"] = reader.string();
break;
case 70011:
message[".message_inherhitance_key_field_name"] = reader.string();
break;
case 70012:
message[".inherit_reference_variables"] = reader.bool();
break;
case 70013:
message[".self_inherit_only"] = reader.bool();
break;
case 70014:
message[".var_field_type"] = reader.int32();
break;
case 70015:
message[".merging_key_field"] = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a FieldOptions message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.FieldOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.FieldOptions} FieldOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FieldOptions.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a FieldOptions message.
* @function verify
* @memberof google.protobuf.FieldOptions
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
FieldOptions.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.ctype != null && message.hasOwnProperty("ctype"))
switch (message.ctype) {
default:
return "ctype: enum value expected";
case 0:
case 1:
case 2:
break;
}
if (message.packed != null && message.hasOwnProperty("packed"))
if (typeof message.packed !== "boolean")
return "packed: boolean expected";
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
if (typeof message.deprecated !== "boolean")
return "deprecated: boolean expected";
if (message.experimental_map_key != null && message.hasOwnProperty("experimental_map_key"))
if (!$util.isString(message.experimental_map_key))
return "experimental_map_key: string expected";
if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) {
if (!Array.isArray(message.uninterpreted_option))
return "uninterpreted_option: array expected";
for (var i = 0; i < message.uninterpreted_option.length; ++i) {
var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]);
if (error)
return "uninterpreted_option." + error;
}
}
if (message[".valid_type"] != null && message.hasOwnProperty(".valid_type"))
switch (message[".valid_type"]) {
default:
return ".valid_type: enum value expected";
case 0:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
break;
}
if (message[".editable"] != null && message.hasOwnProperty(".editable"))
if (typeof message[".editable"] !== "boolean")
return ".editable: boolean expected";
if (message[".localized"] != null && message.hasOwnProperty(".localized"))
if (typeof message[".localized"] !== "boolean")
return ".localized: boolean expected";
if (message[".do_not_inherit"] != null && message.hasOwnProperty(".do_not_inherit"))
if (typeof message[".do_not_inherit"] !== "boolean")
return ".do_not_inherit: boolean expected";
if (message[".display_name"] != null && message.hasOwnProperty(".display_name"))
if (!$util.isString(message[".display_name"]))
return ".display_name: string expected";
if (message[".comment"] != null && message.hasOwnProperty(".comment"))
if (!$util.isString(message[".comment"]))
return ".comment: string expected";
if (message[".max_count"] != null && message.hasOwnProperty(".max_count"))
if (!$util.isInteger(message[".max_count"]))
return ".max_count: integer expected";
if (message[".allow_add"] != null && message.hasOwnProperty(".allow_add"))
if (typeof message[".allow_add"] !== "boolean")
return ".allow_add: boolean expected";
if (message[".allow_delete"] != null && message.hasOwnProperty(".allow_delete"))
if (typeof message[".allow_delete"] !== "boolean")
return ".allow_delete: boolean expected";
if (message[".panel_class_override"] != null && message.hasOwnProperty(".panel_class_override"))
if (!$util.isString(message[".panel_class_override"]))
return ".panel_class_override: string expected";
if (message[".message_inherhitance_key_field_name"] != null && message.hasOwnProperty(".message_inherhitance_key_field_name"))
if (!$util.isString(message[".message_inherhitance_key_field_name"]))
return ".message_inherhitance_key_field_name: string expected";
if (message[".inherit_reference_variables"] != null && message.hasOwnProperty(".inherit_reference_variables"))
if (typeof message[".inherit_reference_variables"] !== "boolean")
return ".inherit_reference_variables: boolean expected";
if (message[".self_inherit_only"] != null && message.hasOwnProperty(".self_inherit_only"))
if (typeof message[".self_inherit_only"] !== "boolean")
return ".self_inherit_only: boolean expected";
if (message[".var_field_type"] != null && message.hasOwnProperty(".var_field_type"))
switch (message[".var_field_type"]) {
default:
return ".var_field_type: enum value expected";
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
break;
}
if (message[".merging_key_field"] != null && message.hasOwnProperty(".merging_key_field"))
if (typeof message[".merging_key_field"] !== "boolean")
return ".merging_key_field: boolean expected";
return null;
};
/**
* Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.FieldOptions
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.FieldOptions} FieldOptions
*/
FieldOptions.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.FieldOptions)
return object;
var message = new $root.google.protobuf.FieldOptions();
switch (object.ctype) {
case "STRING":
case 0:
message.ctype = 0;
break;
case "CORD":
case 1:
message.ctype = 1;
break;
case "STRING_PIECE":
case 2:
message.ctype = 2;
break;
}
if (object.packed != null)
message.packed = Boolean(object.packed);
if (object.deprecated != null)
message.deprecated = Boolean(object.deprecated);
if (object.experimental_map_key != null)
message.experimental_map_key = String(object.experimental_map_key);
if (object.uninterpreted_option) {
if (!Array.isArray(object.uninterpreted_option))
throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: array expected");
message.uninterpreted_option = [];
for (var i = 0; i < object.uninterpreted_option.length; ++i) {
if (typeof object.uninterpreted_option[i] !== "object")
throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: object expected");
message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]);
}
}
switch (object[".valid_type"]) {
case "DEF_TYPE_QUEST_MAP_NODE":
case 0:
message[".valid_type"] = 0;
break;
case "DEF_TYPE_QUEST_THEME":
case 2:
message[".valid_type"] = 2;
break;
case "DEF_TYPE_QUEST_MAP_REGION":
case 3:
message[".valid_type"] = 3;
break;
case "DEF_TYPE_QUEST":
case 4:
message[".valid_type"] = 4;
break;
case "DEF_TYPE_QUEST_OBJECTIVE":
case 5:
message[".valid_type"] = 5;
break;
case "DEF_TYPE_PAINTKIT_VARIABLES":
case 6:
message[".valid_type"] = 6;
break;
case "DEF_TYPE_PAINTKIT_OPERATION":
case 7:
message[".valid_type"] = 7;
break;
case "DEF_TYPE_PAINTKIT_ITEM_DEFINITION":
case 8:
message[".valid_type"] = 8;
break;
case "DEF_TYPE_PAINTKIT_DEFINITION":
case 9:
message[".valid_type"] = 9;
break;
case "DEF_TYPE_HEADER_ONLY":
case 10:
message[".valid_type"] = 10;
break;
case "DEF_TYPE_QUEST_MAP_STORE_ITEM":
case 11:
message[".valid_type"] = 11;
break;
case "DEF_TYPE_QUEST_MAP_STAR_TYPE":
case 12:
message[".valid_type"] = 12;
break;
}
if (object[".editable"] != null)
message[".editable"] = Boolean(object[".editable"]);
if (object[".localized"] != null)
message[".localized"] = Boolean(object[".localized"]);
if (object[".do_not_inherit"] != null)
message[".do_not_inherit"] = Boolean(object[".do_not_inherit"]);
if (object[".display_name"] != null)
message[".display_name"] = String(object[".display_name"]);
if (object[".comment"] != null)
message[".comment"] = String(object[".comment"]);
if (object[".max_count"] != null)
message[".max_count"] = object[".max_count"] >>> 0;
if (object[".allow_add"] != null)
message[".allow_add"] = Boolean(object[".allow_add"]);
if (object[".allow_delete"] != null)
message[".allow_delete"] = Boolean(object[".allow_delete"]);
if (object[".panel_class_override"] != null)
message[".panel_class_override"] = String(object[".panel_class_override"]);
if (object[".message_inherhitance_key_field_name"] != null)
message[".message_inherhitance_key_field_name"] = String(object[".message_inherhitance_key_field_name"]);
if (object[".inherit_reference_variables"] != null)
message[".inherit_reference_variables"] = Boolean(object[".inherit_reference_variables"]);
if (object[".self_inherit_only"] != null)
message[".self_inherit_only"] = Boolean(object[".self_inherit_only"]);
switch (object[".var_field_type"]) {
case "VAR_TYPE_INVALID":
case 1:
message[".var_field_type"] = 1;
break;
case "VAR_TYPE_FLOAT":
case 2:
message[".var_field_type"] = 2;
break;
case "VAR_TYPE_DOUBLE":
case 3:
message[".var_field_type"] = 3;
break;
case "VAR_TYPE_UINT32":
case 4:
message[".var_field_type"] = 4;
break;
case "VAR_TYPE_UINT64":
case 5:
message[".var_field_type"] = 5;
break;
case "VAR_TYPE_SINT32":
case 6:
message[".var_field_type"] = 6;
break;
case "VAR_TYPE_SINT64":
case 7:
message[".var_field_type"] = 7;
break;
case "VAR_TYPE_BOOL":
case 8:
message[".var_field_type"] = 8;
break;
case "VAR_TYPE_STRING":
case 9:
message[".var_field_type"] = 9;
break;
}
if (object[".merging_key_field"] != null)
message[".merging_key_field"] = Boolean(object[".merging_key_field"]);
return message;
};
/**
* Creates a plain object from a FieldOptions message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.FieldOptions
* @static
* @param {google.protobuf.FieldOptions} message FieldOptions
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
FieldOptions.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.uninterpreted_option = [];
if (options.defaults) {
object.ctype = options.enums === String ? "STRING" : 0;
object.packed = false;
object.deprecated = false;
object.experimental_map_key = "";
object[".valid_type"] = options.enums === String ? "DEF_TYPE_QUEST_MAP_NODE" : 0;
object[".editable"] = true;
object[".localized"] = false;
object[".do_not_inherit"] = false;
object[".display_name"] = "";
object[".comment"] = "";
object[".max_count"] = 0;
object[".allow_add"] = true;
object[".allow_delete"] = true;
object[".panel_class_override"] = "";
object[".message_inherhitance_key_field_name"] = "";
object[".inherit_reference_variables"] = false;
object[".self_inherit_only"] = false;
object[".var_field_type"] = options.enums === String ? "VAR_TYPE_INVALID" : 1;
object[".merging_key_field"] = false;
}
if (message.ctype != null && message.hasOwnProperty("ctype"))
object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;
if (message.packed != null && message.hasOwnProperty("packed"))
object.packed = message.packed;
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
object.deprecated = message.deprecated;
if (message.experimental_map_key != null && message.hasOwnProperty("experimental_map_key"))
object.experimental_map_key = message.experimental_map_key;
if (message.uninterpreted_option && message.uninterpreted_option.length) {
object.uninterpreted_option = [];
for (var j = 0; j < message.uninterpreted_option.length; ++j)
object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options);
}
if (message[".valid_type"] != null && message.hasOwnProperty(".valid_type"))
object[".valid_type"] = options.enums === String ? $root.ProtoDefTypes[message[".valid_type"]] : message[".valid_type"];
if (message[".editable"] != null && message.hasOwnProperty(".editable"))
object[".editable"] = message[".editable"];
if (message[".localized"] != null && message.hasOwnProperty(".localized"))
object[".localized"] = message[".localized"];
if (message[".do_not_inherit"] != null && message.hasOwnProperty(".do_not_inherit"))
object[".do_not_inherit"] = message[".do_not_inherit"];
if (message[".display_name"] != null && message.hasOwnProperty(".display_name"))
object[".display_name"] = message[".display_name"];
if (message[".comment"] != null && message.hasOwnProperty(".comment"))
object[".comment"] = message[".comment"];
if (message[".max_count"] != null && message.hasOwnProperty(".max_count"))
object[".max_count"] = message[".max_count"];
if (message[".allow_add"] != null && message.hasOwnProperty(".allow_add"))
object[".allow_add"] = message[".allow_add"];
if (message[".allow_delete"] != null && message.hasOwnProperty(".allow_delete"))
object[".allow_delete"] = message[".allow_delete"];
if (message[".panel_class_override"] != null && message.hasOwnProperty(".panel_class_override"))
object[".panel_class_override"] = message[".panel_class_override"];
if (message[".message_inherhitance_key_field_name"] != null && message.hasOwnProperty(".message_inherhitance_key_field_name"))
object[".message_inherhitance_key_field_name"] = message[".message_inherhitance_key_field_name"];
if (message[".inherit_reference_variables"] != null && message.hasOwnProperty(".inherit_reference_variables"))
object[".inherit_reference_variables"] = message[".inherit_reference_variables"];
if (message[".self_inherit_only"] != null && message.hasOwnProperty(".self_inherit_only"))
object[".self_inherit_only"] = message[".self_inherit_only"];
if (message[".var_field_type"] != null && message.hasOwnProperty(".var_field_type"))
object[".var_field_type"] = options.enums === String ? $root.EVarFieldType[message[".var_field_type"]] : message[".var_field_type"];
if (message[".merging_key_field"] != null && message.hasOwnProperty(".merging_key_field"))
object[".merging_key_field"] = message[".merging_key_field"];
return object;
};
/**
* Converts this FieldOptions to JSON.
* @function toJSON
* @memberof google.protobuf.FieldOptions
* @instance
* @returns {Object.<string,*>} JSON object
*/
FieldOptions.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* CType enum.
* @name google.protobuf.FieldOptions.CType
* @enum {string}
* @property {number} STRING=0 STRING value
* @property {number} CORD=1 CORD value
* @property {number} STRING_PIECE=2 STRING_PIECE value
*/
FieldOptions.CType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "STRING"] = 0;
values[valuesById[1] = "CORD"] = 1;
values[valuesById[2] = "STRING_PIECE"] = 2;
return values;
})();
return FieldOptions;
})();
protobuf.EnumOptions = (function() {
/**
* Properties of an EnumOptions.
* @memberof google.protobuf
* @interface IEnumOptions
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpreted_option] EnumOptions uninterpreted_option
*/
/**
* Constructs a new EnumOptions.
* @memberof google.protobuf
* @classdesc Represents an EnumOptions.
* @implements IEnumOptions
* @constructor
* @param {google.protobuf.IEnumOptions=} [properties] Properties to set
*/
function EnumOptions(properties) {
this.uninterpreted_option = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* EnumOptions uninterpreted_option.
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpreted_option
* @memberof google.protobuf.EnumOptions
* @instance
*/
EnumOptions.prototype.uninterpreted_option = $util.emptyArray;
/**
* Creates a new EnumOptions instance using the specified properties.
* @function create
* @memberof google.protobuf.EnumOptions
* @static
* @param {google.protobuf.IEnumOptions=} [properties] Properties to set
* @returns {google.protobuf.EnumOptions} EnumOptions instance
*/
EnumOptions.create = function create(properties) {
return new EnumOptions(properties);
};
/**
* Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
* @function encode
* @memberof google.protobuf.EnumOptions
* @static
* @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
EnumOptions.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.uninterpreted_option != null && message.uninterpreted_option.length)
for (var i = 0; i < message.uninterpreted_option.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
return writer;
};
/**
* Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.EnumOptions
* @static
* @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EnumOptions message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.EnumOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.EnumOptions} EnumOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
EnumOptions.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 999:
if (!(message.uninterpreted_option && message.uninterpreted_option.length))
message.uninterpreted_option = [];
message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EnumOptions message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.EnumOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.EnumOptions} EnumOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
EnumOptions.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EnumOptions message.
* @function verify
* @memberof google.protobuf.EnumOptions
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EnumOptions.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) {
if (!Array.isArray(message.uninterpreted_option))
return "uninterpreted_option: array expected";
for (var i = 0; i < message.uninterpreted_option.length; ++i) {
var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]);
if (error)
return "uninterpreted_option." + error;
}
}
return null;
};
/**
* Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.EnumOptions
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.EnumOptions} EnumOptions
*/
EnumOptions.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.EnumOptions)
return object;
var message = new $root.google.protobuf.EnumOptions();
if (object.uninterpreted_option) {
if (!Array.isArray(object.uninterpreted_option))
throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: array expected");
message.uninterpreted_option = [];
for (var i = 0; i < object.uninterpreted_option.length; ++i) {
if (typeof object.uninterpreted_option[i] !== "object")
throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: object expected");
message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]);
}
}
return message;
};
/**
* Creates a plain object from an EnumOptions message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.EnumOptions
* @static
* @param {google.protobuf.EnumOptions} message EnumOptions
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EnumOptions.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.uninterpreted_option = [];
if (message.uninterpreted_option && message.uninterpreted_option.length) {
object.uninterpreted_option = [];
for (var j = 0; j < message.uninterpreted_option.length; ++j)
object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options);
}
return object;
};
/**
* Converts this EnumOptions to JSON.
* @function toJSON
* @memberof google.protobuf.EnumOptions
* @instance
* @returns {Object.<string,*>} JSON object
*/
EnumOptions.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return EnumOptions;
})();
protobuf.EnumValueOptions = (function() {
/**
* Properties of an EnumValueOptions.
* @memberof google.protobuf
* @interface IEnumValueOptions
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpreted_option] EnumValueOptions uninterpreted_option
*/
/**
* Constructs a new EnumValueOptions.
* @memberof google.protobuf
* @classdesc Represents an EnumValueOptions.
* @implements IEnumValueOptions
* @constructor
* @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
*/
function EnumValueOptions(properties) {
this.uninterpreted_option = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* EnumValueOptions uninterpreted_option.
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpreted_option
* @memberof google.protobuf.EnumValueOptions
* @instance
*/
EnumValueOptions.prototype.uninterpreted_option = $util.emptyArray;
/**
* Creates a new EnumValueOptions instance using the specified properties.
* @function create
* @memberof google.protobuf.EnumValueOptions
* @static
* @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
* @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance
*/
EnumValueOptions.create = function create(properties) {
return new EnumValueOptions(properties);
};
/**
* Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
* @function encode
* @memberof google.protobuf.EnumValueOptions
* @static
* @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
EnumValueOptions.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.uninterpreted_option != null && message.uninterpreted_option.length)
for (var i = 0; i < message.uninterpreted_option.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
return writer;
};
/**
* Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.EnumValueOptions
* @static
* @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EnumValueOptions message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.EnumValueOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.EnumValueOptions} EnumValueOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
EnumValueOptions.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 999:
if (!(message.uninterpreted_option && message.uninterpreted_option.length))
message.uninterpreted_option = [];
message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.EnumValueOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.EnumValueOptions} EnumValueOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EnumValueOptions message.
* @function verify
* @memberof google.protobuf.EnumValueOptions
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EnumValueOptions.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) {
if (!Array.isArray(message.uninterpreted_option))
return "uninterpreted_option: array expected";
for (var i = 0; i < message.uninterpreted_option.length; ++i) {
var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]);
if (error)
return "uninterpreted_option." + error;
}
}
return null;
};
/**
* Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.EnumValueOptions
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.EnumValueOptions} EnumValueOptions
*/
EnumValueOptions.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.EnumValueOptions)
return object;
var message = new $root.google.protobuf.EnumValueOptions();
if (object.uninterpreted_option) {
if (!Array.isArray(object.uninterpreted_option))
throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: array expected");
message.uninterpreted_option = [];
for (var i = 0; i < object.uninterpreted_option.length; ++i) {
if (typeof object.uninterpreted_option[i] !== "object")
throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: object expected");
message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]);
}
}
return message;
};
/**
* Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.EnumValueOptions
* @static
* @param {google.protobuf.EnumValueOptions} message EnumValueOptions
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EnumValueOptions.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.uninterpreted_option = [];
if (message.uninterpreted_option && message.uninterpreted_option.length) {
object.uninterpreted_option = [];
for (var j = 0; j < message.uninterpreted_option.length; ++j)
object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options);
}
return object;
};
/**
* Converts this EnumValueOptions to JSON.
* @function toJSON
* @memberof google.protobuf.EnumValueOptions
* @instance
* @returns {Object.<string,*>} JSON object
*/
EnumValueOptions.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return EnumValueOptions;
})();
protobuf.ServiceOptions = (function() {
/**
* Properties of a ServiceOptions.
* @memberof google.protobuf
* @interface IServiceOptions
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpreted_option] ServiceOptions uninterpreted_option
*/
/**
* Constructs a new ServiceOptions.
* @memberof google.protobuf
* @classdesc Represents a ServiceOptions.
* @implements IServiceOptions
* @constructor
* @param {google.protobuf.IServiceOptions=} [properties] Properties to set
*/
function ServiceOptions(properties) {
this.uninterpreted_option = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ServiceOptions uninterpreted_option.
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpreted_option
* @memberof google.protobuf.ServiceOptions
* @instance
*/
ServiceOptions.prototype.uninterpreted_option = $util.emptyArray;
/**
* Creates a new ServiceOptions instance using the specified properties.
* @function create
* @memberof google.protobuf.ServiceOptions
* @static
* @param {google.protobuf.IServiceOptions=} [properties] Properties to set
* @returns {google.protobuf.ServiceOptions} ServiceOptions instance
*/
ServiceOptions.create = function create(properties) {
return new ServiceOptions(properties);
};
/**
* Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
* @function encode
* @memberof google.protobuf.ServiceOptions
* @static
* @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ServiceOptions.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.uninterpreted_option != null && message.uninterpreted_option.length)
for (var i = 0; i < message.uninterpreted_option.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.ServiceOptions
* @static
* @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ServiceOptions message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.ServiceOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.ServiceOptions} ServiceOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ServiceOptions.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 999:
if (!(message.uninterpreted_option && message.uninterpreted_option.length))
message.uninterpreted_option = [];
message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ServiceOptions message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.ServiceOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.ServiceOptions} ServiceOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ServiceOptions.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ServiceOptions message.
* @function verify
* @memberof google.protobuf.ServiceOptions
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ServiceOptions.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) {
if (!Array.isArray(message.uninterpreted_option))
return "uninterpreted_option: array expected";
for (var i = 0; i < message.uninterpreted_option.length; ++i) {
var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]);
if (error)
return "uninterpreted_option." + error;
}
}
return null;
};
/**
* Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.ServiceOptions
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.ServiceOptions} ServiceOptions
*/
ServiceOptions.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.ServiceOptions)
return object;
var message = new $root.google.protobuf.ServiceOptions();
if (object.uninterpreted_option) {
if (!Array.isArray(object.uninterpreted_option))
throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: array expected");
message.uninterpreted_option = [];
for (var i = 0; i < object.uninterpreted_option.length; ++i) {
if (typeof object.uninterpreted_option[i] !== "object")
throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: object expected");
message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]);
}
}
return message;
};
/**
* Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.ServiceOptions
* @static
* @param {google.protobuf.ServiceOptions} message ServiceOptions
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ServiceOptions.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.uninterpreted_option = [];
if (message.uninterpreted_option && message.uninterpreted_option.length) {
object.uninterpreted_option = [];
for (var j = 0; j < message.uninterpreted_option.length; ++j)
object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options);
}
return object;
};
/**
* Converts this ServiceOptions to JSON.
* @function toJSON
* @memberof google.protobuf.ServiceOptions
* @instance
* @returns {Object.<string,*>} JSON object
*/
ServiceOptions.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return ServiceOptions;
})();
protobuf.MethodOptions = (function() {
/**
* Properties of a MethodOptions.
* @memberof google.protobuf
* @interface IMethodOptions
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpreted_option] MethodOptions uninterpreted_option
*/
/**
* Constructs a new MethodOptions.
* @memberof google.protobuf
* @classdesc Represents a MethodOptions.
* @implements IMethodOptions
* @constructor
* @param {google.protobuf.IMethodOptions=} [properties] Properties to set
*/
function MethodOptions(properties) {
this.uninterpreted_option = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* MethodOptions uninterpreted_option.
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpreted_option
* @memberof google.protobuf.MethodOptions
* @instance
*/
MethodOptions.prototype.uninterpreted_option = $util.emptyArray;
/**
* Creates a new MethodOptions instance using the specified properties.
* @function create
* @memberof google.protobuf.MethodOptions
* @static
* @param {google.protobuf.IMethodOptions=} [properties] Properties to set
* @returns {google.protobuf.MethodOptions} MethodOptions instance
*/
MethodOptions.create = function create(properties) {
return new MethodOptions(properties);
};
/**
* Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
* @function encode
* @memberof google.protobuf.MethodOptions
* @static
* @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MethodOptions.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.uninterpreted_option != null && message.uninterpreted_option.length)
for (var i = 0; i < message.uninterpreted_option.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
return writer;
};
/**
* Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.MethodOptions
* @static
* @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MethodOptions.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MethodOptions message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.MethodOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.MethodOptions} MethodOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MethodOptions.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 999:
if (!(message.uninterpreted_option && message.uninterpreted_option.length))
message.uninterpreted_option = [];
message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MethodOptions message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.MethodOptions
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.MethodOptions} MethodOptions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MethodOptions.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MethodOptions message.
* @function verify
* @memberof google.protobuf.MethodOptions
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MethodOptions.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) {
if (!Array.isArray(message.uninterpreted_option))
return "uninterpreted_option: array expected";
for (var i = 0; i < message.uninterpreted_option.length; ++i) {
var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]);
if (error)
return "uninterpreted_option." + error;
}
}
return null;
};
/**
* Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.MethodOptions
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.MethodOptions} MethodOptions
*/
MethodOptions.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.MethodOptions)
return object;
var message = new $root.google.protobuf.MethodOptions();
if (object.uninterpreted_option) {
if (!Array.isArray(object.uninterpreted_option))
throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: array expected");
message.uninterpreted_option = [];
for (var i = 0; i < object.uninterpreted_option.length; ++i) {
if (typeof object.uninterpreted_option[i] !== "object")
throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: object expected");
message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]);
}
}
return message;
};
/**
* Creates a plain object from a MethodOptions message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.MethodOptions
* @static
* @param {google.protobuf.MethodOptions} message MethodOptions
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
MethodOptions.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.uninterpreted_option = [];
if (message.uninterpreted_option && message.uninterpreted_option.length) {
object.uninterpreted_option = [];
for (var j = 0; j < message.uninterpreted_option.length; ++j)
object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options);
}
return object;
};
/**
* Converts this MethodOptions to JSON.
* @function toJSON
* @memberof google.protobuf.MethodOptions
* @instance
* @returns {Object.<string,*>} JSON object
*/
MethodOptions.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return MethodOptions;
})();
protobuf.UninterpretedOption = (function() {
/**
* Properties of an UninterpretedOption.
* @memberof google.protobuf
* @interface IUninterpretedOption
* @property {Array.<google.protobuf.UninterpretedOption.INamePart>|null} [name] UninterpretedOption name
* @property {string|null} [identifier_value] UninterpretedOption identifier_value
* @property {number|Long|null} [positive_int_value] UninterpretedOption positive_int_value
* @property {number|Long|null} [negative_int_value] UninterpretedOption negative_int_value
* @property {number|null} [double_value] UninterpretedOption double_value
* @property {Uint8Array|null} [string_value] UninterpretedOption string_value
* @property {string|null} [aggregate_value] UninterpretedOption aggregate_value
*/
/**
* Constructs a new UninterpretedOption.
* @memberof google.protobuf
* @classdesc Represents an UninterpretedOption.
* @implements IUninterpretedOption
* @constructor
* @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
*/
function UninterpretedOption(properties) {
this.name = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* UninterpretedOption name.
* @member {Array.<google.protobuf.UninterpretedOption.INamePart>} name
* @memberof google.protobuf.UninterpretedOption
* @instance
*/
UninterpretedOption.prototype.name = $util.emptyArray;
/**
* UninterpretedOption identifier_value.
* @member {string} identifier_value
* @memberof google.protobuf.UninterpretedOption
* @instance
*/
UninterpretedOption.prototype.identifier_value = "";
/**
* UninterpretedOption positive_int_value.
* @member {number|Long} positive_int_value
* @memberof google.protobuf.UninterpretedOption
* @instance
*/
UninterpretedOption.prototype.positive_int_value = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* UninterpretedOption negative_int_value.
* @member {number|Long} negative_int_value
* @memberof google.protobuf.UninterpretedOption
* @instance
*/
UninterpretedOption.prototype.negative_int_value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* UninterpretedOption double_value.
* @member {number} double_value
* @memberof google.protobuf.UninterpretedOption
* @instance
*/
UninterpretedOption.prototype.double_value = 0;
/**
* UninterpretedOption string_value.
* @member {Uint8Array} string_value
* @memberof google.protobuf.UninterpretedOption
* @instance
*/
UninterpretedOption.prototype.string_value = $util.newBuffer([]);
/**
* UninterpretedOption aggregate_value.
* @member {string} aggregate_value
* @memberof google.protobuf.UninterpretedOption
* @instance
*/
UninterpretedOption.prototype.aggregate_value = "";
/**
* Creates a new UninterpretedOption instance using the specified properties.
* @function create
* @memberof google.protobuf.UninterpretedOption
* @static
* @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
* @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance
*/
UninterpretedOption.create = function create(properties) {
return new UninterpretedOption(properties);
};
/**
* Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
* @function encode
* @memberof google.protobuf.UninterpretedOption
* @static
* @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UninterpretedOption.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && message.name.length)
for (var i = 0; i < message.name.length; ++i)
$root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.identifier_value != null && message.hasOwnProperty("identifier_value"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifier_value);
if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value"))
writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positive_int_value);
if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value"))
writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negative_int_value);
if (message.double_value != null && message.hasOwnProperty("double_value"))
writer.uint32(/* id 6, wireType 1 =*/49).double(message.double_value);
if (message.string_value != null && message.hasOwnProperty("string_value"))
writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.string_value);
if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregate_value);
return writer;
};
/**
* Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.UninterpretedOption
* @static
* @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an UninterpretedOption message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.UninterpretedOption
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.UninterpretedOption} UninterpretedOption
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UninterpretedOption.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 2:
if (!(message.name && message.name.length))
message.name = [];
message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32()));
break;
case 3:
message.identifier_value = reader.string();
break;
case 4:
message.positive_int_value = reader.uint64();
break;
case 5:
message.negative_int_value = reader.int64();
break;
case 6:
message.double_value = reader.double();
break;
case 7:
message.string_value = reader.bytes();
break;
case 8:
message.aggregate_value = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.UninterpretedOption
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.UninterpretedOption} UninterpretedOption
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an UninterpretedOption message.
* @function verify
* @memberof google.protobuf.UninterpretedOption
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UninterpretedOption.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.name != null && message.hasOwnProperty("name")) {
if (!Array.isArray(message.name))
return "name: array expected";
for (var i = 0; i < message.name.length; ++i) {
var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]);
if (error)
return "name." + error;
}
}
if (message.identifier_value != null && message.hasOwnProperty("identifier_value"))
if (!$util.isString(message.identifier_value))
return "identifier_value: string expected";
if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value"))
if (!$util.isInteger(message.positive_int_value) && !(message.positive_int_value && $util.isInteger(message.positive_int_value.low) && $util.isInteger(message.positive_int_value.high)))
return "positive_int_value: integer|Long expected";
if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value"))
if (!$util.isInteger(message.negative_int_value) && !(message.negative_int_value && $util.isInteger(message.negative_int_value.low) && $util.isInteger(message.negative_int_value.high)))
return "negative_int_value: integer|Long expected";
if (message.double_value != null && message.hasOwnProperty("double_value"))
if (typeof message.double_value !== "number")
return "double_value: number expected";
if (message.string_value != null && message.hasOwnProperty("string_value"))
if (!(message.string_value && typeof message.string_value.length === "number" || $util.isString(message.string_value)))
return "string_value: buffer expected";
if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value"))
if (!$util.isString(message.aggregate_value))
return "aggregate_value: string expected";
return null;
};
/**
* Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.UninterpretedOption
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.UninterpretedOption} UninterpretedOption
*/
UninterpretedOption.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.UninterpretedOption)
return object;
var message = new $root.google.protobuf.UninterpretedOption();
if (object.name) {
if (!Array.isArray(object.name))
throw TypeError(".google.protobuf.UninterpretedOption.name: array expected");
message.name = [];
for (var i = 0; i < object.name.length; ++i) {
if (typeof object.name[i] !== "object")
throw TypeError(".google.protobuf.UninterpretedOption.name: object expected");
message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]);
}
}
if (object.identifier_value != null)
message.identifier_value = String(object.identifier_value);
if (object.positive_int_value != null)
if ($util.Long)
(message.positive_int_value = $util.Long.fromValue(object.positive_int_value)).unsigned = true;
else if (typeof object.positive_int_value === "string")
message.positive_int_value = parseInt(object.positive_int_value, 10);
else if (typeof object.positive_int_value === "number")
message.positive_int_value = object.positive_int_value;
else if (typeof object.positive_int_value === "object")
message.positive_int_value = new $util.LongBits(object.positive_int_value.low >>> 0, object.positive_int_value.high >>> 0).toNumber(true);
if (object.negative_int_value != null)
if ($util.Long)
(message.negative_int_value = $util.Long.fromValue(object.negative_int_value)).unsigned = false;
else if (typeof object.negative_int_value === "string")
message.negative_int_value = parseInt(object.negative_int_value, 10);
else if (typeof object.negative_int_value === "number")
message.negative_int_value = object.negative_int_value;
else if (typeof object.negative_int_value === "object")
message.negative_int_value = new $util.LongBits(object.negative_int_value.low >>> 0, object.negative_int_value.high >>> 0).toNumber();
if (object.double_value != null)
message.double_value = Number(object.double_value);
if (object.string_value != null)
if (typeof object.string_value === "string")
$util.base64.decode(object.string_value, message.string_value = $util.newBuffer($util.base64.length(object.string_value)), 0);
else if (object.string_value.length)
message.string_value = object.string_value;
if (object.aggregate_value != null)
message.aggregate_value = String(object.aggregate_value);
return message;
};
/**
* Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.UninterpretedOption
* @static
* @param {google.protobuf.UninterpretedOption} message UninterpretedOption
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UninterpretedOption.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.name = [];
if (options.defaults) {
object.identifier_value = "";
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.positive_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.positive_int_value = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.negative_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.negative_int_value = options.longs === String ? "0" : 0;
object.double_value = 0;
if (options.bytes === String)
object.string_value = "";
else {
object.string_value = [];
if (options.bytes !== Array)
object.string_value = $util.newBuffer(object.string_value);
}
object.aggregate_value = "";
}
if (message.name && message.name.length) {
object.name = [];
for (var j = 0; j < message.name.length; ++j)
object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options);
}
if (message.identifier_value != null && message.hasOwnProperty("identifier_value"))
object.identifier_value = message.identifier_value;
if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value"))
if (typeof message.positive_int_value === "number")
object.positive_int_value = options.longs === String ? String(message.positive_int_value) : message.positive_int_value;
else
object.positive_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.positive_int_value) : options.longs === Number ? new $util.LongBits(message.positive_int_value.low >>> 0, message.positive_int_value.high >>> 0).toNumber(true) : message.positive_int_value;
if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value"))
if (typeof message.negative_int_value === "number")
object.negative_int_value = options.longs === String ? String(message.negative_int_value) : message.negative_int_value;
else
object.negative_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.negative_int_value) : options.longs === Number ? new $util.LongBits(message.negative_int_value.low >>> 0, message.negative_int_value.high >>> 0).toNumber() : message.negative_int_value;
if (message.double_value != null && message.hasOwnProperty("double_value"))
object.double_value = options.json && !isFinite(message.double_value) ? String(message.double_value) : message.double_value;
if (message.string_value != null && message.hasOwnProperty("string_value"))
object.string_value = options.bytes === String ? $util.base64.encode(message.string_value, 0, message.string_value.length) : options.bytes === Array ? Array.prototype.slice.call(message.string_value) : message.string_value;
if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value"))
object.aggregate_value = message.aggregate_value;
return object;
};
/**
* Converts this UninterpretedOption to JSON.
* @function toJSON
* @memberof google.protobuf.UninterpretedOption
* @instance
* @returns {Object.<string,*>} JSON object
*/
UninterpretedOption.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
UninterpretedOption.NamePart = (function() {
/**
* Properties of a NamePart.
* @memberof google.protobuf.UninterpretedOption
* @interface INamePart
* @property {string} name_part NamePart name_part
* @property {boolean} is_extension NamePart is_extension
*/
/**
* Constructs a new NamePart.
* @memberof google.protobuf.UninterpretedOption
* @classdesc Represents a NamePart.
* @implements INamePart
* @constructor
* @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
*/
function NamePart(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]];
}
/**
* NamePart name_part.
* @member {string} name_part
* @memberof google.protobuf.UninterpretedOption.NamePart
* @instance
*/
NamePart.prototype.name_part = "";
/**
* NamePart is_extension.
* @member {boolean} is_extension
* @memberof google.protobuf.UninterpretedOption.NamePart
* @instance
*/
NamePart.prototype.is_extension = false;
/**
* Creates a new NamePart instance using the specified properties.
* @function create
* @memberof google.protobuf.UninterpretedOption.NamePart
* @static
* @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
* @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance
*/
NamePart.create = function create(properties) {
return new NamePart(properties);
};
/**
* Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
* @function encode
* @memberof google.protobuf.UninterpretedOption.NamePart
* @static
* @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NamePart.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name_part);
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_extension);
return writer;
};
/**
* Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.UninterpretedOption.NamePart
* @static
* @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
NamePart.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a NamePart message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.UninterpretedOption.NamePart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NamePart.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name_part = reader.string();
break;
case 2:
message.is_extension = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("name_part"))
throw $util.ProtocolError("missing required 'name_part'", { instance: message });
if (!message.hasOwnProperty("is_extension"))
throw $util.ProtocolError("missing required 'is_extension'", { instance: message });
return message;
};
/**
* Decodes a NamePart message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.UninterpretedOption.NamePart
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
NamePart.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a NamePart message.
* @function verify
* @memberof google.protobuf.UninterpretedOption.NamePart
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
NamePart.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isString(message.name_part))
return "name_part: string expected";
if (typeof message.is_extension !== "boolean")
return "is_extension: boolean expected";
return null;
};
/**
* Creates a NamePart message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.UninterpretedOption.NamePart
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
*/
NamePart.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart)
return object;
var message = new $root.google.protobuf.UninterpretedOption.NamePart();
if (object.name_part != null)
message.name_part = String(object.name_part);
if (object.is_extension != null)
message.is_extension = Boolean(object.is_extension);
return message;
};
/**
* Creates a plain object from a NamePart message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.UninterpretedOption.NamePart
* @static
* @param {google.protobuf.UninterpretedOption.NamePart} message NamePart
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
NamePart.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.name_part = "";
object.is_extension = false;
}
if (message.name_part != null && message.hasOwnProperty("name_part"))
object.name_part = message.name_part;
if (message.is_extension != null && message.hasOwnProperty("is_extension"))
object.is_extension = message.is_extension;
return object;
};
/**
* Converts this NamePart to JSON.
* @function toJSON
* @memberof google.protobuf.UninterpretedOption.NamePart
* @instance
* @returns {Object.<string,*>} JSON object
*/
NamePart.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return NamePart;
})();
return UninterpretedOption;
})();
protobuf.SourceCodeInfo = (function() {
/**
* Properties of a SourceCodeInfo.
* @memberof google.protobuf
* @interface ISourceCodeInfo
* @property {Array.<google.protobuf.SourceCodeInfo.ILocation>|null} [location] SourceCodeInfo location
*/
/**
* Constructs a new SourceCodeInfo.
* @memberof google.protobuf
* @classdesc Represents a SourceCodeInfo.
* @implements ISourceCodeInfo
* @constructor
* @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
*/
function SourceCodeInfo(properties) {
this.location = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SourceCodeInfo location.
* @member {Array.<google.protobuf.SourceCodeInfo.ILocation>} location
* @memberof google.protobuf.SourceCodeInfo
* @instance
*/
SourceCodeInfo.prototype.location = $util.emptyArray;
/**
* Creates a new SourceCodeInfo instance using the specified properties.
* @function create
* @memberof google.protobuf.SourceCodeInfo
* @static
* @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
* @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance
*/
SourceCodeInfo.create = function create(properties) {
return new SourceCodeInfo(properties);
};
/**
* Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
* @function encode
* @memberof google.protobuf.SourceCodeInfo
* @static
* @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SourceCodeInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.location != null && message.location.length)
for (var i = 0; i < message.location.length; ++i)
$root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.SourceCodeInfo
* @static
* @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SourceCodeInfo message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.SourceCodeInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SourceCodeInfo.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.location && message.location.length))
message.location = [];
message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.SourceCodeInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SourceCodeInfo message.
* @function verify
* @memberof google.protobuf.SourceCodeInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SourceCodeInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.location != null && message.hasOwnProperty("location")) {
if (!Array.isArray(message.location))
return "location: array expected";
for (var i = 0; i < message.location.length; ++i) {
var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]);
if (error)
return "location." + error;
}
}
return null;
};
/**
* Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.SourceCodeInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
*/
SourceCodeInfo.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.SourceCodeInfo)
return object;
var message = new $root.google.protobuf.SourceCodeInfo();
if (object.location) {
if (!Array.isArray(object.location))
throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected");
message.location = [];
for (var i = 0; i < object.location.length; ++i) {
if (typeof object.location[i] !== "object")
throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected");
message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]);
}
}
return message;
};
/**
* Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.SourceCodeInfo
* @static
* @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SourceCodeInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.location = [];
if (message.location && message.location.length) {
object.location = [];
for (var j = 0; j < message.location.length; ++j)
object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options);
}
return object;
};
/**
* Converts this SourceCodeInfo to JSON.
* @function toJSON
* @memberof google.protobuf.SourceCodeInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
SourceCodeInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
SourceCodeInfo.Location = (function() {
/**
* Properties of a Location.
* @memberof google.protobuf.SourceCodeInfo
* @interface ILocation
* @property {Array.<number>|null} [path] Location path
* @property {Array.<number>|null} [span] Location span
*/
/**
* Constructs a new Location.
* @memberof google.protobuf.SourceCodeInfo
* @classdesc Represents a Location.
* @implements ILocation
* @constructor
* @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
*/
function Location(properties) {
this.path = [];
this.span = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Location path.
* @member {Array.<number>} path
* @memberof google.protobuf.SourceCodeInfo.Location
* @instance
*/
Location.prototype.path = $util.emptyArray;
/**
* Location span.
* @member {Array.<number>} span
* @memberof google.protobuf.SourceCodeInfo.Location
* @instance
*/
Location.prototype.span = $util.emptyArray;
/**
* Creates a new Location instance using the specified properties.
* @function create
* @memberof google.protobuf.SourceCodeInfo.Location
* @static
* @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
* @returns {google.protobuf.SourceCodeInfo.Location} Location instance
*/
Location.create = function create(properties) {
return new Location(properties);
};
/**
* Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
* @function encode
* @memberof google.protobuf.SourceCodeInfo.Location
* @static
* @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Location.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.path != null && message.path.length) {
writer.uint32(/* id 1, wireType 2 =*/10).fork();
for (var i = 0; i < message.path.length; ++i)
writer.int32(message.path[i]);
writer.ldelim();
}
if (message.span != null && message.span.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.span.length; ++i)
writer.int32(message.span[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.SourceCodeInfo.Location
* @static
* @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Location.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a Location message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.SourceCodeInfo.Location
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.SourceCodeInfo.Location} Location
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Location.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.path && message.path.length))
message.path = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.path.push(reader.int32());
} else
message.path.push(reader.int32());
break;
case 2:
if (!(message.span && message.span.length))
message.span = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.span.push(reader.int32());
} else
message.span.push(reader.int32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a Location message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.SourceCodeInfo.Location
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.SourceCodeInfo.Location} Location
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Location.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a Location message.
* @function verify
* @memberof google.protobuf.SourceCodeInfo.Location
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Location.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.path != null && message.hasOwnProperty("path")) {
if (!Array.isArray(message.path))
return "path: array expected";
for (var i = 0; i < message.path.length; ++i)
if (!$util.isInteger(message.path[i]))
return "path: integer[] expected";
}
if (message.span != null && message.hasOwnProperty("span")) {
if (!Array.isArray(message.span))
return "span: array expected";
for (var i = 0; i < message.span.length; ++i)
if (!$util.isInteger(message.span[i]))
return "span: integer[] expected";
}
return null;
};
/**
* Creates a Location message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.SourceCodeInfo.Location
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.SourceCodeInfo.Location} Location
*/
Location.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)
return object;
var message = new $root.google.protobuf.SourceCodeInfo.Location();
if (object.path) {
if (!Array.isArray(object.path))
throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected");
message.path = [];
for (var i = 0; i < object.path.length; ++i)
message.path[i] = object.path[i] | 0;
}
if (object.span) {
if (!Array.isArray(object.span))
throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected");
message.span = [];
for (var i = 0; i < object.span.length; ++i)
message.span[i] = object.span[i] | 0;
}
return message;
};
/**
* Creates a plain object from a Location message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.SourceCodeInfo.Location
* @static
* @param {google.protobuf.SourceCodeInfo.Location} message Location
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Location.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.path = [];
object.span = [];
}
if (message.path && message.path.length) {
object.path = [];
for (var j = 0; j < message.path.length; ++j)
object.path[j] = message.path[j];
}
if (message.span && message.span.length) {
object.span = [];
for (var j = 0; j < message.span.length; ++j)
object.span[j] = message.span[j];
}
return object;
};
/**
* Converts this Location to JSON.
* @function toJSON
* @memberof google.protobuf.SourceCodeInfo.Location
* @instance
* @returns {Object.<string,*>} JSON object
*/
Location.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return Location;
})();
return SourceCodeInfo;
})();
return protobuf;
})();
return google;
})();
return $root;
});