mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Implemented as described in issue
This commit is contained in:
4
client/src/@types/unit.d.ts
vendored
4
client/src/@types/unit.d.ts
vendored
@@ -29,11 +29,7 @@ interface MissionData {
|
||||
}
|
||||
|
||||
interface FormationData {
|
||||
formation: string;
|
||||
isLeader: boolean;
|
||||
isWingman: boolean;
|
||||
leaderID: number;
|
||||
wingmenIDs: number[];
|
||||
}
|
||||
|
||||
interface TaskData {
|
||||
|
||||
@@ -381,57 +381,6 @@ export class HelicopterDatabase extends UnitDatabase {
|
||||
],
|
||||
"filename": "ah-1.png"
|
||||
},
|
||||
"AH-1W": {
|
||||
"name": "AH-1W",
|
||||
"label": "AH-1W Cobra",
|
||||
"shortLabel": "AH1",
|
||||
"loadouts": [
|
||||
{
|
||||
"fuel": 1,
|
||||
"items": [
|
||||
{
|
||||
"name": "BGM-71 TOW",
|
||||
"quantity": 8
|
||||
},
|
||||
{
|
||||
"name": "Hydra-70 WP",
|
||||
"quantity": 38
|
||||
}
|
||||
],
|
||||
"roles": [
|
||||
"CAS"
|
||||
],
|
||||
"code": "8xBGM-71, 38xHYDRA-70 WP",
|
||||
"name": "TOW / Hydra"
|
||||
},
|
||||
{
|
||||
"fuel": 1,
|
||||
"items": [
|
||||
{
|
||||
"name": "Hydra-70",
|
||||
"quantity": 76
|
||||
}
|
||||
],
|
||||
"roles": [
|
||||
"CAS"
|
||||
],
|
||||
"code": "76xHYDRA-70",
|
||||
"name": "Hydra"
|
||||
},
|
||||
{
|
||||
"fuel": 1,
|
||||
"items": [
|
||||
|
||||
],
|
||||
"roles": [
|
||||
""
|
||||
],
|
||||
"code": "",
|
||||
"name": "Empty Loadout"
|
||||
}
|
||||
],
|
||||
"filename": "ah-1.png"
|
||||
},
|
||||
"Mi-26": {
|
||||
"name": "Mi-26",
|
||||
"label": "Mi-26 Halo",
|
||||
|
||||
@@ -40,11 +40,7 @@ export class Unit extends Marker {
|
||||
coalition: "",
|
||||
},
|
||||
formationData: {
|
||||
formation: "",
|
||||
isLeader: false,
|
||||
isWingman: false,
|
||||
leaderID: 0,
|
||||
wingmenIDs: [],
|
||||
leaderID: 0
|
||||
},
|
||||
taskData: {
|
||||
currentState: "IDLE",
|
||||
@@ -315,22 +311,6 @@ export class Unit extends Marker {
|
||||
return getUnitsManager().getUnitByID(this.getFormationData().leaderID);
|
||||
}
|
||||
|
||||
getFormation() {
|
||||
return [<Unit>this].concat(this.getWingmen())
|
||||
}
|
||||
|
||||
getWingmen() {
|
||||
var wingmen: Unit[] = [];
|
||||
if (this.getFormationData().wingmenIDs != undefined) {
|
||||
for (let ID of this.getFormationData().wingmenIDs) {
|
||||
var unit = getUnitsManager().getUnitByID(ID)
|
||||
if (unit)
|
||||
wingmen.push(unit);
|
||||
}
|
||||
}
|
||||
return wingmen;
|
||||
}
|
||||
|
||||
attackUnit(targetID: number) {
|
||||
/* Units can't attack themselves */
|
||||
if (this.ID != targetID) {
|
||||
|
||||
@@ -119,35 +119,7 @@ export class UnitsManager {
|
||||
this.#units[ID].setSelected(false);
|
||||
}
|
||||
}
|
||||
|
||||
getSelectedLeaders() {
|
||||
var leaders: Unit[] = [];
|
||||
for (let idx in this.getSelectedUnits())
|
||||
{
|
||||
var unit = this.getSelectedUnits()[idx];
|
||||
if (unit.getFormationData().isLeader)
|
||||
leaders.push(unit);
|
||||
else if (unit.getFormationData().isWingman)
|
||||
{
|
||||
var leader = unit.getLeader();
|
||||
if (leader && !leaders.includes(leader))
|
||||
leaders.push(leader);
|
||||
}
|
||||
}
|
||||
return leaders;
|
||||
}
|
||||
|
||||
getSelectedSingletons() {
|
||||
var singletons: Unit[] = [];
|
||||
for (let idx in this.getSelectedUnits())
|
||||
{
|
||||
var unit = this.getSelectedUnits()[idx];
|
||||
if (!unit.getFormationData().isLeader && !unit.getFormationData().isWingman)
|
||||
singletons.push(unit);
|
||||
}
|
||||
return singletons;
|
||||
}
|
||||
|
||||
|
||||
getSelectedUnitsType () {
|
||||
if (this.getSelectedUnits().length == 0)
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user