mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Update editEntitiesWithTag to use static lookup table
This commit is contained in:
parent
1f25ba8f1f
commit
0234747ec3
1 changed files with 12 additions and 6 deletions
|
@ -201,12 +201,18 @@ function deleteEntitiesWithTag(tag) {
|
|||
}
|
||||
}
|
||||
function editEntitiesWithTag(tag, propertiesOrFn) {
|
||||
var entityIDs = findEntitiesWithTag(tag);
|
||||
for (var i = 0; i < entityIDs.length; ++i) {
|
||||
if (isFunction(propertiesOrFn)) {
|
||||
Entities.editEntity(entityIDs[i], propertiesOrFn(entityIDs[i]));
|
||||
} else {
|
||||
Entities.editEntity(entityIDs[i], propertiesOrFn);
|
||||
//var entityIDs = findEntitiesWithTag(tag);
|
||||
var entities = TUTORIAL_TAG_TO_ENTITY_IDS_MAP[tag];
|
||||
|
||||
debug("Editing tag: ", tag);
|
||||
if (entities) {
|
||||
for (entityID in entities) {
|
||||
debug("Editing: ", entityID, ", ", propertiesOrFn, ", Is in local tree: ", isEntityInLocalTree(entityID));
|
||||
if (isFunction(propertiesOrFn)) {
|
||||
Entities.editEntity(entityID, propertiesOrFn(entityIDs[i]));
|
||||
} else {
|
||||
Entities.editEntity(entityID, propertiesOrFn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue