Port Area plugin to Kotlin

This commit is contained in:
Major
2017-09-24 18:42:06 +01:00
parent cb9e6f353d
commit ce1bcba893
4 changed files with 141 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
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)