mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
83 lines
1.8 KiB
PHP
83 lines
1.8 KiB
PHP
<?php
|
|
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
use \Google\FlatBuffers\Struct;
|
|
use \Google\FlatBuffers\Table;
|
|
use \Google\FlatBuffers\ByteBuffer;
|
|
use \Google\FlatBuffers\FlatBufferBuilder;
|
|
|
|
class Galaxy extends Table
|
|
{
|
|
/**
|
|
* @param ByteBuffer $bb
|
|
* @return Galaxy
|
|
*/
|
|
public static function getRootAsGalaxy(ByteBuffer $bb)
|
|
{
|
|
$obj = new Galaxy();
|
|
return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
|
|
}
|
|
|
|
/**
|
|
* @param int $_i offset
|
|
* @param ByteBuffer $_bb
|
|
* @return Galaxy
|
|
**/
|
|
public function init($_i, ByteBuffer $_bb)
|
|
{
|
|
$this->bb_pos = $_i;
|
|
$this->bb = $_bb;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return long
|
|
*/
|
|
public function getNumStars()
|
|
{
|
|
$o = $this->__offset(4);
|
|
return $o != 0 ? $this->bb->getLong($o + $this->bb_pos) : 0;
|
|
}
|
|
|
|
/**
|
|
* @param FlatBufferBuilder $builder
|
|
* @return void
|
|
*/
|
|
public static function startGalaxy(FlatBufferBuilder $builder)
|
|
{
|
|
$builder->StartObject(1);
|
|
}
|
|
|
|
/**
|
|
* @param FlatBufferBuilder $builder
|
|
* @return Galaxy
|
|
*/
|
|
public static function createGalaxy(FlatBufferBuilder $builder, $num_stars)
|
|
{
|
|
$builder->startObject(1);
|
|
self::addNumStars($builder, $num_stars);
|
|
$o = $builder->endObject();
|
|
return $o;
|
|
}
|
|
|
|
/**
|
|
* @param FlatBufferBuilder $builder
|
|
* @param long
|
|
* @return void
|
|
*/
|
|
public static function addNumStars(FlatBufferBuilder $builder, $numStars)
|
|
{
|
|
$builder->addLongX(0, $numStars, 0);
|
|
}
|
|
|
|
/**
|
|
* @param FlatBufferBuilder $builder
|
|
* @return int table offset
|
|
*/
|
|
public static function endGalaxy(FlatBufferBuilder $builder)
|
|
{
|
|
$o = $builder->endObject();
|
|
return $o;
|
|
}
|
|
}
|