// This file has been automatically generated by writeMessageClasses.js import { UUID } from '../UUID'; import { MessageFlags } from '../../enums/MessageFlags'; import { MessageBase } from '../MessageBase'; import { Message } from '../../enums/Message'; export class InventoryAssetResponseMessage implements MessageBase { name = 'InventoryAssetResponse'; messageFlags = MessageFlags.Trusted | MessageFlags.FrequencyLow; id = Message.InventoryAssetResponse; QueryData: { QueryID: UUID; AssetID: UUID; IsReadable: boolean; }; getSize(): number { return 33; } // @ts-ignore writeToBuffer(buf: Buffer, pos: number): number { const startPos = pos; this.QueryData['QueryID'].writeToBuffer(buf, pos); pos += 16; this.QueryData['AssetID'].writeToBuffer(buf, pos); pos += 16; buf.writeUInt8((this.QueryData['IsReadable']) ? 1 : 0, pos++); return pos - startPos; } // @ts-ignore readFromBuffer(buf: Buffer, pos: number): number { const startPos = pos; const newObjQueryData: { QueryID: UUID, AssetID: UUID, IsReadable: boolean } = { QueryID: UUID.zero(), AssetID: UUID.zero(), IsReadable: false }; newObjQueryData['QueryID'] = new UUID(buf, pos); pos += 16; newObjQueryData['AssetID'] = new UUID(buf, pos); pos += 16; newObjQueryData['IsReadable'] = (buf.readUInt8(pos++) === 1); this.QueryData = newObjQueryData; return pos - startPos; } }