mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +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 {
|
export interface IPlatoon {
|
||||||
|
unit: IMilitaryUnit;
|
||||||
cell: number;
|
cell: number;
|
||||||
a: number;
|
a: number;
|
||||||
t: number;
|
t: number;
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
u: string;
|
|
||||||
isNaval: boolean;
|
|
||||||
s: Logical;
|
|
||||||
type: TMilitaryUnitType;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function generateMilitary(states: TStates, burgs: TBurgs, cells: TCellsData) {
|
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 placeCell = unit.type === "naval" ? cells.haven[i] : i;
|
||||||
const [x, y] = cells.p[placeCell];
|
const [x, y] = cells.p[placeCell];
|
||||||
const isNaval = unit.type === "naval";
|
|
||||||
|
|
||||||
if (!platoons[stateId]) platoons[stateId] = [];
|
if (!platoons[stateId]) platoons[stateId] = [];
|
||||||
platoons[stateId].push({
|
platoons[stateId].push({unit, cell: i, a: total, t: total, x, y});
|
||||||
cell: i,
|
|
||||||
a: total,
|
|
||||||
t: total,
|
|
||||||
x,
|
|
||||||
y,
|
|
||||||
u: unit.name,
|
|
||||||
isNaval,
|
|
||||||
s: unit.separate,
|
|
||||||
type: unit.type
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue