mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
21 lines
No EOL
489 B
PHP
21 lines
No EOL
489 B
PHP
<?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);
|
|
}
|
|
} |