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

import ru.dbotthepony.kstarbound.client.ClientConnection
import ru.dbotthepony.kstarbound.network.IClientPacket
import ru.dbotthepony.kstarbound.world.TileHealth
import java.io.DataInputStream
import java.io.DataOutputStream

class TileDamageUpdatePacket(val x: Int, val y: Int, val isBackground: Boolean, val health: TileHealth) : IClientPacket {
	constructor(stream: DataInputStream, isLegacy: Boolean) : this(stream.readInt(), stream.readInt(), stream.readBoolean(), TileHealth.Tile(stream, isLegacy))

	override fun write(stream: DataOutputStream, isLegacy: Boolean) {
		stream.writeInt(x)
		stream.writeInt(y)
		stream.writeBoolean(isBackground)
		health.write(stream, isLegacy)
	}

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