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

import ru.dbotthepony.kommons.io.readUUID
import ru.dbotthepony.kommons.io.writeUUID
import ru.dbotthepony.kstarbound.client.ClientConnection
import ru.dbotthepony.kstarbound.defs.InteractAction
import ru.dbotthepony.kstarbound.network.IClientPacket
import ru.dbotthepony.kstarbound.network.IServerPacket
import ru.dbotthepony.kstarbound.server.ServerConnection
import java.io.DataInputStream
import java.io.DataOutputStream
import java.util.UUID

class EntityInteractResultPacket(val action: InteractAction, val id: UUID, val source: Int) : IServerPacket, IClientPacket {
	constructor(stream: DataInputStream, isLegacy: Boolean) : this(
		InteractAction(stream, isLegacy),
		stream.readUUID(),
		stream.readInt()
	)

	override fun write(stream: DataOutputStream, isLegacy: Boolean) {
		action.write(stream, isLegacy)
		stream.writeUUID(id)
		stream.writeInt(source)
	}

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

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