package ru.dbotthepony.kstarbound.world.entities

import ru.dbotthepony.kommons.io.readInt
import ru.dbotthepony.kommons.io.writeInt
import ru.dbotthepony.kstarbound.network.syncher.readPointer
import ru.dbotthepony.kstarbound.network.syncher.writePointer
import java.io.InputStream
import java.io.OutputStream

data class MovingCollisionID(val entity: Int = 0, val collisionIndex: Int = -1) {
	constructor(stream: InputStream) : this(stream.readInt(), stream.readPointer().toInt())

	fun write(stream: OutputStream) {
		stream.writeInt(entity)
		stream.writePointer(collisionIndex)
	}

	companion object {
		val ZERO = MovingCollisionID(0, -1)
	}
}
