com.skillw.asahi.internal.namespacing.prefix.lang.util.Logic.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pouvoir Show documentation
Show all versions of Pouvoir Show documentation
Bukkit Script Engine Plugin.
package com.skillw.asahi.internal.namespacing.prefix.lang.util
import com.skillw.asahi.api.annotation.AsahiPrefix
import com.skillw.asahi.api.prefixParser
import com.skillw.asahi.api.quest
import com.skillw.asahi.util.cast
/**
* @className Logic
*
* @author Glom
* @date 2023/1/14 0:15 Copyright 2024 Glom.
*/
@AsahiPrefix(["not"], "lang")
private fun not() = prefixParser {
val bool = quest()
result { !bool.get() }
}
@AsahiPrefix(["all"], "lang")
private fun all() = prefixParser {
val array = quest>()
result {
array.get().all { it.cast() }
}
}
@AsahiPrefix(["any"], "lang")
private fun any() = prefixParser {
val array = quest>()
result {
array.get().any { it.cast() }
}
}
@AsahiPrefix(["check", "?"], "lang")
private fun check() = prefixParser {
val a = quest()
val symbol = next()
val b = quest()
result {
com.skillw.asahi.util.check(a.get(), symbol, b.get())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy