pocketmine\utils\VectorIterator::next PHP Метод

next() публичный Метод

public next ( )
    public function next()
    {
        $this->scan();
        if ($this->currentBlock <= -1) {
            throw new \OutOfBoundsException();
        } else {
            $this->currentBlockObject = $this->positionQueue[$this->currentBlock--];
        }
    }

Usage Example

Пример #1
0
 private function getAvailableBlockSpace(ChunkManager $level, Vector3 $from, Vector3 $to)
 {
     $count = 0;
     $iter = new VectorIterator($level, $from, $to);
     while ($iter->valid()) {
         $iter->next();
         $pos = $iter->current();
         if (!isset($this->overridable[$level->getBlockIdAt($pos->x, $pos->y, $pos->z)])) {
             return $count;
         }
         $count++;
     }
     return -1;
 }