<?php
// automatically generated by the FlatBuffers compiler, do not modify

namespace MyGame\Example;

use \Google\FlatBuffers\Struct;
use \Google\FlatBuffers\Table;
use \Google\FlatBuffers\ByteBuffer;
use \Google\FlatBuffers\FlatBufferBuilder;

class StructOfStructs extends Struct
{
    /**
     * @param int $_i offset
     * @param ByteBuffer $_bb
     * @return StructOfStructs
     **/
    public function init($_i, ByteBuffer $_bb)
    {
        $this->bb_pos = $_i;
        $this->bb = $_bb;
        return $this;
    }

    /**
     * @return Ability
     */
    public function getA()
    {
        $obj = new Ability();
        $obj->init($this->bb_pos + 0, $this->bb);
        return $obj;
    }

    /**
     * @return Test
     */
    public function getB()
    {
        $obj = new Test();
        $obj->init($this->bb_pos + 8, $this->bb);
        return $obj;
    }

    /**
     * @return Ability
     */
    public function getC()
    {
        $obj = new Ability();
        $obj->init($this->bb_pos + 12, $this->bb);
        return $obj;
    }


    /**
     * @return int offset
     */
    public static function createStructOfStructs(FlatBufferBuilder $builder, $a_id, $a_distance, $b_a, $b_b, $c_id, $c_distance)
    {
        $builder->prep(4, 20);
        $builder->prep(4, 8);
        $builder->putUint($c_distance);
        $builder->putUint($c_id);
        $builder->prep(2, 4);
        $builder->pad(1);
        $builder->putSbyte($b_b);
        $builder->putShort($b_a);
        $builder->prep(4, 8);
        $builder->putUint($a_distance);
        $builder->putUint($a_id);
        return $builder->offset();
    }
}
