1 <?php 2 // automatically generated by the FlatBuffers compiler, do not modify 3 4 namespace MyGame\Example2; 5 6 use \Google\FlatBuffers\Struct; 7 use \Google\FlatBuffers\Table; 8 use \Google\FlatBuffers\ByteBuffer; 9 use \Google\FlatBuffers\FlatBufferBuilder; 10 11 class Monster extends Table 12 { 13 /** 14 * @param ByteBuffer $bb 15 * @return Monster 16 */ 17 public static function getRootAsMonster(ByteBuffer $bb) 18 { 19 $obj = new Monster(); 20 return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb)); 21 } 22 23 public static function MonsterIdentifier() 24 { 25 return "MONS"; 26 } 27 28 public static function MonsterBufferHasIdentifier(ByteBuffer $buf) 29 { 30 return self::__has_identifier($buf, self::MonsterIdentifier()); 31 } 32 33 public static function MonsterExtension() 34 { 35 return "mon"; 36 } 37 38 /** 39 * @param int $_i offset 40 * @param ByteBuffer $_bb 41 * @return Monster 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 * @param FlatBufferBuilder $builder 52 * @return void 53 */ 54 public static function startMonster(FlatBufferBuilder $builder) 55 { 56 $builder->StartObject(0); 57 } 58 59 /** 60 * @param FlatBufferBuilder $builder 61 * @return Monster 62 */ 63 public static function createMonster(FlatBufferBuilder $builder, ) 64 { 65 $builder->startObject(0); 66 $o = $builder->endObject(); 67 return $o; 68 } 69 70 /** 71 * @param FlatBufferBuilder $builder 72 * @return int table offset 73 */ 74 public static function endMonster(FlatBufferBuilder $builder) 75 { 76 $o = $builder->endObject(); 77 return $o; 78 } 79 } 80