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