*forgot to add files*

This commit is contained in:
GameHerobrine 2022-08-28 18:43:33 +03:00
parent 70a36f8e6b
commit dda8d5e596
5 changed files with 158 additions and 0 deletions

View 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);
}
}