Merge pull request #317 from WoodyXP/131-add-navalunitdb

131 add navalunitdb
This commit is contained in:
Pax1601
2023-07-06 13:08:48 +02:00
committed by GitHub
4 changed files with 14366 additions and 12641 deletions

View File

@@ -15,6 +15,7 @@ interface LoadoutBlueprint {
interface UnitBlueprint { interface UnitBlueprint {
name: string; name: string;
era?: string[]; era?: string[];
type?: string;
label: string; label: string;
shortLabel: string; shortLabel: string;
range?: string; range?: string;

File diff suppressed because it is too large Load Diff

View File

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