mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-22 06:18:41 +00:00
Fix bugs/typos
This commit is contained in:
parent
bebfbafae8
commit
c9e439c0f4
|
|
@ -41,7 +41,7 @@ class JumpPointSearch implements PathFinderInterface
|
|||
$startNode->setF(0.0);
|
||||
$startNode->setOpened(true);
|
||||
|
||||
$openList = new Heap(function($node1, $node2) { return $node1->getF() - $nodeB->getF(); });
|
||||
$openList = new Heap(function($node1, $node2) { return $node1->getF() - $node2->getF(); });
|
||||
$openList->push($startNode);
|
||||
$node = null;
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ class JumpPointSearch implements PathFinderInterface
|
|||
|
||||
if (!$neighbor->isOpened()) {
|
||||
$openList->push($neighbor);
|
||||
$jumpPoint->setOpened(true);
|
||||
$neighbor->setOpened(true);
|
||||
} else {
|
||||
$openList->update($neighbor);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class Path
|
|||
public array $nodes = [];
|
||||
private float $weight = 0.0;
|
||||
private float $distance = 0.0;
|
||||
private ?Grid $grid = null;
|
||||
private Grid $grid;
|
||||
|
||||
public function __construct(Grid $grid)
|
||||
{
|
||||
|
|
@ -42,7 +42,7 @@ class Path
|
|||
public function expandPath() : array
|
||||
{
|
||||
$reverse = \array_reverse($this->nodes);
|
||||
$length = count($reverse);
|
||||
$length = \count($reverse);
|
||||
|
||||
if ($length < 2) {
|
||||
return $reverse;
|
||||
|
|
@ -54,7 +54,7 @@ class Path
|
|||
$coord1 = $reverse[$i + 1];
|
||||
|
||||
$interpolated = $this->interpolate($coord0, $coord1);
|
||||
$iLength = count($interpolated);
|
||||
$iLength = \count($interpolated);
|
||||
|
||||
$expanded = \array_merge($expanded, \array_slice($interpolated, 0, $iLength - 1));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user