• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 package MyGame.Example;
4 
5 import com.google.flatbuffers.BaseVector;
6 import com.google.flatbuffers.BooleanVector;
7 import com.google.flatbuffers.ByteVector;
8 import com.google.flatbuffers.Constants;
9 import com.google.flatbuffers.DoubleVector;
10 import com.google.flatbuffers.FlatBufferBuilder;
11 import com.google.flatbuffers.FloatVector;
12 import com.google.flatbuffers.IntVector;
13 import com.google.flatbuffers.LongVector;
14 import com.google.flatbuffers.ShortVector;
15 import com.google.flatbuffers.StringVector;
16 import com.google.flatbuffers.Struct;
17 import com.google.flatbuffers.Table;
18 import com.google.flatbuffers.UnionVector;
19 import java.nio.ByteBuffer;
20 import java.nio.ByteOrder;
21 
22 @SuppressWarnings("unused")
23 public final class StructOfStructs extends Struct {
__init(int _i, ByteBuffer _bb)24   public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
__assign(int _i, ByteBuffer _bb)25   public StructOfStructs __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
26 
a()27   public MyGame.Example.Ability a() { return a(new MyGame.Example.Ability()); }
a(MyGame.Example.Ability obj)28   public MyGame.Example.Ability a(MyGame.Example.Ability obj) { return obj.__assign(bb_pos + 0, bb); }
b()29   public MyGame.Example.Test b() { return b(new MyGame.Example.Test()); }
b(MyGame.Example.Test obj)30   public MyGame.Example.Test b(MyGame.Example.Test obj) { return obj.__assign(bb_pos + 8, bb); }
c()31   public MyGame.Example.Ability c() { return c(new MyGame.Example.Ability()); }
c(MyGame.Example.Ability obj)32   public MyGame.Example.Ability c(MyGame.Example.Ability obj) { return obj.__assign(bb_pos + 12, bb); }
33 
createStructOfStructs(FlatBufferBuilder builder, long a_id, long a_distance, short b_a, byte b_b, long c_id, long c_distance)34   public static int createStructOfStructs(FlatBufferBuilder builder, long a_id, long a_distance, short b_a, byte b_b, long c_id, long c_distance) {
35     builder.prep(4, 20);
36     builder.prep(4, 8);
37     builder.putInt((int) c_distance);
38     builder.putInt((int) c_id);
39     builder.prep(2, 4);
40     builder.pad(1);
41     builder.putByte(b_b);
42     builder.putShort(b_a);
43     builder.prep(4, 8);
44     builder.putInt((int) a_distance);
45     builder.putInt((int) a_id);
46     return builder.offset();
47   }
48 
49   public static final class Vector extends BaseVector {
__assign(int _vector, int _element_size, ByteBuffer _bb)50     public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
51 
get(int j)52     public StructOfStructs get(int j) { return get(new StructOfStructs(), j); }
get(StructOfStructs obj, int j)53     public StructOfStructs get(StructOfStructs obj, int j) {  return obj.__assign(__element(j), bb); }
54   }
unpack()55   public StructOfStructsT unpack() {
56     StructOfStructsT _o = new StructOfStructsT();
57     unpackTo(_o);
58     return _o;
59   }
unpackTo(StructOfStructsT _o)60   public void unpackTo(StructOfStructsT _o) {
61     a().unpackTo(_o.getA());
62     b().unpackTo(_o.getB());
63     c().unpackTo(_o.getC());
64   }
pack(FlatBufferBuilder builder, StructOfStructsT _o)65   public static int pack(FlatBufferBuilder builder, StructOfStructsT _o) {
66     if (_o == null) return 0;
67     int _a_id = (int) _o.getA().getId();
68     int _a_distance = (int) _o.getA().getDistance();
69     short _b_a = _o.getB().getA();
70     byte _b_b = _o.getB().getB();
71     int _c_id = (int) _o.getC().getId();
72     int _c_distance = (int) _o.getC().getDistance();
73     return createStructOfStructs(
74       builder,
75       _a_id,
76       _a_distance,
77       _b_a,
78       _b_b,
79       _c_id,
80       _c_distance);
81   }
82 }
83 
84