This commit is contained in:
Pax1601
2023-04-20 17:28:49 +02:00
10 changed files with 670 additions and 149 deletions

View File

@@ -23,6 +23,24 @@ export class UnitsManager {
document.addEventListener('deleteSelectedUnits', () => this.selectedUnitsDelete() )
}
getSelectableAircraft() {
const units = this.getUnits();
return Object.keys( units ).reduce( ( acc:{[key:number]: Unit}, unitId:any ) => {
const baseData = units[ unitId ].getBaseData();
if ( baseData.category === "Aircraft" && baseData.alive === true ) {
acc[ unitId ] = units[ unitId ];
}
return acc;
}, {});
}
getUnits() {
return this.#units;
}