Changed the function that it gets all the units with a specified range

This commit is contained in:
WoodyXP 2023-07-03 19:06:40 +02:00
parent 9f6da4845a
commit d013337c5e

View File

@ -37,12 +37,14 @@ export class UnitDatabase {
/* Gets a specific blueprint by range */
getByRange(range: string) {
var unitswithrange = [];
for (let unit in this.blueprints) {
if (this.blueprints[unit].range === range)
return this.blueprints[unit];
if (this.blueprints[unit].range === range) {
unitswithrange.push(this.blueprints[unit]);
}
}
return null;
}
return unitswithrange;
}
/* Get all blueprints by role */
getByRole(role: string) {