mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge pull request #317 from WoodyXP/131-add-navalunitdb
131 add navalunitdb
This commit is contained in:
1
client/src/@types/unitdatabase.d.ts
vendored
1
client/src/@types/unitdatabase.d.ts
vendored
@@ -15,6 +15,7 @@ interface LoadoutBlueprint {
|
||||
interface UnitBlueprint {
|
||||
name: string;
|
||||
era?: string[];
|
||||
type?: string;
|
||||
label: string;
|
||||
shortLabel: string;
|
||||
range?: string;
|
||||
|
||||
1711
client/src/units/navalunitdatabase.ts
Normal file
1711
client/src/units/navalunitdatabase.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -37,12 +37,25 @@ 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;
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
getByRole(role: string) {
|
||||
|
||||
Reference in New Issue
Block a user