import { RoomCode } from "../packetElements/roomCode" ; import { PolusBuffer } from "../../util/polusBuffer" ; import { PacketHandler } from "../packet" ; export interface StartGamePacket { type : "StartGame" ; RoomCode : string ; } export const StartGame = { parse ( packet ) { return { type : "StartGame" , RoomCode : RoomCode . decode ( packet . read32 ( ) ) , } ; } , serialize ( packet ) { var buf = new PolusBuffer ( 4 ) ; buf . write32 ( RoomCode . encode ( packet . RoomCode ) ) ; return buf ; } , } ;