Documentation

Plotter
in package

Table of Contents

Methods

calculatePortToPortDistances()  : array<int, array<int, Path>>
findDistanceToOtherPorts()  : array<int, Path>
findDistanceToX()  : mixed
Returns the shortest path from $sector to $x as a Path object.
findReversiblePathToX()  : Path
Returns the shortest path from $sector to $x as a Distance object.
getX()  : mixed

Methods

calculatePortToPortDistances()

public static calculatePortToPortDistances(array<int, Port$ports, array<int, bool> $races[, int $distanceLimit = 10000 ][, int $lowLimit = 0 ][, int $highLimit = 100000 ]) : array<int, array<int, Path>>
Parameters
$ports : array<int, Port>
$races : array<int, bool>
$distanceLimit : int = 10000
$lowLimit : int = 0
$highLimit : int = 100000
Return values
array<int, array<int, Path>>

findDistanceToOtherPorts()

public static findDistanceToOtherPorts(Sector $sector[, int $distanceLimit = 10000 ][, int $lowLimit = 0 ][, int $highLimit = 100000 ]) : array<int, Path>
Parameters
$sector : Sector
$distanceLimit : int = 10000
$lowLimit : int = 0
$highLimit : int = 100000
Return values
array<int, Path>

findDistanceToX()

Returns the shortest path from $sector to $x as a Path object.

public static findDistanceToX(mixed $x, Sector $sector, bool $useFirst[, AbstractPlayer $needsToHaveBeenExploredBy = null ][, AbstractPlayer $player = null ][, int $distanceLimit = 10000 ][, int $lowLimit = 0 ][, int $highLimit = 100000 ]) : mixed

The resulting path prefers neighbors in their order in Sector->links, (i.e. up, down, left, right).

Parameters
$x : mixed

If the string 'Distance', then distances to all visited sectors will be returned. Otherwise, must be a type implemented by Sector::hasX, and will only return distances to sectors for which hasX returns true.

$sector : Sector
$useFirst : bool
$needsToHaveBeenExploredBy : AbstractPlayer = null
$player : AbstractPlayer = null
$distanceLimit : int = 10000
$lowLimit : int = 0
$highLimit : int = 100000
Tags
throws
PathNotFound

findReversiblePathToX()

Returns the shortest path from $sector to $x as a Distance object.

public static findReversiblePathToX(mixed $x, Sector $sector[, AbstractPlayer $needsToHaveBeenExploredBy = null ][, AbstractPlayer $player = null ]) : Path

The path is guaranteed reversible ($x -> $sector == $sector -> $x), which is not true for findDistanceToX. If $x is not a Sector, then this function does 2x the work.

Parameters
$x : mixed
$sector : Sector
$needsToHaveBeenExploredBy : AbstractPlayer = null
$player : AbstractPlayer = null
Tags
throws
PathNotFound
Return values
Path

        
On this page

Search results