1// automatically generated by the FlatBuffers compiler, do not modify 2/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ 3import * as flatbuffers from 'flatbuffers'; 4export class Attacker { 5 constructor() { 6 this.bb = null; 7 this.bb_pos = 0; 8 } 9 __init(i, bb) { 10 this.bb_pos = i; 11 this.bb = bb; 12 return this; 13 } 14 static getRootAsAttacker(bb, obj) { 15 return (obj || new Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb); 16 } 17 static getSizePrefixedRootAsAttacker(bb, obj) { 18 bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); 19 return (obj || new Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb); 20 } 21 swordAttackDamage() { 22 const offset = this.bb.__offset(this.bb_pos, 4); 23 return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; 24 } 25 mutate_sword_attack_damage(value) { 26 const offset = this.bb.__offset(this.bb_pos, 4); 27 if (offset === 0) { 28 return false; 29 } 30 this.bb.writeInt32(this.bb_pos + offset, value); 31 return true; 32 } 33 static getFullyQualifiedName() { 34 return 'Attacker'; 35 } 36 static startAttacker(builder) { 37 builder.startObject(1); 38 } 39 static addSwordAttackDamage(builder, swordAttackDamage) { 40 builder.addFieldInt32(0, swordAttackDamage, 0); 41 } 42 static endAttacker(builder) { 43 const offset = builder.endObject(); 44 return offset; 45 } 46 static createAttacker(builder, swordAttackDamage) { 47 Attacker.startAttacker(builder); 48 Attacker.addSwordAttackDamage(builder, swordAttackDamage); 49 return Attacker.endAttacker(builder); 50 } 51 unpack() { 52 return new AttackerT(this.swordAttackDamage()); 53 } 54 unpackTo(_o) { 55 _o.swordAttackDamage = this.swordAttackDamage(); 56 } 57} 58export class AttackerT { 59 constructor(swordAttackDamage = 0) { 60 this.swordAttackDamage = swordAttackDamage; 61 } 62 pack(builder) { 63 return Attacker.createAttacker(builder, this.swordAttackDamage); 64 } 65} 66