dynamicBundle

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

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

Whenever the property is accessed, all providen functions are invoked. If the property was accessed before and the outputs of the functions are the same as before, a cached value is returned to avoid unnecessary allocations. Otherwise, Core.bundle.format() is called.

See the description of bundle() for more info.


fun dynamicBundle(lazyPrefix: () -> String?, vararg functions: () -> Any?): LazyDynamicBundleDelegate

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

Unlike the delegate returned by dynamicBundle, this one computes the prefix lazily - during the first access. If the value returned by lazyPrefix is null, the delegate remains uninitialised, returning the default value and ignoring assignments, but calling lazyPrefix during each of these operations until it actually returns a value.

See the descriptions of dynamicBundle() and bundle() for more info.