Path
in package
Class used to keep track of paths between two sectors.
Used by the Plotter class to store the state of a plotted course.
Table of Contents
Properties
Methods
- __construct() : mixed
- addLink() : void
- Add a neighboring sector to the path.
- addWarp() : void
- Add a warp to the path.
- followPath() : void
- getDistance() : int
- getEndSectorID() : int
- getLength() : int
- Returns the number of sectors to get to the end of the path (does not include the start sector).
- getNextOnPath() : int
- getNumWarps() : int
- getPath() : array<int, int>
- getStartSectorID() : int
- getTurns() : int
- isInPath() : bool
- reversePath() : void
- skipToSector() : self
- If the given sector is in the path, then return the segment of the path that comes after the given sector.
Properties
$numWarps
private
int
$numWarps
= 0
$path
private
array<int, int>
$path
$warpMap
private
array<int, int>
$warpMap
= []
Methods
__construct()
public
__construct(int $startSectorID) : mixed
Parameters
- $startSectorID : int
addLink()
Add a neighboring sector to the path.
public
addLink(int $nextSector) : void
Parameters
- $nextSector : int
addWarp()
Add a warp to the path.
public
addWarp(int $nextSector) : void
Parameters
- $nextSector : int
followPath()
public
followPath() : void
getDistance()
public
getDistance() : int
Return values
intgetEndSectorID()
public
getEndSectorID() : int
Return values
intgetLength()
Returns the number of sectors to get to the end of the path (does not include the start sector).
public
getLength() : int
Return values
intgetNextOnPath()
public
getNextOnPath() : int
Return values
intgetNumWarps()
public
getNumWarps() : int
Return values
intgetPath()
public
getPath() : array<int, int>
Return values
array<int, int>getStartSectorID()
public
getStartSectorID() : int
Return values
intgetTurns()
public
getTurns() : int
Return values
intisInPath()
public
isInPath(int $sectorID) : bool
Parameters
- $sectorID : int
Return values
boolreversePath()
public
reversePath() : void
skipToSector()
If the given sector is in the path, then return the segment of the path that comes after the given sector.
public
skipToSector(int $sectorID) : self
Parameters
- $sectorID : int