Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame^] | 1 | <?php |
| 2 | // automatically generated by the FlatBuffers compiler, do not modify |
| 3 | |
| 4 | namespace MyGame\Example; |
| 5 | |
| 6 | use \Google\FlatBuffers\Struct; |
| 7 | use \Google\FlatBuffers\Table; |
| 8 | use \Google\FlatBuffers\ByteBuffer; |
| 9 | use \Google\FlatBuffers\FlatBufferBuilder; |
| 10 | |
| 11 | class Referrable extends Table |
| 12 | { |
| 13 | /** |
| 14 | * @param ByteBuffer $bb |
| 15 | * @return Referrable |
| 16 | */ |
| 17 | public static function getRootAsReferrable(ByteBuffer $bb) |
| 18 | { |
| 19 | $obj = new Referrable(); |
| 20 | return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb)); |
| 21 | } |
| 22 | |
| 23 | public static function ReferrableIdentifier() |
| 24 | { |
| 25 | return "MONS"; |
| 26 | } |
| 27 | |
| 28 | public static function ReferrableBufferHasIdentifier(ByteBuffer $buf) |
| 29 | { |
| 30 | return self::__has_identifier($buf, self::ReferrableIdentifier()); |
| 31 | } |
| 32 | |
| 33 | public static function ReferrableExtension() |
| 34 | { |
| 35 | return "mon"; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * @param int $_i offset |
| 40 | * @param ByteBuffer $_bb |
| 41 | * @return Referrable |
| 42 | **/ |
| 43 | public function init($_i, ByteBuffer $_bb) |
| 44 | { |
| 45 | $this->bb_pos = $_i; |
| 46 | $this->bb = $_bb; |
| 47 | return $this; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @return ulong |
| 52 | */ |
| 53 | public function getId() |
| 54 | { |
| 55 | $o = $this->__offset(4); |
| 56 | return $o != 0 ? $this->bb->getUlong($o + $this->bb_pos) : 0; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @param FlatBufferBuilder $builder |
| 61 | * @return void |
| 62 | */ |
| 63 | public static function startReferrable(FlatBufferBuilder $builder) |
| 64 | { |
| 65 | $builder->StartObject(1); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @param FlatBufferBuilder $builder |
| 70 | * @return Referrable |
| 71 | */ |
| 72 | public static function createReferrable(FlatBufferBuilder $builder, $id) |
| 73 | { |
| 74 | $builder->startObject(1); |
| 75 | self::addId($builder, $id); |
| 76 | $o = $builder->endObject(); |
| 77 | return $o; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @param FlatBufferBuilder $builder |
| 82 | * @param ulong |
| 83 | * @return void |
| 84 | */ |
| 85 | public static function addId(FlatBufferBuilder $builder, $id) |
| 86 | { |
| 87 | $builder->addUlongX(0, $id, 0); |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * @param FlatBufferBuilder $builder |
| 92 | * @return int table offset |
| 93 | */ |
| 94 | public static function endReferrable(FlatBufferBuilder $builder) |
| 95 | { |
| 96 | $o = $builder->endObject(); |
| 97 | return $o; |
| 98 | } |
| 99 | } |