James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -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 StructOfStructs extends Struct |
| 12 | { |
| 13 | /** |
| 14 | * @param int $_i offset |
| 15 | * @param ByteBuffer $_bb |
| 16 | * @return StructOfStructs |
| 17 | **/ |
| 18 | public function init($_i, ByteBuffer $_bb) |
| 19 | { |
| 20 | $this->bb_pos = $_i; |
| 21 | $this->bb = $_bb; |
| 22 | return $this; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @return Ability |
| 27 | */ |
| 28 | public function getA() |
| 29 | { |
| 30 | $obj = new Ability(); |
| 31 | $obj->init($this->bb_pos + 0, $this->bb); |
| 32 | return $obj; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @return Test |
| 37 | */ |
| 38 | public function getB() |
| 39 | { |
| 40 | $obj = new Test(); |
| 41 | $obj->init($this->bb_pos + 8, $this->bb); |
| 42 | return $obj; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * @return Ability |
| 47 | */ |
| 48 | public function getC() |
| 49 | { |
| 50 | $obj = new Ability(); |
| 51 | $obj->init($this->bb_pos + 12, $this->bb); |
| 52 | return $obj; |
| 53 | } |
| 54 | |
| 55 | |
| 56 | /** |
| 57 | * @return int offset |
| 58 | */ |
| 59 | public static function createStructOfStructs(FlatBufferBuilder $builder, $a_id, $a_distance, $b_a, $b_b, $c_id, $c_distance) |
| 60 | { |
| 61 | $builder->prep(4, 20); |
| 62 | $builder->prep(4, 8); |
| 63 | $builder->putUint($c_distance); |
| 64 | $builder->putUint($c_id); |
| 65 | $builder->prep(2, 4); |
| 66 | $builder->pad(1); |
| 67 | $builder->putSbyte($b_b); |
| 68 | $builder->putShort($b_a); |
| 69 | $builder->prep(4, 8); |
| 70 | $builder->putUint($a_distance); |
| 71 | $builder->putUint($a_id); |
| 72 | return $builder->offset(); |
| 73 | } |
| 74 | } |