James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | package MyGame.Example; |
| 4 | |
| 5 | import java.nio.*; |
| 6 | import java.lang.*; |
| 7 | import java.util.*; |
| 8 | import com.google.flatbuffers.*; |
| 9 | |
| 10 | @SuppressWarnings("unused") |
| 11 | public final class StructOfStructs extends Struct { |
| 12 | public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } |
| 13 | public StructOfStructs __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 14 | |
| 15 | public MyGame.Example.Ability a() { return a(new MyGame.Example.Ability()); } |
| 16 | public MyGame.Example.Ability a(MyGame.Example.Ability obj) { return obj.__assign(bb_pos + 0, bb); } |
| 17 | public MyGame.Example.Test b() { return b(new MyGame.Example.Test()); } |
| 18 | public MyGame.Example.Test b(MyGame.Example.Test obj) { return obj.__assign(bb_pos + 8, bb); } |
| 19 | public MyGame.Example.Ability c() { return c(new MyGame.Example.Ability()); } |
| 20 | public MyGame.Example.Ability c(MyGame.Example.Ability obj) { return obj.__assign(bb_pos + 12, bb); } |
| 21 | |
| 22 | public static int createStructOfStructs(FlatBufferBuilder builder, long a_id, long a_distance, short b_a, byte b_b, long c_id, long c_distance) { |
| 23 | builder.prep(4, 20); |
| 24 | builder.prep(4, 8); |
| 25 | builder.putInt((int) c_distance); |
| 26 | builder.putInt((int) c_id); |
| 27 | builder.prep(2, 4); |
| 28 | builder.pad(1); |
| 29 | builder.putByte(b_b); |
| 30 | builder.putShort(b_a); |
| 31 | builder.prep(4, 8); |
| 32 | builder.putInt((int) a_distance); |
| 33 | builder.putInt((int) a_id); |
| 34 | return builder.offset(); |
| 35 | } |
| 36 | |
| 37 | public static final class Vector extends BaseVector { |
| 38 | public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; } |
| 39 | |
| 40 | public StructOfStructs get(int j) { return get(new StructOfStructs(), j); } |
| 41 | public StructOfStructs get(StructOfStructs obj, int j) { return obj.__assign(__element(j), bb); } |
| 42 | } |
| 43 | public StructOfStructsT unpack() { |
| 44 | StructOfStructsT _o = new StructOfStructsT(); |
| 45 | unpackTo(_o); |
| 46 | return _o; |
| 47 | } |
| 48 | public void unpackTo(StructOfStructsT _o) { |
| 49 | a().unpackTo(_o.getA()); |
| 50 | b().unpackTo(_o.getB()); |
| 51 | c().unpackTo(_o.getC()); |
| 52 | } |
| 53 | public static int pack(FlatBufferBuilder builder, StructOfStructsT _o) { |
| 54 | if (_o == null) return 0; |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 55 | int _a_id = (int) _o.getA().getId(); |
| 56 | int _a_distance = (int) _o.getA().getDistance(); |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 57 | short _b_a = _o.getB().getA(); |
| 58 | byte _b_b = _o.getB().getB(); |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 59 | int _c_id = (int) _o.getC().getId(); |
| 60 | int _c_distance = (int) _o.getC().getDistance(); |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 61 | return createStructOfStructs( |
| 62 | builder, |
| 63 | _a_id, |
| 64 | _a_distance, |
| 65 | _b_a, |
| 66 | _b_b, |
| 67 | _c_id, |
| 68 | _c_distance); |
| 69 | } |
| 70 | } |
| 71 | |