// automatically generated by the FlatBuffers compiler, do not modify import * as flatbuffers from 'flatbuffers'; export class OpponentMovedEvent { bb: flatbuffers.ByteBuffer|null = null; bb_pos = 0; __init(i:number, bb:flatbuffers.ByteBuffer):OpponentMovedEvent { this.bb_pos = i; this.bb = bb; return this; } static getRootAsOpponentMovedEvent(bb:flatbuffers.ByteBuffer, obj?:OpponentMovedEvent):OpponentMovedEvent { return (obj || new OpponentMovedEvent()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsOpponentMovedEvent(bb:flatbuffers.ByteBuffer, obj?:OpponentMovedEvent):OpponentMovedEvent { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new OpponentMovedEvent()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } gameId():string|null gameId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null gameId(optionalEncoding?:any):string|Uint8Array|null { const offset = this.bb!.__offset(this.bb_pos, 4); return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; } seat():number { const offset = this.bb!.__offset(this.bb_pos, 6); return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; } action():string|null action(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null action(optionalEncoding?:any):string|Uint8Array|null { const offset = this.bb!.__offset(this.bb_pos, 8); return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; } score():number { const offset = this.bb!.__offset(this.bb_pos, 10); return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; } total():number { const offset = this.bb!.__offset(this.bb_pos, 12); return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; } static startOpponentMovedEvent(builder:flatbuffers.Builder) { builder.startObject(5); } static addGameId(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset) { builder.addFieldOffset(0, gameIdOffset, 0); } static addSeat(builder:flatbuffers.Builder, seat:number) { builder.addFieldInt32(1, seat, 0); } static addAction(builder:flatbuffers.Builder, actionOffset:flatbuffers.Offset) { builder.addFieldOffset(2, actionOffset, 0); } static addScore(builder:flatbuffers.Builder, score:number) { builder.addFieldInt32(3, score, 0); } static addTotal(builder:flatbuffers.Builder, total:number) { builder.addFieldInt32(4, total, 0); } static endOpponentMovedEvent(builder:flatbuffers.Builder):flatbuffers.Offset { const offset = builder.endObject(); return offset; } static createOpponentMovedEvent(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset, seat:number, actionOffset:flatbuffers.Offset, score:number, total:number):flatbuffers.Offset { OpponentMovedEvent.startOpponentMovedEvent(builder); OpponentMovedEvent.addGameId(builder, gameIdOffset); OpponentMovedEvent.addSeat(builder, seat); OpponentMovedEvent.addAction(builder, actionOffset); OpponentMovedEvent.addScore(builder, score); OpponentMovedEvent.addTotal(builder, total); return OpponentMovedEvent.endOpponentMovedEvent(builder); } }