mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
*forgot to add files*
This commit is contained in:
parent
70a36f8e6b
commit
dda8d5e596
5 changed files with 158 additions and 0 deletions
21
src/utils/pathfinder/Path.php
Normal file
21
src/utils/pathfinder/Path.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
class Path{
|
||||
public $points = [];
|
||||
public $currentPointIndex = 0;
|
||||
public function addPoint(Node $point){
|
||||
$this->points[] = $point;
|
||||
}
|
||||
|
||||
public function getPointAndIncreaseIndex(){
|
||||
return $this->points[$this->currentPointIndex++];
|
||||
}
|
||||
|
||||
public function increaseIndexAndGetPoint(){
|
||||
return isset($this->points[$this->currentPointIndex + 1]) ? $this->points[++$this->currentPointIndex] : null;
|
||||
}
|
||||
|
||||
public function finish(){
|
||||
$this->points = array_reverse($this->points);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue