mirror of
https://github.com/jlengrand/korge-samples.git
synced 2026-03-10 08:31:18 +00:00
migration helper functions sample
This commit is contained in:
10
asteroids/src/commonMain/kotlin/migration/klock.kt
Normal file
10
asteroids/src/commonMain/kotlin/migration/klock.kt
Normal 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")
|
||||
}
|
||||
47
asteroids/src/commonMain/kotlin/migration/view.kt
Normal file
47
asteroids/src/commonMain/kotlin/migration/view.kt
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user