INNER CODE UNIT · JavaScript
implement
moddio/taro · engine/components/network/net.io/net.io-server/index.js:111
var implement = function (classObj, overwrite) {
var i; var obj = classObj.prototype || classObj;
// Copy the class object's properties to (this)
for (i in obj) {
// Only copy the property if this doesn't already have it
if (obj.hasOwnProperty(i) && (overwrite || this[i] === undefined)) {
this[i] = obj[i];
}
}
return this;
};
/**
* Gets / sets a key / value pair in the object's data object. Useful for
* storing arbitrary game data in the object.
* @param {String} key The key under which the data resides.
* @param {*=} value The data to set under the specified key.