mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-15 12:05:50 +00:00
transport ship use pathfinding library
This commit is contained in:
@@ -78,7 +78,7 @@ export class PathFinder {
|
||||
private path: Tile[]
|
||||
private aStar: AStar
|
||||
|
||||
constructor() {
|
||||
constructor(private iterations: number) {
|
||||
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export class PathFinder {
|
||||
this.dst = dst
|
||||
this.path = null
|
||||
this.aStar = new AStar(curr, dst)
|
||||
if (this.aStar.compute(5000)) {
|
||||
if (this.aStar.compute(this.iterations)) {
|
||||
this.path = this.aStar.reconstructPath()
|
||||
} else {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user