Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -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 Stat extends Table { |
| 12 | public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); } |
| 13 | public static Stat getRootAsStat(ByteBuffer _bb) { return getRootAsStat(_bb, new Stat()); } |
| 14 | public static Stat getRootAsStat(ByteBuffer _bb, Stat obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } |
| 15 | public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } |
| 16 | public Stat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 17 | |
| 18 | public String id() { int o = __offset(4); return o != 0 ? __string(o + bb_pos) : null; } |
| 19 | public ByteBuffer idAsByteBuffer() { return __vector_as_bytebuffer(4, 1); } |
| 20 | public ByteBuffer idInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 4, 1); } |
| 21 | public long val() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0L; } |
| 22 | public boolean mutateVal(long val) { int o = __offset(6); if (o != 0) { bb.putLong(o + bb_pos, val); return true; } else { return false; } } |
| 23 | public int count() { int o = __offset(8); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; } |
| 24 | public boolean mutateCount(int count) { int o = __offset(8); if (o != 0) { bb.putShort(o + bb_pos, (short)count); return true; } else { return false; } } |
| 25 | |
| 26 | public static int createStat(FlatBufferBuilder builder, |
| 27 | int idOffset, |
| 28 | long val, |
| 29 | int count) { |
| 30 | builder.startTable(3); |
| 31 | Stat.addVal(builder, val); |
| 32 | Stat.addId(builder, idOffset); |
| 33 | Stat.addCount(builder, count); |
| 34 | return Stat.endStat(builder); |
| 35 | } |
| 36 | |
| 37 | public static void startStat(FlatBufferBuilder builder) { builder.startTable(3); } |
| 38 | public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addOffset(0, idOffset, 0); } |
| 39 | public static void addVal(FlatBufferBuilder builder, long val) { builder.addLong(1, val, 0L); } |
| 40 | public static void addCount(FlatBufferBuilder builder, int count) { builder.addShort(2, (short)count, (short)0); } |
| 41 | public static int endStat(FlatBufferBuilder builder) { |
| 42 | int o = builder.endTable(); |
| 43 | return o; |
| 44 | } |
| 45 | } |
| 46 | |