diff --git a/build.gradle.kts b/build.gradle.kts index 8fea82a..8da6b5c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -62,7 +62,7 @@ kotlin { plugins { application java - kotlin("jvm") version "1.9.23" + kotlin("jvm") version "2.0.0" } repositories { diff --git a/gradle.properties.example b/gradle.properties.example index 0ab7834..cded0ff 100644 --- a/gradle.properties.example +++ b/gradle.properties.example @@ -1,5 +1,4 @@ org.gradle.caching=true org.gradle.parallel=true -kotlin.experimental.tryK2=true # fill in your steam directory ending with '/steamapps' userSteamDir= diff --git a/src/main/kotlin/marisa/Action.kt b/src/main/kotlin/marisa/Action.kt index 8adeac2..0cbea56 100644 --- a/src/main/kotlin/marisa/Action.kt +++ b/src/main/kotlin/marisa/Action.kt @@ -16,19 +16,22 @@ import kotlin.reflect.full.primaryConstructor val p: AbstractPlayer get() = AbstractDungeon.player val monsters: ArrayList get() = AbstractDungeon.getCurrRoom().monsters.monsters +/** Add actions to bottom of the action queue */ fun addToBot(vararg actions: AbstractGameAction) = actions.forEach { AbstractDungeon.actionManager.addToBottom(it) } +/** Add actions to bottom of the action queue */ fun addToBot(actions: List) = actions.forEach { AbstractDungeon.actionManager.addToBottom(it) } +/** Add actions to top of the action queue */ fun addToTop(vararg actions: AbstractGameAction) = actions.forEach { AbstractDungeon.actionManager.addToTop(it) } +/** Add actions to top of the action queue */ fun addToTop(actions: List) = actions.forEach { AbstractDungeon.actionManager.addToTop(it) } - fun ApplyPowerToPlayerAction(powerClass: KClass) = powerClass.primaryConstructor?.call(p).let { power -> ApplyPowerAction(p, p, power) }