content/hifi-public/cozza13/solarsystem/app/Entity/Identifier.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

49 lines
No EOL
1.1 KiB
JavaScript

//
// webView.js
//
// version 0.1
//
// Created by Victor Kislichenko, April 2015
//
// Presents the Entity Identifier for the stage script
//
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
StageEntityIdentifier = (function() {
//public functions
var that = {
entities : [],
callback : {
progress : null,
done : null,
}
};
that.process = function(callback) {
that.callback = callback;
that.check();
}
that.check = function()
{
//calc identified entities
var identified = 0;
for(var i in that.entities) {
if(that.entities[i].entity.isKnownID) identified++;
}
if(identified === that.entities.length) {
if(that.callback.done) that.callback.done.apply(that);
} else {
if(that.callback.progress) that.callback.progress.apply(that, [identified, that.entities.length]);
Script.setTimeout(that.check, 1000);
}
}
return that;
});