mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-16 17:31:24 +01:00
feat: generatePlatoons correction
This commit is contained in:
parent
2cbcfb11e3
commit
3f7f0c4826
2 changed files with 2 additions and 16 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue