commonMain.com.bselzer.gw2.v2.model.tile.position.TexturePosition.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of v2-model Show documentation
Show all versions of v2-model Show documentation
Guild Wars 2 API models for v2-client.
The newest version!
package com.bselzer.gw2.v2.model.tile.position
import com.bselzer.ktx.geometry.dimension.bi.position.Coordinates2D
import com.bselzer.ktx.geometry.dimension.bi.position.Point2D
import com.bselzer.ktx.serialization.serializer.Point2DSerializer
import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline
/**
* The absolute position within the full dimensions of the texture, equivalent to the dimensions at the maximum zoom level.
*/
@Serializable
@JvmInline
value class TexturePosition(
@Serializable(with = Point2DSerializer::class)
private val value: Point2D = Point2D()
) : Coordinates2D {
constructor(x: Double, y: Double) : this(Point2D(x, y))
override val x: Double
get() = value.x
override val y: Double
get() = value.y
override fun toString(): String = value.toString()
}