mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41:23 +01:00
refactor: format findPath call for improved readability
This commit is contained in:
parent
edb369b4ae
commit
e90a2594e0
1 changed files with 6 additions and 1 deletions
|
|
@ -374,7 +374,12 @@ class RoutesModule {
|
|||
exit: number;
|
||||
}) {
|
||||
const getCost = this.createCostEvaluator({ isWater, connections });
|
||||
const pathCells = findPath(start, (current) => current === exit, getCost, pack);
|
||||
const pathCells = findPath(
|
||||
start,
|
||||
(current) => current === exit,
|
||||
getCost,
|
||||
pack,
|
||||
);
|
||||
if (!pathCells) return [];
|
||||
const segments = this.getRouteSegments(pathCells, connections);
|
||||
return segments;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue