loading now much more streamlined
parent
58796b1e11
commit
e09cfed52a
|
@ -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;
|
||||
}
|
||||
);
|
||||
};
|
|
@ -161,7 +161,8 @@ GameLib.System.Storage.prototype.load = function(data) {
|
|||
this.publish(
|
||||
GameLib.Event.COMPONENT_LOADED,
|
||||
{
|
||||
response : object
|
||||
response : object,
|
||||
includeDependencies : data.includeDependencies
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue