blob: 0f9c28e75a050d7e62a79753d2b4ae0ef594e734 [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// automatically generated by the FlatBuffers compiler, do not modify
2
3import java.nio.*;
4import java.lang.*;
5import java.util.*;
6import com.google.flatbuffers.*;
7
8@SuppressWarnings("unused")
9public final class Attacker extends Table {
James Kuszmaul3b15b0c2022-11-08 14:03:16 -080010 public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070011 public static Attacker getRootAsAttacker(ByteBuffer _bb) { return getRootAsAttacker(_bb, new Attacker()); }
12 public static Attacker getRootAsAttacker(ByteBuffer _bb, Attacker obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
13 public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
14 public Attacker __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
15
16 public int swordAttackDamage() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
17 public boolean mutateSwordAttackDamage(int sword_attack_damage) { int o = __offset(4); if (o != 0) { bb.putInt(o + bb_pos, sword_attack_damage); return true; } else { return false; } }
18
19 public static int createAttacker(FlatBufferBuilder builder,
James Kuszmaul8e62b022022-03-22 09:33:25 -070020 int swordAttackDamage) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -070021 builder.startTable(1);
James Kuszmaul8e62b022022-03-22 09:33:25 -070022 Attacker.addSwordAttackDamage(builder, swordAttackDamage);
Austin Schuhe89fa2d2019-08-14 20:24:23 -070023 return Attacker.endAttacker(builder);
24 }
25
26 public static void startAttacker(FlatBufferBuilder builder) { builder.startTable(1); }
27 public static void addSwordAttackDamage(FlatBufferBuilder builder, int swordAttackDamage) { builder.addInt(0, swordAttackDamage, 0); }
28 public static int endAttacker(FlatBufferBuilder builder) {
29 int o = builder.endTable();
30 return o;
31 }
Austin Schuh272c6132020-11-14 16:37:52 -080032
33 public static final class Vector extends BaseVector {
34 public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
35
36 public Attacker get(int j) { return get(new Attacker(), j); }
37 public Attacker get(Attacker obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); }
38 }
James Kuszmaul8e62b022022-03-22 09:33:25 -070039 public AttackerT unpack() {
40 AttackerT _o = new AttackerT();
41 unpackTo(_o);
42 return _o;
43 }
44 public void unpackTo(AttackerT _o) {
45 int _oSwordAttackDamage = swordAttackDamage();
46 _o.setSwordAttackDamage(_oSwordAttackDamage);
47 }
48 public static int pack(FlatBufferBuilder builder, AttackerT _o) {
49 if (_o == null) return 0;
50 return createAttacker(
51 builder,
52 _o.getSwordAttackDamage());
53 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070054}
55