mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
stricter typehint
This commit is contained in:
parent
db48bcdb8d
commit
266ae61e53
|
|
@ -456,7 +456,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*
|
||||
* @param null|JumpPointNode $node Node to find jump point from
|
||||
* @param null|JumpPointNode $pNode Parent node
|
||||
* @param null|JumpPointNode $endNode End node to find path to
|
||||
* @param JumpPointNode $endNode End node to find path to
|
||||
* @param int $movement Movement type
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
|
|
@ -482,7 +482,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*
|
||||
* @param null|JumpPointNode $node Node to find jump point from
|
||||
* @param null|JumpPointNode $pNode Parent node
|
||||
* @param null|JumpPointNode $endNode End node to find path to
|
||||
* @param JumpPointNode $endNode End node to find path to
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return null|JumpPointNode
|
||||
|
|
@ -491,7 +491,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*/
|
||||
private static function jumpStraight(?JumpPointNode $node, ?JumpPointNode $pNode, JumpPointNode $endNode, Grid $grid) : ?JumpPointNode
|
||||
{
|
||||
if ($node === null || !$node->isWalkable()) {
|
||||
if ($node === null || $pNode === null || !$node->isWalkable()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -538,7 +538,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*
|
||||
* @param null|JumpPointNode $node Node to find jump point from
|
||||
* @param null|JumpPointNode $pNode Parent node
|
||||
* @param null|JumpPointNode $endNode End node to find path to
|
||||
* @param JumpPointNode $endNode End node to find path to
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return null|JumpPointNode
|
||||
|
|
@ -547,7 +547,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*/
|
||||
private static function jumpDiagonal(?JumpPointNode $node, ?JumpPointNode $pNode, JumpPointNode $endNode, Grid $grid) : ?JumpPointNode
|
||||
{
|
||||
if ($node === null || !$node->isWalkable()) {
|
||||
if ($node === null || $pNode === null || !$node->isWalkable()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -598,7 +598,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*
|
||||
* @param null|JumpPointNode $node Node to find jump point from
|
||||
* @param null|JumpPointNode $pNode Parent node
|
||||
* @param null|JumpPointNode $endNode End node to find path to
|
||||
* @param JumpPointNode $endNode End node to find path to
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return null|JumpPointNode
|
||||
|
|
@ -607,7 +607,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*/
|
||||
private static function jumpDiagonalOneObstacle(?JumpPointNode $node, ?JumpPointNode $pNode, JumpPointNode $endNode, Grid $grid) : ?JumpPointNode
|
||||
{
|
||||
if ($node === null || !$node->isWalkable()) {
|
||||
if ($node === null || $pNode === null || !$node->isWalkable()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -662,7 +662,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*
|
||||
* @param null|JumpPointNode $node Node to find jump point from
|
||||
* @param null|JumpPointNode $pNode Parent node
|
||||
* @param null|JumpPointNode $endNode End node to find path to
|
||||
* @param JumpPointNode $endNode End node to find path to
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return null|JumpPointNode
|
||||
|
|
@ -671,7 +671,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
*/
|
||||
private static function jumpDiagonalNoObstacle(?JumpPointNode $node, ?JumpPointNode $pNode, JumpPointNode $endNode, Grid $grid) : ?JumpPointNode
|
||||
{
|
||||
if ($node === null || !$node->isWalkable()) {
|
||||
if ($node === null || $pNode === null || !$node->isWalkable()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class Path
|
|||
/**
|
||||
* Nodes in the path
|
||||
*
|
||||
* @var Nodes[]
|
||||
* @var Node[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public array $nodes = [];
|
||||
|
|
@ -43,7 +43,7 @@ class Path
|
|||
/**
|
||||
* Nodes in the path
|
||||
*
|
||||
* @var Nodes[]
|
||||
* @var Node[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $expandedNodes = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user