1// Code generated by the FlatBuffers compiler. DO NOT EDIT. 2 3package Example 4 5import ( 6 flatbuffers "github.com/google/flatbuffers/go" 7) 8 9type StructOfStructsT struct { 10 A *AbilityT `json:"a"` 11 B *TestT `json:"b"` 12 C *AbilityT `json:"c"` 13} 14 15func (t *StructOfStructsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 16 if t == nil { return 0 } 17 return CreateStructOfStructs(builder, t.A.Id, t.A.Distance, t.B.A, t.B.B, t.C.Id, t.C.Distance) 18} 19func (rcv *StructOfStructs) UnPackTo(t *StructOfStructsT) { 20 t.A = rcv.A(nil).UnPack() 21 t.B = rcv.B(nil).UnPack() 22 t.C = rcv.C(nil).UnPack() 23} 24 25func (rcv *StructOfStructs) UnPack() *StructOfStructsT { 26 if rcv == nil { return nil } 27 t := &StructOfStructsT{} 28 rcv.UnPackTo(t) 29 return t 30} 31 32type StructOfStructs struct { 33 _tab flatbuffers.Struct 34} 35 36func (rcv *StructOfStructs) Init(buf []byte, i flatbuffers.UOffsetT) { 37 rcv._tab.Bytes = buf 38 rcv._tab.Pos = i 39} 40 41func (rcv *StructOfStructs) Table() flatbuffers.Table { 42 return rcv._tab.Table 43} 44 45func (rcv *StructOfStructs) A(obj *Ability) *Ability { 46 if obj == nil { 47 obj = new(Ability) 48 } 49 obj.Init(rcv._tab.Bytes, rcv._tab.Pos+0) 50 return obj 51} 52func (rcv *StructOfStructs) B(obj *Test) *Test { 53 if obj == nil { 54 obj = new(Test) 55 } 56 obj.Init(rcv._tab.Bytes, rcv._tab.Pos+8) 57 return obj 58} 59func (rcv *StructOfStructs) C(obj *Ability) *Ability { 60 if obj == nil { 61 obj = new(Ability) 62 } 63 obj.Init(rcv._tab.Bytes, rcv._tab.Pos+12) 64 return obj 65} 66 67func CreateStructOfStructs(builder *flatbuffers.Builder, a_id uint32, a_distance uint32, b_a int16, b_b int8, c_id uint32, c_distance uint32) flatbuffers.UOffsetT { 68 builder.Prep(4, 20) 69 builder.Prep(4, 8) 70 builder.PrependUint32(c_distance) 71 builder.PrependUint32(c_id) 72 builder.Prep(2, 4) 73 builder.Pad(1) 74 builder.PrependInt8(b_b) 75 builder.PrependInt16(b_a) 76 builder.Prep(4, 8) 77 builder.PrependUint32(a_distance) 78 builder.PrependUint32(a_id) 79 return builder.Offset() 80} 81