Skip to content

Commit

Permalink
docs: add docstring for actions
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Jun 21, 2024
1 parent 0d717d1 commit 7d1d362
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/kotlin/marisa/Action.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ import kotlin.reflect.full.primaryConstructor
val p: AbstractPlayer get() = AbstractDungeon.player
val monsters: ArrayList<AbstractMonster> 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<AbstractGameAction>) =
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<AbstractGameAction>) =
actions.forEach { AbstractDungeon.actionManager.addToTop(it) }


fun ApplyPowerToPlayerAction(powerClass: KClass<out AbstractPower>) =
powerClass.primaryConstructor?.call(p).let { power -> ApplyPowerAction(p, p, power) }

Expand Down

0 comments on commit 7d1d362

Please sign in to comment.