1<?php
2// automatically generated by the FlatBuffers compiler, do not modify
3
4namespace MyGame\Example;
5
6use \Google\FlatBuffers\Struct;
7use \Google\FlatBuffers\Table;
8use \Google\FlatBuffers\ByteBuffer;
9use \Google\FlatBuffers\FlatBufferBuilder;
10
11/// an example documentation comment: "monster object"
12class Monster extends Table
13{
14    /**
15     * @param ByteBuffer $bb
16     * @return Monster
17     */
18    public static function getRootAsMonster(ByteBuffer $bb)
19    {
20        $obj = new Monster();
21        return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
22    }
23
24    public static function MonsterIdentifier()
25    {
26        return "MONS";
27    }
28
29    public static function MonsterBufferHasIdentifier(ByteBuffer $buf)
30    {
31        return self::__has_identifier($buf, self::MonsterIdentifier());
32    }
33
34    public static function MonsterExtension()
35    {
36        return "mon";
37    }
38
39    /**
40     * @param int $_i offset
41     * @param ByteBuffer $_bb
42     * @return Monster
43     **/
44    public function init($_i, ByteBuffer $_bb)
45    {
46        $this->bb_pos = $_i;
47        $this->bb = $_bb;
48        return $this;
49    }
50
51    public function getPos()
52    {
53        $obj = new Vec3();
54        $o = $this->__offset(4);
55        return $o != 0 ? $obj->init($o + $this->bb_pos, $this->bb) : 0;
56    }
57
58    /**
59     * @return short
60     */
61    public function getMana()
62    {
63        $o = $this->__offset(6);
64        return $o != 0 ? $this->bb->getShort($o + $this->bb_pos) : 150;
65    }
66
67    /**
68     * @return short
69     */
70    public function getHp()
71    {
72        $o = $this->__offset(8);
73        return $o != 0 ? $this->bb->getShort($o + $this->bb_pos) : 100;
74    }
75
76    public function getName()
77    {
78        $o = $this->__offset(10);
79        return $o != 0 ? $this->__string($o + $this->bb_pos) : null;
80    }
81
82    /**
83     * @param int offset
84     * @return byte
85     */
86    public function getInventory($j)
87    {
88        $o = $this->__offset(14);
89        return $o != 0 ? $this->bb->getByte($this->__vector($o) + $j * 1) : 0;
90    }
91
92    /**
93     * @return int
94     */
95    public function getInventoryLength()
96    {
97        $o = $this->__offset(14);
98        return $o != 0 ? $this->__vector_len($o) : 0;
99    }
100
101    /**
102     * @return string
103     */
104    public function getInventoryBytes()
105    {
106        return $this->__vector_as_bytes(14);
107    }
108
109    /**
110     * @return byte
111     */
112    public function getColor()
113    {
114        $o = $this->__offset(16);
115        return $o != 0 ? $this->bb->getByte($o + $this->bb_pos) : \MyGame\Example\Color::Blue;
116    }
117
118    /**
119     * @return byte
120     */
121    public function getTestType()
122    {
123        $o = $this->__offset(18);
124        return $o != 0 ? $this->bb->getByte($o + $this->bb_pos) : \MyGame\Example\Any::NONE;
125    }
126
127    /**
128     * @returnint
129     */
130    public function getTest($obj)
131    {
132        $o = $this->__offset(20);
133        return $o != 0 ? $this->__union($obj, $o) : null;
134    }
135
136    /**
137     * @returnVectorOffset
138     */
139    public function getTest4($j)
140    {
141        $o = $this->__offset(22);
142        $obj = new Test();
143        return $o != 0 ? $obj->init($this->__vector($o) + $j *4, $this->bb) : null;
144    }
145
146    /**
147     * @return int
148     */
149    public function getTest4Length()
150    {
151        $o = $this->__offset(22);
152        return $o != 0 ? $this->__vector_len($o) : 0;
153    }
154
155    /**
156     * @param int offset
157     * @return string
158     */
159    public function getTestarrayofstring($j)
160    {
161        $o = $this->__offset(24);
162        return $o != 0 ? $this->__string($this->__vector($o) + $j * 4) : 0;
163    }
164
165    /**
166     * @return int
167     */
168    public function getTestarrayofstringLength()
169    {
170        $o = $this->__offset(24);
171        return $o != 0 ? $this->__vector_len($o) : 0;
172    }
173
174    /// an example documentation comment: this will end up in the generated code
175    /// multiline too
176    /**
177     * @returnVectorOffset
178     */
179    public function getTestarrayoftables($j)
180    {
181        $o = $this->__offset(26);
182        $obj = new Monster();
183        return $o != 0 ? $obj->init($this->__indirect($this->__vector($o) + $j * 4), $this->bb) : null;
184    }
185
186    /**
187     * @return int
188     */
189    public function getTestarrayoftablesLength()
190    {
191        $o = $this->__offset(26);
192        return $o != 0 ? $this->__vector_len($o) : 0;
193    }
194
195    public function getEnemy()
196    {
197        $obj = new Monster();
198        $o = $this->__offset(28);
199        return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
200    }
201
202    /**
203     * @param int offset
204     * @return byte
205     */
206    public function getTestnestedflatbuffer($j)
207    {
208        $o = $this->__offset(30);
209        return $o != 0 ? $this->bb->getByte($this->__vector($o) + $j * 1) : 0;
210    }
211
212    /**
213     * @return int
214     */
215    public function getTestnestedflatbufferLength()
216    {
217        $o = $this->__offset(30);
218        return $o != 0 ? $this->__vector_len($o) : 0;
219    }
220
221    /**
222     * @return string
223     */
224    public function getTestnestedflatbufferBytes()
225    {
226        return $this->__vector_as_bytes(30);
227    }
228
229    public function getTestempty()
230    {
231        $obj = new Stat();
232        $o = $this->__offset(32);
233        return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
234    }
235
236    /**
237     * @return bool
238     */
239    public function getTestbool()
240    {
241        $o = $this->__offset(34);
242        return $o != 0 ? $this->bb->getBool($o + $this->bb_pos) : false;
243    }
244
245    /**
246     * @return int
247     */
248    public function getTesthashs32Fnv1()
249    {
250        $o = $this->__offset(36);
251        return $o != 0 ? $this->bb->getInt($o + $this->bb_pos) : 0;
252    }
253
254    /**
255     * @return uint
256     */
257    public function getTesthashu32Fnv1()
258    {
259        $o = $this->__offset(38);
260        return $o != 0 ? $this->bb->getUint($o + $this->bb_pos) : 0;
261    }
262
263    /**
264     * @return long
265     */
266    public function getTesthashs64Fnv1()
267    {
268        $o = $this->__offset(40);
269        return $o != 0 ? $this->bb->getLong($o + $this->bb_pos) : 0;
270    }
271
272    /**
273     * @return ulong
274     */
275    public function getTesthashu64Fnv1()
276    {
277        $o = $this->__offset(42);
278        return $o != 0 ? $this->bb->getUlong($o + $this->bb_pos) : 0;
279    }
280
281    /**
282     * @return int
283     */
284    public function getTesthashs32Fnv1a()
285    {
286        $o = $this->__offset(44);
287        return $o != 0 ? $this->bb->getInt($o + $this->bb_pos) : 0;
288    }
289
290    /**
291     * @return uint
292     */
293    public function getTesthashu32Fnv1a()
294    {
295        $o = $this->__offset(46);
296        return $o != 0 ? $this->bb->getUint($o + $this->bb_pos) : 0;
297    }
298
299    /**
300     * @return long
301     */
302    public function getTesthashs64Fnv1a()
303    {
304        $o = $this->__offset(48);
305        return $o != 0 ? $this->bb->getLong($o + $this->bb_pos) : 0;
306    }
307
308    /**
309     * @return ulong
310     */
311    public function getTesthashu64Fnv1a()
312    {
313        $o = $this->__offset(50);
314        return $o != 0 ? $this->bb->getUlong($o + $this->bb_pos) : 0;
315    }
316
317    /**
318     * @param int offset
319     * @return bool
320     */
321    public function getTestarrayofbools($j)
322    {
323        $o = $this->__offset(52);
324        return $o != 0 ? $this->bb->getBool($this->__vector($o) + $j * 1) : 0;
325    }
326
327    /**
328     * @return int
329     */
330    public function getTestarrayofboolsLength()
331    {
332        $o = $this->__offset(52);
333        return $o != 0 ? $this->__vector_len($o) : 0;
334    }
335
336    /**
337     * @return float
338     */
339    public function getTestf()
340    {
341        $o = $this->__offset(54);
342        return $o != 0 ? $this->bb->getFloat($o + $this->bb_pos) : 3.14159;
343    }
344
345    /**
346     * @return float
347     */
348    public function getTestf2()
349    {
350        $o = $this->__offset(56);
351        return $o != 0 ? $this->bb->getFloat($o + $this->bb_pos) : 3.0;
352    }
353
354    /**
355     * @return float
356     */
357    public function getTestf3()
358    {
359        $o = $this->__offset(58);
360        return $o != 0 ? $this->bb->getFloat($o + $this->bb_pos) : 0.0;
361    }
362
363    /**
364     * @param int offset
365     * @return string
366     */
367    public function getTestarrayofstring2($j)
368    {
369        $o = $this->__offset(60);
370        return $o != 0 ? $this->__string($this->__vector($o) + $j * 4) : 0;
371    }
372
373    /**
374     * @return int
375     */
376    public function getTestarrayofstring2Length()
377    {
378        $o = $this->__offset(60);
379        return $o != 0 ? $this->__vector_len($o) : 0;
380    }
381
382    /**
383     * @returnVectorOffset
384     */
385    public function getTestarrayofsortedstruct($j)
386    {
387        $o = $this->__offset(62);
388        $obj = new Ability();
389        return $o != 0 ? $obj->init($this->__vector($o) + $j *8, $this->bb) : null;
390    }
391
392    /**
393     * @return int
394     */
395    public function getTestarrayofsortedstructLength()
396    {
397        $o = $this->__offset(62);
398        return $o != 0 ? $this->__vector_len($o) : 0;
399    }
400
401    /**
402     * @param int offset
403     * @return byte
404     */
405    public function getFlex($j)
406    {
407        $o = $this->__offset(64);
408        return $o != 0 ? $this->bb->getByte($this->__vector($o) + $j * 1) : 0;
409    }
410
411    /**
412     * @return int
413     */
414    public function getFlexLength()
415    {
416        $o = $this->__offset(64);
417        return $o != 0 ? $this->__vector_len($o) : 0;
418    }
419
420    /**
421     * @return string
422     */
423    public function getFlexBytes()
424    {
425        return $this->__vector_as_bytes(64);
426    }
427
428    /**
429     * @returnVectorOffset
430     */
431    public function getTest5($j)
432    {
433        $o = $this->__offset(66);
434        $obj = new Test();
435        return $o != 0 ? $obj->init($this->__vector($o) + $j *4, $this->bb) : null;
436    }
437
438    /**
439     * @return int
440     */
441    public function getTest5Length()
442    {
443        $o = $this->__offset(66);
444        return $o != 0 ? $this->__vector_len($o) : 0;
445    }
446
447    /**
448     * @param int offset
449     * @return long
450     */
451    public function getVectorOfLongs($j)
452    {
453        $o = $this->__offset(68);
454        return $o != 0 ? $this->bb->getLong($this->__vector($o) + $j * 8) : 0;
455    }
456
457    /**
458     * @return int
459     */
460    public function getVectorOfLongsLength()
461    {
462        $o = $this->__offset(68);
463        return $o != 0 ? $this->__vector_len($o) : 0;
464    }
465
466    /**
467     * @param int offset
468     * @return double
469     */
470    public function getVectorOfDoubles($j)
471    {
472        $o = $this->__offset(70);
473        return $o != 0 ? $this->bb->getDouble($this->__vector($o) + $j * 8) : 0;
474    }
475
476    /**
477     * @return int
478     */
479    public function getVectorOfDoublesLength()
480    {
481        $o = $this->__offset(70);
482        return $o != 0 ? $this->__vector_len($o) : 0;
483    }
484
485    public function getParentNamespaceTest()
486    {
487        $obj = new InParentNamespace();
488        $o = $this->__offset(72);
489        return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
490    }
491
492    /**
493     * @returnVectorOffset
494     */
495    public function getVectorOfReferrables($j)
496    {
497        $o = $this->__offset(74);
498        $obj = new Referrable();
499        return $o != 0 ? $obj->init($this->__indirect($this->__vector($o) + $j * 4), $this->bb) : null;
500    }
501
502    /**
503     * @return int
504     */
505    public function getVectorOfReferrablesLength()
506    {
507        $o = $this->__offset(74);
508        return $o != 0 ? $this->__vector_len($o) : 0;
509    }
510
511    /**
512     * @return ulong
513     */
514    public function getSingleWeakReference()
515    {
516        $o = $this->__offset(76);
517        return $o != 0 ? $this->bb->getUlong($o + $this->bb_pos) : 0;
518    }
519
520    /**
521     * @param int offset
522     * @return ulong
523     */
524    public function getVectorOfWeakReferences($j)
525    {
526        $o = $this->__offset(78);
527        return $o != 0 ? $this->bb->getUlong($this->__vector($o) + $j * 8) : 0;
528    }
529
530    /**
531     * @return int
532     */
533    public function getVectorOfWeakReferencesLength()
534    {
535        $o = $this->__offset(78);
536        return $o != 0 ? $this->__vector_len($o) : 0;
537    }
538
539    /**
540     * @returnVectorOffset
541     */
542    public function getVectorOfStrongReferrables($j)
543    {
544        $o = $this->__offset(80);
545        $obj = new Referrable();
546        return $o != 0 ? $obj->init($this->__indirect($this->__vector($o) + $j * 4), $this->bb) : null;
547    }
548
549    /**
550     * @return int
551     */
552    public function getVectorOfStrongReferrablesLength()
553    {
554        $o = $this->__offset(80);
555        return $o != 0 ? $this->__vector_len($o) : 0;
556    }
557
558    /**
559     * @return ulong
560     */
561    public function getCoOwningReference()
562    {
563        $o = $this->__offset(82);
564        return $o != 0 ? $this->bb->getUlong($o + $this->bb_pos) : 0;
565    }
566
567    /**
568     * @param int offset
569     * @return ulong
570     */
571    public function getVectorOfCoOwningReferences($j)
572    {
573        $o = $this->__offset(84);
574        return $o != 0 ? $this->bb->getUlong($this->__vector($o) + $j * 8) : 0;
575    }
576
577    /**
578     * @return int
579     */
580    public function getVectorOfCoOwningReferencesLength()
581    {
582        $o = $this->__offset(84);
583        return $o != 0 ? $this->__vector_len($o) : 0;
584    }
585
586    /**
587     * @return ulong
588     */
589    public function getNonOwningReference()
590    {
591        $o = $this->__offset(86);
592        return $o != 0 ? $this->bb->getUlong($o + $this->bb_pos) : 0;
593    }
594
595    /**
596     * @param int offset
597     * @return ulong
598     */
599    public function getVectorOfNonOwningReferences($j)
600    {
601        $o = $this->__offset(88);
602        return $o != 0 ? $this->bb->getUlong($this->__vector($o) + $j * 8) : 0;
603    }
604
605    /**
606     * @return int
607     */
608    public function getVectorOfNonOwningReferencesLength()
609    {
610        $o = $this->__offset(88);
611        return $o != 0 ? $this->__vector_len($o) : 0;
612    }
613
614    /**
615     * @return byte
616     */
617    public function getAnyUniqueType()
618    {
619        $o = $this->__offset(90);
620        return $o != 0 ? $this->bb->getByte($o + $this->bb_pos) : \MyGame\Example\AnyUniqueAliases::NONE;
621    }
622
623    /**
624     * @returnint
625     */
626    public function getAnyUnique($obj)
627    {
628        $o = $this->__offset(92);
629        return $o != 0 ? $this->__union($obj, $o) : null;
630    }
631
632    /**
633     * @return byte
634     */
635    public function getAnyAmbiguousType()
636    {
637        $o = $this->__offset(94);
638        return $o != 0 ? $this->bb->getByte($o + $this->bb_pos) : \MyGame\Example\AnyAmbiguousAliases::NONE;
639    }
640
641    /**
642     * @returnint
643     */
644    public function getAnyAmbiguous($obj)
645    {
646        $o = $this->__offset(96);
647        return $o != 0 ? $this->__union($obj, $o) : null;
648    }
649
650    /**
651     * @param int offset
652     * @return byte
653     */
654    public function getVectorOfEnums($j)
655    {
656        $o = $this->__offset(98);
657        return $o != 0 ? $this->bb->getByte($this->__vector($o) + $j * 1) : 0;
658    }
659
660    /**
661     * @return int
662     */
663    public function getVectorOfEnumsLength()
664    {
665        $o = $this->__offset(98);
666        return $o != 0 ? $this->__vector_len($o) : 0;
667    }
668
669    /**
670     * @return string
671     */
672    public function getVectorOfEnumsBytes()
673    {
674        return $this->__vector_as_bytes(98);
675    }
676
677    /**
678     * @return sbyte
679     */
680    public function getSignedEnum()
681    {
682        $o = $this->__offset(100);
683        return $o != 0 ? $this->bb->getSbyte($o + $this->bb_pos) : \MyGame\Example\Race::None;
684    }
685
686    /**
687     * @param int offset
688     * @return byte
689     */
690    public function getTestrequirednestedflatbuffer($j)
691    {
692        $o = $this->__offset(102);
693        return $o != 0 ? $this->bb->getByte($this->__vector($o) + $j * 1) : 0;
694    }
695
696    /**
697     * @return int
698     */
699    public function getTestrequirednestedflatbufferLength()
700    {
701        $o = $this->__offset(102);
702        return $o != 0 ? $this->__vector_len($o) : 0;
703    }
704
705    /**
706     * @return string
707     */
708    public function getTestrequirednestedflatbufferBytes()
709    {
710        return $this->__vector_as_bytes(102);
711    }
712
713    /**
714     * @returnVectorOffset
715     */
716    public function getScalarKeySortedTables($j)
717    {
718        $o = $this->__offset(104);
719        $obj = new Stat();
720        return $o != 0 ? $obj->init($this->__indirect($this->__vector($o) + $j * 4), $this->bb) : null;
721    }
722
723    /**
724     * @return int
725     */
726    public function getScalarKeySortedTablesLength()
727    {
728        $o = $this->__offset(104);
729        return $o != 0 ? $this->__vector_len($o) : 0;
730    }
731
732    /**
733     * @param FlatBufferBuilder $builder
734     * @return void
735     */
736    public static function startMonster(FlatBufferBuilder $builder)
737    {
738        $builder->StartObject(51);
739    }
740
741    /**
742     * @param FlatBufferBuilder $builder
743     * @return Monster
744     */
745    public static function createMonster(FlatBufferBuilder $builder, $pos, $mana, $hp, $name, $inventory, $color, $test_type, $test, $test4, $testarrayofstring, $testarrayoftables, $enemy, $testnestedflatbuffer, $testempty, $testbool, $testhashs32_fnv1, $testhashu32_fnv1, $testhashs64_fnv1, $testhashu64_fnv1, $testhashs32_fnv1a, $testhashu32_fnv1a, $testhashs64_fnv1a, $testhashu64_fnv1a, $testarrayofbools, $testf, $testf2, $testf3, $testarrayofstring2, $testarrayofsortedstruct, $flex, $test5, $vector_of_longs, $vector_of_doubles, $parent_namespace_test, $vector_of_referrables, $single_weak_reference, $vector_of_weak_references, $vector_of_strong_referrables, $co_owning_reference, $vector_of_co_owning_references, $non_owning_reference, $vector_of_non_owning_references, $any_unique_type, $any_unique, $any_ambiguous_type, $any_ambiguous, $vector_of_enums, $signed_enum, $testrequirednestedflatbuffer, $scalar_key_sorted_tables)
746    {
747        $builder->startObject(51);
748        self::addPos($builder, $pos);
749        self::addMana($builder, $mana);
750        self::addHp($builder, $hp);
751        self::addName($builder, $name);
752        self::addInventory($builder, $inventory);
753        self::addColor($builder, $color);
754        self::addTestType($builder, $test_type);
755        self::addTest($builder, $test);
756        self::addTest4($builder, $test4);
757        self::addTestarrayofstring($builder, $testarrayofstring);
758        self::addTestarrayoftables($builder, $testarrayoftables);
759        self::addEnemy($builder, $enemy);
760        self::addTestnestedflatbuffer($builder, $testnestedflatbuffer);
761        self::addTestempty($builder, $testempty);
762        self::addTestbool($builder, $testbool);
763        self::addTesthashs32Fnv1($builder, $testhashs32_fnv1);
764        self::addTesthashu32Fnv1($builder, $testhashu32_fnv1);
765        self::addTesthashs64Fnv1($builder, $testhashs64_fnv1);
766        self::addTesthashu64Fnv1($builder, $testhashu64_fnv1);
767        self::addTesthashs32Fnv1a($builder, $testhashs32_fnv1a);
768        self::addTesthashu32Fnv1a($builder, $testhashu32_fnv1a);
769        self::addTesthashs64Fnv1a($builder, $testhashs64_fnv1a);
770        self::addTesthashu64Fnv1a($builder, $testhashu64_fnv1a);
771        self::addTestarrayofbools($builder, $testarrayofbools);
772        self::addTestf($builder, $testf);
773        self::addTestf2($builder, $testf2);
774        self::addTestf3($builder, $testf3);
775        self::addTestarrayofstring2($builder, $testarrayofstring2);
776        self::addTestarrayofsortedstruct($builder, $testarrayofsortedstruct);
777        self::addFlex($builder, $flex);
778        self::addTest5($builder, $test5);
779        self::addVectorOfLongs($builder, $vector_of_longs);
780        self::addVectorOfDoubles($builder, $vector_of_doubles);
781        self::addParentNamespaceTest($builder, $parent_namespace_test);
782        self::addVectorOfReferrables($builder, $vector_of_referrables);
783        self::addSingleWeakReference($builder, $single_weak_reference);
784        self::addVectorOfWeakReferences($builder, $vector_of_weak_references);
785        self::addVectorOfStrongReferrables($builder, $vector_of_strong_referrables);
786        self::addCoOwningReference($builder, $co_owning_reference);
787        self::addVectorOfCoOwningReferences($builder, $vector_of_co_owning_references);
788        self::addNonOwningReference($builder, $non_owning_reference);
789        self::addVectorOfNonOwningReferences($builder, $vector_of_non_owning_references);
790        self::addAnyUniqueType($builder, $any_unique_type);
791        self::addAnyUnique($builder, $any_unique);
792        self::addAnyAmbiguousType($builder, $any_ambiguous_type);
793        self::addAnyAmbiguous($builder, $any_ambiguous);
794        self::addVectorOfEnums($builder, $vector_of_enums);
795        self::addSignedEnum($builder, $signed_enum);
796        self::addTestrequirednestedflatbuffer($builder, $testrequirednestedflatbuffer);
797        self::addScalarKeySortedTables($builder, $scalar_key_sorted_tables);
798        $o = $builder->endObject();
799        $builder->required($o, 10);  // name
800        return $o;
801    }
802
803    /**
804     * @param FlatBufferBuilder $builder
805     * @param int
806     * @return void
807     */
808    public static function addPos(FlatBufferBuilder $builder, $pos)
809    {
810        $builder->addStructX(0, $pos, 0);
811    }
812
813    /**
814     * @param FlatBufferBuilder $builder
815     * @param short
816     * @return void
817     */
818    public static function addMana(FlatBufferBuilder $builder, $mana)
819    {
820        $builder->addShortX(1, $mana, 150);
821    }
822
823    /**
824     * @param FlatBufferBuilder $builder
825     * @param short
826     * @return void
827     */
828    public static function addHp(FlatBufferBuilder $builder, $hp)
829    {
830        $builder->addShortX(2, $hp, 100);
831    }
832
833    /**
834     * @param FlatBufferBuilder $builder
835     * @param StringOffset
836     * @return void
837     */
838    public static function addName(FlatBufferBuilder $builder, $name)
839    {
840        $builder->addOffsetX(3, $name, 0);
841    }
842
843    /**
844     * @param FlatBufferBuilder $builder
845     * @param VectorOffset
846     * @return void
847     */
848    public static function addInventory(FlatBufferBuilder $builder, $inventory)
849    {
850        $builder->addOffsetX(5, $inventory, 0);
851    }
852
853    /**
854     * @param FlatBufferBuilder $builder
855     * @param array offset array
856     * @return int vector offset
857     */
858    public static function createInventoryVector(FlatBufferBuilder $builder, array $data)
859    {
860        $builder->startVector(1, count($data), 1);
861        for ($i = count($data) - 1; $i >= 0; $i--) {
862            $builder->putByte($data[$i]);
863        }
864        return $builder->endVector();
865    }
866
867    /**
868     * @param FlatBufferBuilder $builder
869     * @param int $numElems
870     * @return void
871     */
872    public static function startInventoryVector(FlatBufferBuilder $builder, $numElems)
873    {
874        $builder->startVector(1, $numElems, 1);
875    }
876
877    /**
878     * @param FlatBufferBuilder $builder
879     * @param byte
880     * @return void
881     */
882    public static function addColor(FlatBufferBuilder $builder, $color)
883    {
884        $builder->addByteX(6, $color, 8);
885    }
886
887    /**
888     * @param FlatBufferBuilder $builder
889     * @param byte
890     * @return void
891     */
892    public static function addTestType(FlatBufferBuilder $builder, $testType)
893    {
894        $builder->addByteX(7, $testType, 0);
895    }
896
897    public static function addTest(FlatBufferBuilder $builder, $offset)
898    {
899        $builder->addOffsetX(8, $offset, 0);
900    }
901
902    /**
903     * @param FlatBufferBuilder $builder
904     * @param VectorOffset
905     * @return void
906     */
907    public static function addTest4(FlatBufferBuilder $builder, $test4)
908    {
909        $builder->addOffsetX(9, $test4, 0);
910    }
911
912    /**
913     * @param FlatBufferBuilder $builder
914     * @param array offset array
915     * @return int vector offset
916     */
917    public static function createTest4Vector(FlatBufferBuilder $builder, array $data)
918    {
919        $builder->startVector(4, count($data), 2);
920        for ($i = count($data) - 1; $i >= 0; $i--) {
921            $builder->putOffset($data[$i]);
922        }
923        return $builder->endVector();
924    }
925
926    /**
927     * @param FlatBufferBuilder $builder
928     * @param int $numElems
929     * @return void
930     */
931    public static function startTest4Vector(FlatBufferBuilder $builder, $numElems)
932    {
933        $builder->startVector(4, $numElems, 2);
934    }
935
936    /**
937     * @param FlatBufferBuilder $builder
938     * @param VectorOffset
939     * @return void
940     */
941    public static function addTestarrayofstring(FlatBufferBuilder $builder, $testarrayofstring)
942    {
943        $builder->addOffsetX(10, $testarrayofstring, 0);
944    }
945
946    /**
947     * @param FlatBufferBuilder $builder
948     * @param array offset array
949     * @return int vector offset
950     */
951    public static function createTestarrayofstringVector(FlatBufferBuilder $builder, array $data)
952    {
953        $builder->startVector(4, count($data), 4);
954        for ($i = count($data) - 1; $i >= 0; $i--) {
955            $builder->putOffset($data[$i]);
956        }
957        return $builder->endVector();
958    }
959
960    /**
961     * @param FlatBufferBuilder $builder
962     * @param int $numElems
963     * @return void
964     */
965    public static function startTestarrayofstringVector(FlatBufferBuilder $builder, $numElems)
966    {
967        $builder->startVector(4, $numElems, 4);
968    }
969
970    /**
971     * @param FlatBufferBuilder $builder
972     * @param VectorOffset
973     * @return void
974     */
975    public static function addTestarrayoftables(FlatBufferBuilder $builder, $testarrayoftables)
976    {
977        $builder->addOffsetX(11, $testarrayoftables, 0);
978    }
979
980    /**
981     * @param FlatBufferBuilder $builder
982     * @param array offset array
983     * @return int vector offset
984     */
985    public static function createTestarrayoftablesVector(FlatBufferBuilder $builder, array $data)
986    {
987        $builder->startVector(4, count($data), 4);
988        for ($i = count($data) - 1; $i >= 0; $i--) {
989            $builder->putOffset($data[$i]);
990        }
991        return $builder->endVector();
992    }
993
994    /**
995     * @param FlatBufferBuilder $builder
996     * @param int $numElems
997     * @return void
998     */
999    public static function startTestarrayoftablesVector(FlatBufferBuilder $builder, $numElems)
1000    {
1001        $builder->startVector(4, $numElems, 4);
1002    }
1003
1004    /**
1005     * @param FlatBufferBuilder $builder
1006     * @param int
1007     * @return void
1008     */
1009    public static function addEnemy(FlatBufferBuilder $builder, $enemy)
1010    {
1011        $builder->addOffsetX(12, $enemy, 0);
1012    }
1013
1014    /**
1015     * @param FlatBufferBuilder $builder
1016     * @param VectorOffset
1017     * @return void
1018     */
1019    public static function addTestnestedflatbuffer(FlatBufferBuilder $builder, $testnestedflatbuffer)
1020    {
1021        $builder->addOffsetX(13, $testnestedflatbuffer, 0);
1022    }
1023
1024    /**
1025     * @param FlatBufferBuilder $builder
1026     * @param array offset array
1027     * @return int vector offset
1028     */
1029    public static function createTestnestedflatbufferVector(FlatBufferBuilder $builder, array $data)
1030    {
1031        $builder->startVector(1, count($data), 1);
1032        for ($i = count($data) - 1; $i >= 0; $i--) {
1033            $builder->putByte($data[$i]);
1034        }
1035        return $builder->endVector();
1036    }
1037
1038    /**
1039     * @param FlatBufferBuilder $builder
1040     * @param int $numElems
1041     * @return void
1042     */
1043    public static function startTestnestedflatbufferVector(FlatBufferBuilder $builder, $numElems)
1044    {
1045        $builder->startVector(1, $numElems, 1);
1046    }
1047
1048    /**
1049     * @param FlatBufferBuilder $builder
1050     * @param int
1051     * @return void
1052     */
1053    public static function addTestempty(FlatBufferBuilder $builder, $testempty)
1054    {
1055        $builder->addOffsetX(14, $testempty, 0);
1056    }
1057
1058    /**
1059     * @param FlatBufferBuilder $builder
1060     * @param bool
1061     * @return void
1062     */
1063    public static function addTestbool(FlatBufferBuilder $builder, $testbool)
1064    {
1065        $builder->addBoolX(15, $testbool, false);
1066    }
1067
1068    /**
1069     * @param FlatBufferBuilder $builder
1070     * @param int
1071     * @return void
1072     */
1073    public static function addTesthashs32Fnv1(FlatBufferBuilder $builder, $testhashs32Fnv1)
1074    {
1075        $builder->addIntX(16, $testhashs32Fnv1, 0);
1076    }
1077
1078    /**
1079     * @param FlatBufferBuilder $builder
1080     * @param uint
1081     * @return void
1082     */
1083    public static function addTesthashu32Fnv1(FlatBufferBuilder $builder, $testhashu32Fnv1)
1084    {
1085        $builder->addUintX(17, $testhashu32Fnv1, 0);
1086    }
1087
1088    /**
1089     * @param FlatBufferBuilder $builder
1090     * @param long
1091     * @return void
1092     */
1093    public static function addTesthashs64Fnv1(FlatBufferBuilder $builder, $testhashs64Fnv1)
1094    {
1095        $builder->addLongX(18, $testhashs64Fnv1, 0);
1096    }
1097
1098    /**
1099     * @param FlatBufferBuilder $builder
1100     * @param ulong
1101     * @return void
1102     */
1103    public static function addTesthashu64Fnv1(FlatBufferBuilder $builder, $testhashu64Fnv1)
1104    {
1105        $builder->addUlongX(19, $testhashu64Fnv1, 0);
1106    }
1107
1108    /**
1109     * @param FlatBufferBuilder $builder
1110     * @param int
1111     * @return void
1112     */
1113    public static function addTesthashs32Fnv1a(FlatBufferBuilder $builder, $testhashs32Fnv1a)
1114    {
1115        $builder->addIntX(20, $testhashs32Fnv1a, 0);
1116    }
1117
1118    /**
1119     * @param FlatBufferBuilder $builder
1120     * @param uint
1121     * @return void
1122     */
1123    public static function addTesthashu32Fnv1a(FlatBufferBuilder $builder, $testhashu32Fnv1a)
1124    {
1125        $builder->addUintX(21, $testhashu32Fnv1a, 0);
1126    }
1127
1128    /**
1129     * @param FlatBufferBuilder $builder
1130     * @param long
1131     * @return void
1132     */
1133    public static function addTesthashs64Fnv1a(FlatBufferBuilder $builder, $testhashs64Fnv1a)
1134    {
1135        $builder->addLongX(22, $testhashs64Fnv1a, 0);
1136    }
1137
1138    /**
1139     * @param FlatBufferBuilder $builder
1140     * @param ulong
1141     * @return void
1142     */
1143    public static function addTesthashu64Fnv1a(FlatBufferBuilder $builder, $testhashu64Fnv1a)
1144    {
1145        $builder->addUlongX(23, $testhashu64Fnv1a, 0);
1146    }
1147
1148    /**
1149     * @param FlatBufferBuilder $builder
1150     * @param VectorOffset
1151     * @return void
1152     */
1153    public static function addTestarrayofbools(FlatBufferBuilder $builder, $testarrayofbools)
1154    {
1155        $builder->addOffsetX(24, $testarrayofbools, 0);
1156    }
1157
1158    /**
1159     * @param FlatBufferBuilder $builder
1160     * @param array offset array
1161     * @return int vector offset
1162     */
1163    public static function createTestarrayofboolsVector(FlatBufferBuilder $builder, array $data)
1164    {
1165        $builder->startVector(1, count($data), 1);
1166        for ($i = count($data) - 1; $i >= 0; $i--) {
1167            $builder->putBool($data[$i]);
1168        }
1169        return $builder->endVector();
1170    }
1171
1172    /**
1173     * @param FlatBufferBuilder $builder
1174     * @param int $numElems
1175     * @return void
1176     */
1177    public static function startTestarrayofboolsVector(FlatBufferBuilder $builder, $numElems)
1178    {
1179        $builder->startVector(1, $numElems, 1);
1180    }
1181
1182    /**
1183     * @param FlatBufferBuilder $builder
1184     * @param float
1185     * @return void
1186     */
1187    public static function addTestf(FlatBufferBuilder $builder, $testf)
1188    {
1189        $builder->addFloatX(25, $testf, 3.14159);
1190    }
1191
1192    /**
1193     * @param FlatBufferBuilder $builder
1194     * @param float
1195     * @return void
1196     */
1197    public static function addTestf2(FlatBufferBuilder $builder, $testf2)
1198    {
1199        $builder->addFloatX(26, $testf2, 3.0);
1200    }
1201
1202    /**
1203     * @param FlatBufferBuilder $builder
1204     * @param float
1205     * @return void
1206     */
1207    public static function addTestf3(FlatBufferBuilder $builder, $testf3)
1208    {
1209        $builder->addFloatX(27, $testf3, 0.0);
1210    }
1211
1212    /**
1213     * @param FlatBufferBuilder $builder
1214     * @param VectorOffset
1215     * @return void
1216     */
1217    public static function addTestarrayofstring2(FlatBufferBuilder $builder, $testarrayofstring2)
1218    {
1219        $builder->addOffsetX(28, $testarrayofstring2, 0);
1220    }
1221
1222    /**
1223     * @param FlatBufferBuilder $builder
1224     * @param array offset array
1225     * @return int vector offset
1226     */
1227    public static function createTestarrayofstring2Vector(FlatBufferBuilder $builder, array $data)
1228    {
1229        $builder->startVector(4, count($data), 4);
1230        for ($i = count($data) - 1; $i >= 0; $i--) {
1231            $builder->putOffset($data[$i]);
1232        }
1233        return $builder->endVector();
1234    }
1235
1236    /**
1237     * @param FlatBufferBuilder $builder
1238     * @param int $numElems
1239     * @return void
1240     */
1241    public static function startTestarrayofstring2Vector(FlatBufferBuilder $builder, $numElems)
1242    {
1243        $builder->startVector(4, $numElems, 4);
1244    }
1245
1246    /**
1247     * @param FlatBufferBuilder $builder
1248     * @param VectorOffset
1249     * @return void
1250     */
1251    public static function addTestarrayofsortedstruct(FlatBufferBuilder $builder, $testarrayofsortedstruct)
1252    {
1253        $builder->addOffsetX(29, $testarrayofsortedstruct, 0);
1254    }
1255
1256    /**
1257     * @param FlatBufferBuilder $builder
1258     * @param array offset array
1259     * @return int vector offset
1260     */
1261    public static function createTestarrayofsortedstructVector(FlatBufferBuilder $builder, array $data)
1262    {
1263        $builder->startVector(8, count($data), 4);
1264        for ($i = count($data) - 1; $i >= 0; $i--) {
1265            $builder->putOffset($data[$i]);
1266        }
1267        return $builder->endVector();
1268    }
1269
1270    /**
1271     * @param FlatBufferBuilder $builder
1272     * @param int $numElems
1273     * @return void
1274     */
1275    public static function startTestarrayofsortedstructVector(FlatBufferBuilder $builder, $numElems)
1276    {
1277        $builder->startVector(8, $numElems, 4);
1278    }
1279
1280    /**
1281     * @param FlatBufferBuilder $builder
1282     * @param VectorOffset
1283     * @return void
1284     */
1285    public static function addFlex(FlatBufferBuilder $builder, $flex)
1286    {
1287        $builder->addOffsetX(30, $flex, 0);
1288    }
1289
1290    /**
1291     * @param FlatBufferBuilder $builder
1292     * @param array offset array
1293     * @return int vector offset
1294     */
1295    public static function createFlexVector(FlatBufferBuilder $builder, array $data)
1296    {
1297        $builder->startVector(1, count($data), 1);
1298        for ($i = count($data) - 1; $i >= 0; $i--) {
1299            $builder->putByte($data[$i]);
1300        }
1301        return $builder->endVector();
1302    }
1303
1304    /**
1305     * @param FlatBufferBuilder $builder
1306     * @param int $numElems
1307     * @return void
1308     */
1309    public static function startFlexVector(FlatBufferBuilder $builder, $numElems)
1310    {
1311        $builder->startVector(1, $numElems, 1);
1312    }
1313
1314    /**
1315     * @param FlatBufferBuilder $builder
1316     * @param VectorOffset
1317     * @return void
1318     */
1319    public static function addTest5(FlatBufferBuilder $builder, $test5)
1320    {
1321        $builder->addOffsetX(31, $test5, 0);
1322    }
1323
1324    /**
1325     * @param FlatBufferBuilder $builder
1326     * @param array offset array
1327     * @return int vector offset
1328     */
1329    public static function createTest5Vector(FlatBufferBuilder $builder, array $data)
1330    {
1331        $builder->startVector(4, count($data), 2);
1332        for ($i = count($data) - 1; $i >= 0; $i--) {
1333            $builder->putOffset($data[$i]);
1334        }
1335        return $builder->endVector();
1336    }
1337
1338    /**
1339     * @param FlatBufferBuilder $builder
1340     * @param int $numElems
1341     * @return void
1342     */
1343    public static function startTest5Vector(FlatBufferBuilder $builder, $numElems)
1344    {
1345        $builder->startVector(4, $numElems, 2);
1346    }
1347
1348    /**
1349     * @param FlatBufferBuilder $builder
1350     * @param VectorOffset
1351     * @return void
1352     */
1353    public static function addVectorOfLongs(FlatBufferBuilder $builder, $vectorOfLongs)
1354    {
1355        $builder->addOffsetX(32, $vectorOfLongs, 0);
1356    }
1357
1358    /**
1359     * @param FlatBufferBuilder $builder
1360     * @param array offset array
1361     * @return int vector offset
1362     */
1363    public static function createVectorOfLongsVector(FlatBufferBuilder $builder, array $data)
1364    {
1365        $builder->startVector(8, count($data), 8);
1366        for ($i = count($data) - 1; $i >= 0; $i--) {
1367            $builder->putLong($data[$i]);
1368        }
1369        return $builder->endVector();
1370    }
1371
1372    /**
1373     * @param FlatBufferBuilder $builder
1374     * @param int $numElems
1375     * @return void
1376     */
1377    public static function startVectorOfLongsVector(FlatBufferBuilder $builder, $numElems)
1378    {
1379        $builder->startVector(8, $numElems, 8);
1380    }
1381
1382    /**
1383     * @param FlatBufferBuilder $builder
1384     * @param VectorOffset
1385     * @return void
1386     */
1387    public static function addVectorOfDoubles(FlatBufferBuilder $builder, $vectorOfDoubles)
1388    {
1389        $builder->addOffsetX(33, $vectorOfDoubles, 0);
1390    }
1391
1392    /**
1393     * @param FlatBufferBuilder $builder
1394     * @param array offset array
1395     * @return int vector offset
1396     */
1397    public static function createVectorOfDoublesVector(FlatBufferBuilder $builder, array $data)
1398    {
1399        $builder->startVector(8, count($data), 8);
1400        for ($i = count($data) - 1; $i >= 0; $i--) {
1401            $builder->putDouble($data[$i]);
1402        }
1403        return $builder->endVector();
1404    }
1405
1406    /**
1407     * @param FlatBufferBuilder $builder
1408     * @param int $numElems
1409     * @return void
1410     */
1411    public static function startVectorOfDoublesVector(FlatBufferBuilder $builder, $numElems)
1412    {
1413        $builder->startVector(8, $numElems, 8);
1414    }
1415
1416    /**
1417     * @param FlatBufferBuilder $builder
1418     * @param int
1419     * @return void
1420     */
1421    public static function addParentNamespaceTest(FlatBufferBuilder $builder, $parentNamespaceTest)
1422    {
1423        $builder->addOffsetX(34, $parentNamespaceTest, 0);
1424    }
1425
1426    /**
1427     * @param FlatBufferBuilder $builder
1428     * @param VectorOffset
1429     * @return void
1430     */
1431    public static function addVectorOfReferrables(FlatBufferBuilder $builder, $vectorOfReferrables)
1432    {
1433        $builder->addOffsetX(35, $vectorOfReferrables, 0);
1434    }
1435
1436    /**
1437     * @param FlatBufferBuilder $builder
1438     * @param array offset array
1439     * @return int vector offset
1440     */
1441    public static function createVectorOfReferrablesVector(FlatBufferBuilder $builder, array $data)
1442    {
1443        $builder->startVector(4, count($data), 4);
1444        for ($i = count($data) - 1; $i >= 0; $i--) {
1445            $builder->putOffset($data[$i]);
1446        }
1447        return $builder->endVector();
1448    }
1449
1450    /**
1451     * @param FlatBufferBuilder $builder
1452     * @param int $numElems
1453     * @return void
1454     */
1455    public static function startVectorOfReferrablesVector(FlatBufferBuilder $builder, $numElems)
1456    {
1457        $builder->startVector(4, $numElems, 4);
1458    }
1459
1460    /**
1461     * @param FlatBufferBuilder $builder
1462     * @param ulong
1463     * @return void
1464     */
1465    public static function addSingleWeakReference(FlatBufferBuilder $builder, $singleWeakReference)
1466    {
1467        $builder->addUlongX(36, $singleWeakReference, 0);
1468    }
1469
1470    /**
1471     * @param FlatBufferBuilder $builder
1472     * @param VectorOffset
1473     * @return void
1474     */
1475    public static function addVectorOfWeakReferences(FlatBufferBuilder $builder, $vectorOfWeakReferences)
1476    {
1477        $builder->addOffsetX(37, $vectorOfWeakReferences, 0);
1478    }
1479
1480    /**
1481     * @param FlatBufferBuilder $builder
1482     * @param array offset array
1483     * @return int vector offset
1484     */
1485    public static function createVectorOfWeakReferencesVector(FlatBufferBuilder $builder, array $data)
1486    {
1487        $builder->startVector(8, count($data), 8);
1488        for ($i = count($data) - 1; $i >= 0; $i--) {
1489            $builder->putUlong($data[$i]);
1490        }
1491        return $builder->endVector();
1492    }
1493
1494    /**
1495     * @param FlatBufferBuilder $builder
1496     * @param int $numElems
1497     * @return void
1498     */
1499    public static function startVectorOfWeakReferencesVector(FlatBufferBuilder $builder, $numElems)
1500    {
1501        $builder->startVector(8, $numElems, 8);
1502    }
1503
1504    /**
1505     * @param FlatBufferBuilder $builder
1506     * @param VectorOffset
1507     * @return void
1508     */
1509    public static function addVectorOfStrongReferrables(FlatBufferBuilder $builder, $vectorOfStrongReferrables)
1510    {
1511        $builder->addOffsetX(38, $vectorOfStrongReferrables, 0);
1512    }
1513
1514    /**
1515     * @param FlatBufferBuilder $builder
1516     * @param array offset array
1517     * @return int vector offset
1518     */
1519    public static function createVectorOfStrongReferrablesVector(FlatBufferBuilder $builder, array $data)
1520    {
1521        $builder->startVector(4, count($data), 4);
1522        for ($i = count($data) - 1; $i >= 0; $i--) {
1523            $builder->putOffset($data[$i]);
1524        }
1525        return $builder->endVector();
1526    }
1527
1528    /**
1529     * @param FlatBufferBuilder $builder
1530     * @param int $numElems
1531     * @return void
1532     */
1533    public static function startVectorOfStrongReferrablesVector(FlatBufferBuilder $builder, $numElems)
1534    {
1535        $builder->startVector(4, $numElems, 4);
1536    }
1537
1538    /**
1539     * @param FlatBufferBuilder $builder
1540     * @param ulong
1541     * @return void
1542     */
1543    public static function addCoOwningReference(FlatBufferBuilder $builder, $coOwningReference)
1544    {
1545        $builder->addUlongX(39, $coOwningReference, 0);
1546    }
1547
1548    /**
1549     * @param FlatBufferBuilder $builder
1550     * @param VectorOffset
1551     * @return void
1552     */
1553    public static function addVectorOfCoOwningReferences(FlatBufferBuilder $builder, $vectorOfCoOwningReferences)
1554    {
1555        $builder->addOffsetX(40, $vectorOfCoOwningReferences, 0);
1556    }
1557
1558    /**
1559     * @param FlatBufferBuilder $builder
1560     * @param array offset array
1561     * @return int vector offset
1562     */
1563    public static function createVectorOfCoOwningReferencesVector(FlatBufferBuilder $builder, array $data)
1564    {
1565        $builder->startVector(8, count($data), 8);
1566        for ($i = count($data) - 1; $i >= 0; $i--) {
1567            $builder->putUlong($data[$i]);
1568        }
1569        return $builder->endVector();
1570    }
1571
1572    /**
1573     * @param FlatBufferBuilder $builder
1574     * @param int $numElems
1575     * @return void
1576     */
1577    public static function startVectorOfCoOwningReferencesVector(FlatBufferBuilder $builder, $numElems)
1578    {
1579        $builder->startVector(8, $numElems, 8);
1580    }
1581
1582    /**
1583     * @param FlatBufferBuilder $builder
1584     * @param ulong
1585     * @return void
1586     */
1587    public static function addNonOwningReference(FlatBufferBuilder $builder, $nonOwningReference)
1588    {
1589        $builder->addUlongX(41, $nonOwningReference, 0);
1590    }
1591
1592    /**
1593     * @param FlatBufferBuilder $builder
1594     * @param VectorOffset
1595     * @return void
1596     */
1597    public static function addVectorOfNonOwningReferences(FlatBufferBuilder $builder, $vectorOfNonOwningReferences)
1598    {
1599        $builder->addOffsetX(42, $vectorOfNonOwningReferences, 0);
1600    }
1601
1602    /**
1603     * @param FlatBufferBuilder $builder
1604     * @param array offset array
1605     * @return int vector offset
1606     */
1607    public static function createVectorOfNonOwningReferencesVector(FlatBufferBuilder $builder, array $data)
1608    {
1609        $builder->startVector(8, count($data), 8);
1610        for ($i = count($data) - 1; $i >= 0; $i--) {
1611            $builder->putUlong($data[$i]);
1612        }
1613        return $builder->endVector();
1614    }
1615
1616    /**
1617     * @param FlatBufferBuilder $builder
1618     * @param int $numElems
1619     * @return void
1620     */
1621    public static function startVectorOfNonOwningReferencesVector(FlatBufferBuilder $builder, $numElems)
1622    {
1623        $builder->startVector(8, $numElems, 8);
1624    }
1625
1626    /**
1627     * @param FlatBufferBuilder $builder
1628     * @param byte
1629     * @return void
1630     */
1631    public static function addAnyUniqueType(FlatBufferBuilder $builder, $anyUniqueType)
1632    {
1633        $builder->addByteX(43, $anyUniqueType, 0);
1634    }
1635
1636    public static function addAnyUnique(FlatBufferBuilder $builder, $offset)
1637    {
1638        $builder->addOffsetX(44, $offset, 0);
1639    }
1640
1641    /**
1642     * @param FlatBufferBuilder $builder
1643     * @param byte
1644     * @return void
1645     */
1646    public static function addAnyAmbiguousType(FlatBufferBuilder $builder, $anyAmbiguousType)
1647    {
1648        $builder->addByteX(45, $anyAmbiguousType, 0);
1649    }
1650
1651    public static function addAnyAmbiguous(FlatBufferBuilder $builder, $offset)
1652    {
1653        $builder->addOffsetX(46, $offset, 0);
1654    }
1655
1656    /**
1657     * @param FlatBufferBuilder $builder
1658     * @param VectorOffset
1659     * @return void
1660     */
1661    public static function addVectorOfEnums(FlatBufferBuilder $builder, $vectorOfEnums)
1662    {
1663        $builder->addOffsetX(47, $vectorOfEnums, 0);
1664    }
1665
1666    /**
1667     * @param FlatBufferBuilder $builder
1668     * @param array offset array
1669     * @return int vector offset
1670     */
1671    public static function createVectorOfEnumsVector(FlatBufferBuilder $builder, array $data)
1672    {
1673        $builder->startVector(1, count($data), 1);
1674        for ($i = count($data) - 1; $i >= 0; $i--) {
1675            $builder->putByte($data[$i]);
1676        }
1677        return $builder->endVector();
1678    }
1679
1680    /**
1681     * @param FlatBufferBuilder $builder
1682     * @param int $numElems
1683     * @return void
1684     */
1685    public static function startVectorOfEnumsVector(FlatBufferBuilder $builder, $numElems)
1686    {
1687        $builder->startVector(1, $numElems, 1);
1688    }
1689
1690    /**
1691     * @param FlatBufferBuilder $builder
1692     * @param sbyte
1693     * @return void
1694     */
1695    public static function addSignedEnum(FlatBufferBuilder $builder, $signedEnum)
1696    {
1697        $builder->addSbyteX(48, $signedEnum, -1);
1698    }
1699
1700    /**
1701     * @param FlatBufferBuilder $builder
1702     * @param VectorOffset
1703     * @return void
1704     */
1705    public static function addTestrequirednestedflatbuffer(FlatBufferBuilder $builder, $testrequirednestedflatbuffer)
1706    {
1707        $builder->addOffsetX(49, $testrequirednestedflatbuffer, 0);
1708    }
1709
1710    /**
1711     * @param FlatBufferBuilder $builder
1712     * @param array offset array
1713     * @return int vector offset
1714     */
1715    public static function createTestrequirednestedflatbufferVector(FlatBufferBuilder $builder, array $data)
1716    {
1717        $builder->startVector(1, count($data), 1);
1718        for ($i = count($data) - 1; $i >= 0; $i--) {
1719            $builder->putByte($data[$i]);
1720        }
1721        return $builder->endVector();
1722    }
1723
1724    /**
1725     * @param FlatBufferBuilder $builder
1726     * @param int $numElems
1727     * @return void
1728     */
1729    public static function startTestrequirednestedflatbufferVector(FlatBufferBuilder $builder, $numElems)
1730    {
1731        $builder->startVector(1, $numElems, 1);
1732    }
1733
1734    /**
1735     * @param FlatBufferBuilder $builder
1736     * @param VectorOffset
1737     * @return void
1738     */
1739    public static function addScalarKeySortedTables(FlatBufferBuilder $builder, $scalarKeySortedTables)
1740    {
1741        $builder->addOffsetX(50, $scalarKeySortedTables, 0);
1742    }
1743
1744    /**
1745     * @param FlatBufferBuilder $builder
1746     * @param array offset array
1747     * @return int vector offset
1748     */
1749    public static function createScalarKeySortedTablesVector(FlatBufferBuilder $builder, array $data)
1750    {
1751        $builder->startVector(4, count($data), 4);
1752        for ($i = count($data) - 1; $i >= 0; $i--) {
1753            $builder->putOffset($data[$i]);
1754        }
1755        return $builder->endVector();
1756    }
1757
1758    /**
1759     * @param FlatBufferBuilder $builder
1760     * @param int $numElems
1761     * @return void
1762     */
1763    public static function startScalarKeySortedTablesVector(FlatBufferBuilder $builder, $numElems)
1764    {
1765        $builder->startVector(4, $numElems, 4);
1766    }
1767
1768    /**
1769     * @param FlatBufferBuilder $builder
1770     * @return int table offset
1771     */
1772    public static function endMonster(FlatBufferBuilder $builder)
1773    {
1774        $o = $builder->endObject();
1775        $builder->required($o, 10);  // name
1776        return $o;
1777    }
1778
1779    public static function finishMonsterBuffer(FlatBufferBuilder $builder, $offset)
1780    {
1781        $builder->finish($offset, "MONS");
1782    }
1783}
1784