Files
apollo/game/plugin/areas/src/action.kt
T
2017-09-24 18:50:13 +01:00

18 lines
478 B
Kotlin

package org.apollo.game.plugins.area
/**
* Defines an area action using the DSL.
*/
fun action(@Suppress("UNUSED_PARAMETER") name: String, builder: ActionBuilder.() -> Unit) {
val listener = ActionBuilder()
builder(listener)
actions.add(listener.build())
}
/**
* The [Set] of ([Area], [AreaAction]) [Pair]s.
*/
val actions = mutableSetOf<Pair<Area, AreaAction>>()
class AreaAction(val entrance: AreaListener, val inside: AreaListener, val exit: AreaListener)