migration helper functions sample

This commit is contained in:
avdim
2020-11-05 11:35:16 +03:00
parent 486a3c917d
commit 433642ef01
2 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
package com.soywiz.klock
@Deprecated(
message = "Need migrate to milliseconds",
replaceWith = ReplaceWith("milliseconds"),
level = DeprecationLevel.ERROR)
inline val Int.hrMilliseconds: TimeSpan get() {
throw Error("migrate")
}

View File

@@ -0,0 +1,47 @@
package com.soywiz.korge.view
import com.soywiz.klock.TimeSpan
import com.soywiz.korim.bitmap.BmpSlice
import com.soywiz.korio.lang.Cancellable
import com.soywiz.korio.resources.Resourceable
import com.soywiz.korma.geom.Angle
import com.soywiz.korma.geom.vector.VectorPath
@Deprecated(
message = "Need migrate to addUpdater()",
replaceWith = ReplaceWith("addUpdater(updatable)"),
level = DeprecationLevel.ERROR
)
inline fun <T : View> T.addHrUpdater(updatable: T.(dt: TimeSpan) -> Unit): Cancellable {
throw Error("migrate")
}
@Deprecated(
message = "Need migrate to rotation",
replaceWith = ReplaceWith("rotation"),
level = DeprecationLevel.ERROR
)
inline var View.rotationDegrees: Angle
get() {
throw Error("migrate")
}
set(v) {
throw Error("migrate")
}
//todo unfortunately it not work, because class Image resolve first
@Deprecated(
message = "Need migrate to BaseImage",
replaceWith = ReplaceWith("BaseImage(bitmap, anchorX, anchorY, hitShape, hitShape, smoothing)"),
level = DeprecationLevel.ERROR
)
inline fun Image(
bitmap: Resourceable<out BmpSlice>,
anchorX: Double = 0.0,
anchorY: Double = anchorX,
hitShape: VectorPath? = null,
smoothing: Boolean = true
) : Image {
throw Error("migrate")
}