0ad/binaries/data/mods/public/simulation/ai/aegis/entitycollection-extend.js
Yves 3362c591f5 Moves AI players to one global using the module pattern.
This avoids wrapping overhead that would otherwise be required because
multiple globals per compartment aren't supported anymore in newer
versions of SpiderMonkey.

Check the ticket for a detailed explanation.

Closes #2322
Refs #2241
Refs #1886

This was SVN commit r14441.
2013-12-30 10:04:59 +00:00

17 lines
331 B
JavaScript

var AEGIS = function(m)
{
m.EntityCollectionFromIds = function(gameState, idList){
var ents = {};
for (var i in idList){
var id = idList[i];
if (gameState.entities._entities[id]) {
ents[id] = gameState.entities._entities[id];
}
}
return new API3.EntityCollection(gameState.sharedScript, ents);
}
return m;
}(AEGIS);