Package-level declarations

Types

Link copied to clipboard
open class BundleDelegate<T>(var prefix: String, val substitutions: Array<T?>?)

Delegates to an I18n bundle entry and allows substitutions.

Link copied to clipboard
open class DynamicBundleDelegate(prefix: String, val functions: Array<out () -> Any?>?) : BundleDelegate<Any>

Similar to BundleDelegate but substitutions are performed dynamically. The output is cached and only reformatted if the outputs of functions have changed.

Link copied to clipboard
open class LazyDynamicBundleDelegate(val lazyPrefix: () -> String?, val functions: Array<out () -> Any?>) : DynamicBundleDelegate

Similar to DynamicBundleDelegate but the prefix is computed lazily. If lazyPrefix returns null, a placeholder value is returned, and lazyPrefix will be called again on next access.

Link copied to clipboard
open class LazyNameSettingDelegate<T>(val lazyPrefix: () -> String?, default: T) : SettingDelegate<T>

Same as SettingDelegate, but the name is computed lazily (during the first access). If lazyPrefix returns null, the default value is returned, and lazyPrefix will be called again on next access.

Link copied to clipboard
open class SettingDelegate<T>(var prefix: String, val default: T)

Delegates to a setting.

Functions

Link copied to clipboard
fun bundle(prefix: String = ""): BundleDelegate<Nothing>

Creates a bundle delegate with no substitutions.

fun bundle(prefix: String = "", vararg substitutions: Any?): BundleDelegate<Any?>

Creates a read-only property delegate that represents the value of the underlying bundle entry.

Link copied to clipboard
fun dynamicBundle(lazyPrefix: () -> String?, vararg functions: () -> Any?): LazyDynamicBundleDelegate

Creates a property delegates that delegates to a mindustry bundle entry.

fun dynamicBundle(prefix: String = "", vararg functions: () -> Any?): DynamicBundleDelegate

Creates a read-only property delegate that delegates to a mindustry bundle entry.

Link copied to clipboard
inline fun <T> setting(default: T, noinline lazyPrefix: () -> String?): SettingDelegate<T>

Creates a property delegates that delegates to a mindustry setting.

inline fun <T> setting(default: T, prefix: String = ""): SettingDelegate<T>

Creates a property delegate that represents the value of the corresponding mindustry setting.