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 Ability extends Struct { |
| 12 | public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } |
| 13 | public Ability __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 14 | |
| 15 | public long id() { return (long)bb.getInt(bb_pos + 0) & 0xFFFFFFFFL; } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 16 | public void mutateId(long id) { bb.putInt(bb_pos + 0, (int) id); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 17 | public long distance() { return (long)bb.getInt(bb_pos + 4) & 0xFFFFFFFFL; } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 18 | public void mutateDistance(long distance) { bb.putInt(bb_pos + 4, (int) distance); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 19 | |
| 20 | public static int createAbility(FlatBufferBuilder builder, long id, long distance) { |
| 21 | builder.prep(4, 8); |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 22 | builder.putInt((int) distance); |
| 23 | builder.putInt((int) id); |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 24 | return builder.offset(); |
| 25 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 26 | |
| 27 | public static final class Vector extends BaseVector { |
| 28 | public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; } |
| 29 | |
| 30 | public Ability get(int j) { return get(new Ability(), j); } |
| 31 | public Ability get(Ability obj, int j) { return obj.__assign(__element(j), bb); } |
| 32 | } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 33 | public AbilityT unpack() { |
| 34 | AbilityT _o = new AbilityT(); |
| 35 | unpackTo(_o); |
| 36 | return _o; |
| 37 | } |
| 38 | public void unpackTo(AbilityT _o) { |
| 39 | long _oId = id(); |
| 40 | _o.setId(_oId); |
| 41 | long _oDistance = distance(); |
| 42 | _o.setDistance(_oDistance); |
| 43 | } |
| 44 | public static int pack(FlatBufferBuilder builder, AbilityT _o) { |
| 45 | if (_o == null) return 0; |
| 46 | return createAbility( |
| 47 | builder, |
| 48 | _o.getId(), |
| 49 | _o.getDistance()); |
| 50 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 51 | } |
| 52 | |