package ru.dbotthepony.mc.otm.network.synchronizer

interface FieldAccess<V> {
	fun read(): V
	fun write(value: V)
}

interface FloatFieldAccess : FieldAccess<Float> {
	override fun write(value: Float)
	@Deprecated("Use type specific method", replaceWith = ReplaceWith("this.readFloat()"))
	override fun read() = readFloat()
	fun readFloat(): Float
}

interface DoubleFieldAccess : FieldAccess<Double> {
	override fun write(value: Double)
	@Deprecated("Use type specific method", replaceWith = ReplaceWith("this.readDouble()"))
	override fun read() = readDouble()
	fun readDouble(): Double
}

interface IntFieldAccess : FieldAccess<Int> {
	override fun write(value: Int)
	@Deprecated("Use type specific method", replaceWith = ReplaceWith("this.readInt()"))
	override fun read() = readInt()
	fun readInt(): Int
}

interface LongFieldAccess : FieldAccess<Long> {
	override fun write(value: Long)
	@Deprecated("Use type specific method", replaceWith = ReplaceWith("this.readLong()"))
	override fun read() = readLong()
	fun readLong(): Long
}

interface BooleanFieldAccess : FieldAccess<Boolean> {
	override fun write(value: Boolean)
	@Deprecated("Use type specific method", replaceWith = ReplaceWith("this.readBoolean()"))
	override fun read() = readBoolean()
	fun readBoolean(): Boolean
}
