import { OutPacketBase } from 'packets/out/packet' ; import { UserBuyMenu } from 'user/userbuymenu' ; class export class OutHostBuyMenu { public static build ( userId , buymenu , outPacket ) { outPacket . writeUInt32 ( userId ) ; outPacket . writeUInt16 ( 369 ) ; outPacket . writeUInt8 ( 0 ) ; this . buildSubmenu ( buymenu . pistols , outPacket ) ; this . buildSubmenu ( buymenu . shotguns , outPacket ) ; this . buildSubmenu ( buymenu . smgs , outPacket ) ; this . buildSubmenu ( buymenu . rifles , outPacket ) ; this . buildSubmenu ( buymenu . snipers , outPacket ) ; this . buildSubmenu ( buymenu . machineguns , outPacket ) ; this . buildSubmenu ( buymenu . melees , outPacket ) ; this . buildSubmenu ( buymenu . equipment , outPacket ) ; } public static buildSubmenu ( items , outPacket ) { let curItem = 0 ; outPacket . writeUInt8 ( items . length ) ; for ( const item of items ) { outPacket . writeUInt8 ( curItem ++ ) ; outPacket . writeUInt32 ( item ) ; } } }