Add getAllObjects() query for the object store

This commit is contained in:
Casper Warden
2018-10-19 16:39:24 +01:00
parent 2852c76cb0
commit 2efd01dca5
10 changed files with 95 additions and 5 deletions

View File

@@ -302,12 +302,21 @@ export class RegionCommands extends CommandsBase
}
}
async getAllObjects(resolve: boolean = false): Promise<GameObject[]>
{
const objs = this.currentRegion.objects.getAllObjects();
if (resolve)
{
await this.resolveObjects(objs);
}
return objs;
}
async getObjectsInArea(minX: number, maxX: number, minY: number, maxY: number, minZ: number, maxZ: number, resolve: boolean = false): Promise<GameObject[]>
{
const objs = this.currentRegion.objects.getObjectsInArea(minX, maxX, minY, maxY, minZ, maxZ);
if (resolve)
{
console.log('Resolving ' + objs.length + ' objects');
await this.resolveObjects(objs);
}
return objs;