feat: generatePlatoons correction

This commit is contained in:
Azgaar 2022-10-12 01:24:16 +03:00
parent 2cbcfb11e3
commit 3f7f0c4826
2 changed files with 2 additions and 16 deletions

View file

@ -9,15 +9,12 @@ export type TCellsData = Pick<
>;
export interface IPlatoon {
unit: IMilitaryUnit;
cell: number;
a: number;
t: number;
x: number;
y: number;
u: string;
isNaval: boolean;
s: Logical;
type: TMilitaryUnitType;
}
export function generateMilitary(states: TStates, burgs: TBurgs, cells: TCellsData) {

View file

@ -48,20 +48,9 @@ export function generatePlatoons(states: TStates, burgs: TBurgs, unitModifiers:
const placeCell = unit.type === "naval" ? cells.haven[i] : i;
const [x, y] = cells.p[placeCell];
const isNaval = unit.type === "naval";
if (!platoons[stateId]) platoons[stateId] = [];
platoons[stateId].push({
cell: i,
a: total,
t: total,
x,
y,
u: unit.name,
isNaval,
s: unit.separate,
type: unit.type
});
platoons[stateId].push({unit, cell: i, a: total, t: total, x, y});
}
}