Skip to content

on_command

fun on_command(
name: String,
command: (subject: Entity) -> DeveloperCommandDefinition
)
Example
class Where(subject: Entity) : DeveloperCommandDefinition(subject) {
override val commandHelp = "Say which tile you stand on"
override fun run() = subject.message("You are at ${subject.tile4}.")
}
on_command("where", ::Where, groups = Everyone)
name: String
command: (subject: Entity) -> DeveloperCommandDefinition

fun on_command(
name: String,
command: (subject: Entity) -> DeveloperCommandDefinition,
groups: Everyone
)
name: String
command: (subject: Entity) -> DeveloperCommandDefinition
groups: Everyone

Everyone

fun on_command(
name: String,
command: (subject: Entity) -> DeveloperCommandDefinition,
groups: List<String>
)
name: String
command: (subject: Entity) -> DeveloperCommandDefinition
groups: List<String>