382 lines
10 KiB
JavaScript
382 lines
10 KiB
JavaScript
/**
|
|
* @fileoverview
|
|
* @enhanceable
|
|
* @suppress {messageConventions} JS Compiler reports an error if a variable or
|
|
* field starts with 'MSG_' and isn't a translatable message.
|
|
* @public
|
|
*/
|
|
// GENERATED CODE -- DO NOT EDIT!
|
|
|
|
var jspb = require('google-protobuf');
|
|
var goog = jspb;
|
|
var global = Function('return this')();
|
|
|
|
goog.exportSymbol('proto.message.DVector2', null, global);
|
|
goog.exportSymbol('proto.message.DVector3', null, global);
|
|
|
|
/**
|
|
* Generated by JsPbCodeGenerator.
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
* valid.
|
|
* @extends {jspb.Message}
|
|
* @constructor
|
|
*/
|
|
proto.message.DVector2 = function(opt_data) {
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
};
|
|
goog.inherits(proto.message.DVector2, jspb.Message);
|
|
if (goog.DEBUG && !COMPILED) {
|
|
proto.message.DVector2.displayName = 'proto.message.DVector2';
|
|
}
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
/**
|
|
* Creates an object representation of this proto suitable for use in Soy templates.
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
* For the list of reserved names please see:
|
|
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
|
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
|
* for transitional soy proto support: http://goto/soy-param-migration
|
|
* @return {!Object}
|
|
*/
|
|
proto.message.DVector2.prototype.toObject = function(opt_includeInstance) {
|
|
return proto.message.DVector2.toObject(opt_includeInstance, this);
|
|
};
|
|
|
|
|
|
/**
|
|
* Static version of the {@see toObject} method.
|
|
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
|
* instance for transitional soy proto support:
|
|
* http://goto/soy-param-migration
|
|
* @param {!proto.message.DVector2} msg The msg instance to transform.
|
|
* @return {!Object}
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
*/
|
|
proto.message.DVector2.toObject = function(includeInstance, msg) {
|
|
var f, obj = {
|
|
x: +jspb.Message.getFieldWithDefault(msg, 1, 0.0),
|
|
y: +jspb.Message.getFieldWithDefault(msg, 2, 0.0)
|
|
};
|
|
|
|
if (includeInstance) {
|
|
obj.$jspbMessageInstance = msg;
|
|
}
|
|
return obj;
|
|
};
|
|
}
|
|
|
|
|
|
/**
|
|
* Deserializes binary data (in protobuf wire format).
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
* @return {!proto.message.DVector2}
|
|
*/
|
|
proto.message.DVector2.deserializeBinary = function(bytes) {
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
var msg = new proto.message.DVector2;
|
|
return proto.message.DVector2.deserializeBinaryFromReader(msg, reader);
|
|
};
|
|
|
|
|
|
/**
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
* given reader into the given message object.
|
|
* @param {!proto.message.DVector2} msg The message object to deserialize into.
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
* @return {!proto.message.DVector2}
|
|
*/
|
|
proto.message.DVector2.deserializeBinaryFromReader = function(msg, reader) {
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup()) {
|
|
break;
|
|
}
|
|
var field = reader.getFieldNumber();
|
|
switch (field) {
|
|
case 1:
|
|
var value = /** @type {number} */ (reader.readFloat());
|
|
msg.setX(value);
|
|
break;
|
|
case 2:
|
|
var value = /** @type {number} */ (reader.readFloat());
|
|
msg.setY(value);
|
|
break;
|
|
default:
|
|
reader.skipField();
|
|
break;
|
|
}
|
|
}
|
|
return msg;
|
|
};
|
|
|
|
|
|
/**
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
* @return {!Uint8Array}
|
|
*/
|
|
proto.message.DVector2.prototype.serializeBinary = function() {
|
|
var writer = new jspb.BinaryWriter();
|
|
proto.message.DVector2.serializeBinaryToWriter(this, writer);
|
|
return writer.getResultBuffer();
|
|
};
|
|
|
|
|
|
/**
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
* format), writing to the given BinaryWriter.
|
|
* @param {!proto.message.DVector2} message
|
|
* @param {!jspb.BinaryWriter} writer
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
*/
|
|
proto.message.DVector2.serializeBinaryToWriter = function(message, writer) {
|
|
var f = undefined;
|
|
f = message.getX();
|
|
if (f !== 0.0) {
|
|
writer.writeFloat(
|
|
1,
|
|
f
|
|
);
|
|
}
|
|
f = message.getY();
|
|
if (f !== 0.0) {
|
|
writer.writeFloat(
|
|
2,
|
|
f
|
|
);
|
|
}
|
|
};
|
|
|
|
|
|
/**
|
|
* optional float x = 1;
|
|
* @return {number}
|
|
*/
|
|
proto.message.DVector2.prototype.getX = function() {
|
|
return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 1, 0.0));
|
|
};
|
|
|
|
|
|
/** @param {number} value */
|
|
proto.message.DVector2.prototype.setX = function(value) {
|
|
jspb.Message.setProto3FloatField(this, 1, value);
|
|
};
|
|
|
|
|
|
/**
|
|
* optional float y = 2;
|
|
* @return {number}
|
|
*/
|
|
proto.message.DVector2.prototype.getY = function() {
|
|
return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 2, 0.0));
|
|
};
|
|
|
|
|
|
/** @param {number} value */
|
|
proto.message.DVector2.prototype.setY = function(value) {
|
|
jspb.Message.setProto3FloatField(this, 2, value);
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
* Generated by JsPbCodeGenerator.
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
* valid.
|
|
* @extends {jspb.Message}
|
|
* @constructor
|
|
*/
|
|
proto.message.DVector3 = function(opt_data) {
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
};
|
|
goog.inherits(proto.message.DVector3, jspb.Message);
|
|
if (goog.DEBUG && !COMPILED) {
|
|
proto.message.DVector3.displayName = 'proto.message.DVector3';
|
|
}
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
/**
|
|
* Creates an object representation of this proto suitable for use in Soy templates.
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
* For the list of reserved names please see:
|
|
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
|
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
|
* for transitional soy proto support: http://goto/soy-param-migration
|
|
* @return {!Object}
|
|
*/
|
|
proto.message.DVector3.prototype.toObject = function(opt_includeInstance) {
|
|
return proto.message.DVector3.toObject(opt_includeInstance, this);
|
|
};
|
|
|
|
|
|
/**
|
|
* Static version of the {@see toObject} method.
|
|
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
|
* instance for transitional soy proto support:
|
|
* http://goto/soy-param-migration
|
|
* @param {!proto.message.DVector3} msg The msg instance to transform.
|
|
* @return {!Object}
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
*/
|
|
proto.message.DVector3.toObject = function(includeInstance, msg) {
|
|
var f, obj = {
|
|
x: +jspb.Message.getFieldWithDefault(msg, 1, 0.0),
|
|
y: +jspb.Message.getFieldWithDefault(msg, 2, 0.0),
|
|
z: +jspb.Message.getFieldWithDefault(msg, 3, 0.0)
|
|
};
|
|
|
|
if (includeInstance) {
|
|
obj.$jspbMessageInstance = msg;
|
|
}
|
|
return obj;
|
|
};
|
|
}
|
|
|
|
|
|
/**
|
|
* Deserializes binary data (in protobuf wire format).
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
* @return {!proto.message.DVector3}
|
|
*/
|
|
proto.message.DVector3.deserializeBinary = function(bytes) {
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
var msg = new proto.message.DVector3;
|
|
return proto.message.DVector3.deserializeBinaryFromReader(msg, reader);
|
|
};
|
|
|
|
|
|
/**
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
* given reader into the given message object.
|
|
* @param {!proto.message.DVector3} msg The message object to deserialize into.
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
* @return {!proto.message.DVector3}
|
|
*/
|
|
proto.message.DVector3.deserializeBinaryFromReader = function(msg, reader) {
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup()) {
|
|
break;
|
|
}
|
|
var field = reader.getFieldNumber();
|
|
switch (field) {
|
|
case 1:
|
|
var value = /** @type {number} */ (reader.readFloat());
|
|
msg.setX(value);
|
|
break;
|
|
case 2:
|
|
var value = /** @type {number} */ (reader.readFloat());
|
|
msg.setY(value);
|
|
break;
|
|
case 3:
|
|
var value = /** @type {number} */ (reader.readFloat());
|
|
msg.setZ(value);
|
|
break;
|
|
default:
|
|
reader.skipField();
|
|
break;
|
|
}
|
|
}
|
|
return msg;
|
|
};
|
|
|
|
|
|
/**
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
* @return {!Uint8Array}
|
|
*/
|
|
proto.message.DVector3.prototype.serializeBinary = function() {
|
|
var writer = new jspb.BinaryWriter();
|
|
proto.message.DVector3.serializeBinaryToWriter(this, writer);
|
|
return writer.getResultBuffer();
|
|
};
|
|
|
|
|
|
/**
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
* format), writing to the given BinaryWriter.
|
|
* @param {!proto.message.DVector3} message
|
|
* @param {!jspb.BinaryWriter} writer
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
*/
|
|
proto.message.DVector3.serializeBinaryToWriter = function(message, writer) {
|
|
var f = undefined;
|
|
f = message.getX();
|
|
if (f !== 0.0) {
|
|
writer.writeFloat(
|
|
1,
|
|
f
|
|
);
|
|
}
|
|
f = message.getY();
|
|
if (f !== 0.0) {
|
|
writer.writeFloat(
|
|
2,
|
|
f
|
|
);
|
|
}
|
|
f = message.getZ();
|
|
if (f !== 0.0) {
|
|
writer.writeFloat(
|
|
3,
|
|
f
|
|
);
|
|
}
|
|
};
|
|
|
|
|
|
/**
|
|
* optional float x = 1;
|
|
* @return {number}
|
|
*/
|
|
proto.message.DVector3.prototype.getX = function() {
|
|
return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 1, 0.0));
|
|
};
|
|
|
|
|
|
/** @param {number} value */
|
|
proto.message.DVector3.prototype.setX = function(value) {
|
|
jspb.Message.setProto3FloatField(this, 1, value);
|
|
};
|
|
|
|
|
|
/**
|
|
* optional float y = 2;
|
|
* @return {number}
|
|
*/
|
|
proto.message.DVector3.prototype.getY = function() {
|
|
return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 2, 0.0));
|
|
};
|
|
|
|
|
|
/** @param {number} value */
|
|
proto.message.DVector3.prototype.setY = function(value) {
|
|
jspb.Message.setProto3FloatField(this, 2, value);
|
|
};
|
|
|
|
|
|
/**
|
|
* optional float z = 3;
|
|
* @return {number}
|
|
*/
|
|
proto.message.DVector3.prototype.getZ = function() {
|
|
return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 3, 0.0));
|
|
};
|
|
|
|
|
|
/** @param {number} value */
|
|
proto.message.DVector3.prototype.setZ = function(value) {
|
|
jspb.Message.setProto3FloatField(this, 3, value);
|
|
};
|
|
|
|
|
|
goog.object.extend(exports, proto.message);
|