Documentation

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

$numWarps  : int
$path  : array<int, int>
$warpMap  : array<int, int>

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

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
int

getEndSectorID()

public getEndSectorID() : int
Return values
int

getLength()

Returns the number of sectors to get to the end of the path (does not include the start sector).

public getLength() : int
Return values
int

getNextOnPath()

public getNextOnPath() : int
Return values
int

getNumWarps()

public getNumWarps() : int
Return values
int

getPath()

public getPath() : array<int, int>
Return values
array<int, int>

getStartSectorID()

public getStartSectorID() : int
Return values
int

getTurns()

public getTurns() : int
Return values
int

isInPath()

public isInPath(int $sectorID) : bool
Parameters
$sectorID : int
Return values
bool

reversePath()

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
Return values
self

        
On this page

Search results