commonMain.com.bselzer.ktx.serialization.serializer.DigonSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geometry-serialization-jvm Show documentation
Show all versions of geometry-serialization-jvm Show documentation
kotlinx.serialization for two and three dimensional geometrical objects.
package com.bselzer.ktx.serialization.serializer
import com.bselzer.ktx.geometry.dimension.bi.polygon.Digon
import com.bselzer.ktx.geometry.dimension.bi.position.Point2D
/**
* A serializer for converting an array into a [Digon].
*/
class DigonSerializer : PolygonSerializer() {
override val serialName: String = Digon::class.qualifiedName!!
override fun deserialize(points: List): Digon = Digon(points.at(0), points.at(1))
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy