deprecate some kutil 1.23 functions

This commit is contained in:
Bixilon 2023-06-24 22:29:20 +02:00
parent 334939b8b5
commit a5cead6768
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -331,10 +331,12 @@ object KUtil {
return x.matches(other.x, margin) && y.matches(other.y, margin) && z.matches(other.z, margin)
}
@Deprecated("glm, to remove")
fun toRad(value: Float): Float {
return value * 0.017453292f
}
@Deprecated("Kutil 1.23")
fun String.fill(char: Char, length: Int): String {
if (this.length >= length) return this
val fill = char.toString().repeat(length - this.length)
@ -342,17 +344,6 @@ object KUtil {
return fill + this
}
fun <T> Array<T>.next(current: T): T {
val index = this.indexOf(current)
check(index >= 0) { "Array does not contain $current" }
if (index == this.size - 1) {
return this[0]
}
return this[index + 1]
}
fun <T> table(elements: Collection<T>, vararg headers: AnyString, builder: (T) -> Array<Any?>?): Table {
val table = Table(headers.unsafeCast())
@ -363,6 +354,7 @@ object KUtil {
return table
}
@Deprecated("Kutil 1.23")
fun AbstractLatch?.child(count: Int): AbstractLatch {
if (this == null) return SimpleLatch(count)
return ParentLatch(count, this)