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|null $needsToHaveBeenExploredBy = null ][, AbstractPlayer|null $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 = null
- $player : AbstractPlayer|null = null
- $distanceLimit : int = 10000
- $lowLimit : int = 0
- $highLimit : int = 100000
Tags
findReversiblePathToX()
Returns the shortest path from $sector to $x as a Distance object.
public
static findReversiblePathToX(mixed $x, Sector $sector[, AbstractPlayer|null $needsToHaveBeenExploredBy = null ][, AbstractPlayer|null $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 = null
- $player : AbstractPlayer|null = null
Tags
Return values
PathgetX()
public
static getX(PlotGroup $xType, int|string $X, int $gameID[, AbstractPlayer|null $player = null ]) : mixed
Parameters
- $xType : PlotGroup
- $X : int|string
- $gameID : int
- $player : AbstractPlayer|null = null