package ru.dbotthepony.kstarbound.network.packets.clientbound

import ru.dbotthepony.kstarbound.client.ClientConnection
import ru.dbotthepony.kstarbound.defs.WarpAction
import ru.dbotthepony.kstarbound.network.IClientPacket
import java.io.DataInputStream
import java.io.DataOutputStream

class PlayerWarpResultPacket(val success: Boolean, val target: WarpAction, val warpActionInvalid: Boolean) : IClientPacket {
	constructor(stream: DataInputStream, isLegacy: Boolean) : this(stream.readBoolean(), WarpAction.read(stream, isLegacy), stream.readBoolean())

	override fun write(stream: DataOutputStream, isLegacy: Boolean) {
		stream.writeBoolean(success)
		target.write(stream, isLegacy)
		stream.writeBoolean(warpActionInvalid)
	}

	override fun play(connection: ClientConnection) {
		TODO("Not yet implemented")
	}
}
