loading now much more streamlined

beta.r3js.org
Theunis J. Botha 2017-06-21 12:22:39 +02:00
parent 58796b1e11
commit e09cfed52a
2 changed files with 38 additions and 1 deletions

View File

@ -557,3 +557,39 @@ GameLib.Utils.MovingAverage = function(period) {
return(sum/n);
}
};
GameLib.Utils.Intersect = function (a, b) {
var t;
/**
* Loop over shortest array
*/
if (b.length > a.length) {
t = b;
b = a;
a = t;
}
return a.filter(
/**
* Check if exists
* @param e
* @returns {boolean}
*/
function (e) {
return (b.indexOf(e) > -1);
}
).filter(
/**
* Remove Duplicates
* @param e
* @param i
* @param c
* @returns {boolean}
*/
function (e, i, c) {
return c.indexOf(e) === i;
}
);
};

View File

@ -161,7 +161,8 @@ GameLib.System.Storage.prototype.load = function(data) {
this.publish(
GameLib.Event.COMPONENT_LOADED,
{
response : object
response : object,
includeDependencies : data.includeDependencies
}
)
}