<commit_before>/*
 * MelonJS Game Engine
 * Copyright (C) 2011 - 2017 <NAME>
 * http://www.melonjs.org
 *
 */
(function () {
    /**
     * A Vector3d object that provide notification by executing the given callback when the vector is changed.
     * @class
     * @extends me.Vector3d
     * @constructor
     * @param {Number} [x=0] x value of the vector
     * @param {Number} [y=0] y value of the vector
     * @param {Number} [z=0] z value of the vector
     * @param {Object} settings additional required parameters
     * @param {Function} settings.onUpdate the callback to be executed when the vector is changed
     */
    me.ObservableVector3d = me.Vector3d.extend({
    /** @scope me.ObservableVector3d.prototype */

        /**
         * @ignore
         */
        init : function (x, y, z, settings) {
            /**
             * x value of the vector
             * @public
             * @type Number
             * @name x
             * @memberOf me.ObservableVector3d
             */
            Object.defineProperty(this, "x", {
                /**
                 * @ignore
                 */
                get : function () {
                    return this._x;
                },
                /**
                 * @ignore
                 */
                set : function (value) {
                    var ret = this.onUpdate(value, this._y, this._z, this._x, this._y, this._z);
                    if (ret && "x" in ret) {
                        this._x = ret.x;
                    } else {
                        this._x = value
                    }
                }
            });

            /**
             * y value of the vector
             * @public
             * @type Number
             * @name y
             * @memberOf me.ObservableVector3d
             */
            Object.defineProperty(this, "y", {
                /**
                 * @ignore
                 */
                get : function () {
                    return this._y;
                },
                /**
                 * @ignore
                 */
                set : function (value) {
                    var ret = this.onUpdate(this._x, value, this._z, this._x, this._y, this._z);
                    if (ret && "y" in ret) {
                        this._y = ret.y;
                    } else {
                        this._y = value
                    }
                }
            });

            /**
             * z value of the vector
             * @public
             * @type Number
             * @name z
             * @memberOf me.ObservableVector3d
             */
            Object.defineProperty(this, "z", {
                /**
                 * @ignore
                 */
                get : function () {
                    return this._z;
                },
                /**
                 * @ignore
                 */
                set : function (value) {
                    var ret = this.onUpdate(this._x, this._y, value, this._x, this._y, this._z);
                    if (ret && "z" in ret) {
                        this._z = ret.z;
                    } else {
                        this._z = value
                    }

                }
            });

            if (typeof(settings) === "undefined") {
                throw new me.ObservableVector3d.Error(
                    "undefined `onUpdate` callback"
                );
            }
            this.setCallback(settings.onUpdate);
            this._x = x || 0;
            this._y = y || 0;
            this._z = z || 0;
        },

        /**
         * @ignore */
        _set : function (x, y, z) {
            var ret = this.onUpdate(x, y, z, this._x, this._y, this._z);
            if (ret && "x" in ret && "y" in ret && "z" in ret) {
                this._x = ret.x;
                this._y = ret.y;
                this._z = ret.z;
            } else {
              this._x = x;
              this._y = y;
              this._z = z;
            }
            return this;
        },

        /**
         * set the vector value without triggering the callback
         * @name setMuted
         * @memberOf me.ObservableVector3d
         * @function
         * @param {Number} x x value of the vector
         * @param {Number} y y value of the vector
         * @param {Number} z z value of the vector
         * @return {me.ObservableVector2d} Reference to this object for method chaining
         */
        setMuted : function (x, y, z) {
            this._x = x;
            this._y = y;
            this._z = z;
            return this;
        },

        /**
         * set the callback to be executed when the vector is changed
         * @name setCallback
         * @memberOf me.ObservableVector3d
         * @function
         * @param {function} onUpdate callback
         * @return {me.ObservableVector2d} Reference to this object for method chaining
         */
        setCallback : function (fn) {
            if (typeof(fn) !== "function") {
                throw new me.ObservableVector2d.Error(
                    "invalid `onUpdate` callback"
                );
            }
            this.onUpdate = fn;
            return this;
        },

        /**
         * Add the passed vector to this vector
         * @name add
         * @memberOf me.ObservableVector3d
         * @function
         * @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
         * @return {me.ObservableVector3d} Reference to this object for method chaining
         */
        add : function (v) {
            return this._set(this._x + v.x, this._y + v.y, this._z + (v.z || 0));
        },

        /**
         * Substract the passed vector to this vector
         * @name sub
         * @memberOf me.ObservableVector3d
         * @function
         * @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
         * @return {me.ObservableVector3d} Reference to this object for method chaining
         */
        sub : function (v) {<commit_msg>documentation fix<commit_after>/*
 * MelonJS Game Engine
 * Copyright (C) 2011 - 2017 <NAME>
 * http://www.melonjs.org
 *
 */
(function () {
    /**
     * A Vector3d object that provide notification by executing the given callback when the vector is changed.
     * @class
     * @extends me.Vector3d
     * @constructor
     * @param {Number} [x=0] x value of the vector
     * @param {Number} [y=0] y value of the vector
     * @param {Number} [z=0] z value of the vector
     * @param {Object} settings additional required parameters
     * @param {Function} settings.onUpdate the callback to be executed when the vector is changed
     */
    me.ObservableVector3d = me.Vector3d.extend({
    /** @scope me.ObservableVector3d.prototype */

        /**
         * @ignore
         */
        init : function (x, y, z, settings) {
            /**
             * x value of the vector
             * @public
             * @type Number
             * @name x
             * @memberOf me.ObservableVector3d
             */
            Object.defineProperty(this, "x", {
                /**
                 * @ignore
                 */
                get : function () {
                    return this._x;
                },
                /**
                 * @ignore
                 */
                set : function (value) {
                    var ret = this.onUpdate(value, this._y, this._z, this._x, this._y, this._z);
                    if (ret && "x" in ret) {
                        this._x = ret.x;
                    } else {
                        this._x = value
                    }
                }
            });

            /**
             * y value of the vector
             * @public
             * @type Number
             * @name y
             * @memberOf me.ObservableVector3d
             */
            Object.defineProperty(this, "y", {
                /**
                 * @ignore
                 */
                get : function () {
                    return this._y;
                },
                /**
                 * @ignore
                 */
                set : function (value) {
                    var ret = this.onUpdate(this._x, value, this._z, this._x, this._y, this._z);
                    if (ret && "y" in ret) {
                        this._y = ret.y;
                    } else {
                        this._y = value
                    }
                }
            });

            /**
             * z value of the vector
             * @public
             * @type Number
             * @name z
             * @memberOf me.ObservableVector3d
             */
            Object.defineProperty(this, "z", {
                /**
                 * @ignore
                 */
                get : function () {
                    return this._z;
                },
                /**
                 * @ignore
                 */
                set : function (value) {
                    var ret = this.onUpdate(this._x, this._y, value, this._x, this._y, this._z);
                    if (ret && "z" in ret) {
                        this._z = ret.z;
                    } else {
                        this._z = value
                    }

                }
            });

            if (typeof(settings) === "undefined") {
                throw new me.ObservableVector3d.Error(
                    "undefined `onUpdate` callback"
                );
            }
            this.setCallback(settings.onUpdate);
            this._x = x || 0;
            this._y = y || 0;
            this._z = z || 0;
        },

        /**
         * @ignore */
        _set : function (x, y, z) {
            var ret = this.onUpdate(x, y, z, this._x, this._y, this._z);
            if (ret && "x" in ret && "y" in ret && "z" in ret) {
                this._x = ret.x;
                this._y = ret.y;
                this._z = ret.z;
            } else {
              this._x = x;
              this._y = y;
              this._z = z;
            }
            return this;
        },

        /**
         * set the vector value without triggering the callback
         * @name setMuted
         * @memberOf me.ObservableVector3d
         * @function
         * @param {Number} x x value of the vector
         * @param {Number} y y value of the vector
         * @param {Number} z z value of the vector
         * @return {me.ObservableVector3d} Reference to this object for method chaining
         */
        setMuted : function (x, y, z) {
            this._x = x;
            this._y = y;
            this._z = z;
            return this;
        },

        /**
         * set the callback to be executed when the vector is changed
         * @name setCallback
         * @memberOf me.ObservableVector3d
         * @function
         * @param {function} onUpdate callback
         * @return {me.ObservableVector3d} Reference to this object for method chaining
         */
        setCallback : function (fn) {
            if (typeof(fn) !== "function") {
                throw new me.ObservableVector3d.Error(
                    "invalid `onUpdate` callback"
                );
            }
            this.onUpdate = fn;
            return this;
        },

        /**
         * Add the passed vector to this vector
         * @name add
         * @memberOf me.ObservableVector3d
         * @function
         * @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
         * @return {me.ObservableVector3d} Reference to this object for method chaining
         */
        add : function (v) {
            return this._set(this._x + v.x, this._y + v.y, this._z + (v.z || 0));
        },

        /**
         * Substract the passed vector to this vector
         * @name sub
         * @memberOf me.ObservableVector3d
         * @function
         * @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
         * @return {me.ObservableVector3d} Reference to this object for method chaining
         */
        sub : function (v) {
{'fraction_non_alphanumeric': 0.1057391876336129, 'fraction_numerical': 0.006742312119717151, 'mean_word_length': 1.0312291249164998, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7533403', 'n_tokens_mistral': 3293, 'n_tokens_neox': 3147, 'n_words': 867}