Added default parameters

This commit is contained in:
bluefireoly
2020-10-25 19:32:19 +01:00
parent e72128556e
commit 25c769be03
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ import kotlin.math.absoluteValue
fun <T : ForInventory> kSpigotGUI( fun <T : ForInventory> kSpigotGUI(
type: GUIType<T>, type: GUIType<T>,
guiCreator: GUICreator<T>, guiCreator: GUICreator<T> = IndividualGUICreator(),
builder: GUIBuilder<T>.() -> Unit, builder: GUIBuilder<T>.() -> Unit,
) = GUIBuilder(type, guiCreator).apply(builder).build() ) = GUIBuilder(type, guiCreator).apply(builder).build()

View File

@@ -9,8 +9,8 @@ class SharedGUICreator<T : ForInventory> : GUICreator<T>() {
} }
class IndividualGUICreator<T : ForInventory>( class IndividualGUICreator<T : ForInventory>(
private val resetOnClose: Boolean, private val resetOnClose: Boolean = true,
private val resetOnQuit: Boolean private val resetOnQuit: Boolean = true
) : GUICreator<T>() { ) : GUICreator<T>() {
override fun createInstance(guiData: GUIData<T>) = GUIIndividual(guiData, resetOnClose, resetOnQuit) override fun createInstance(guiData: GUIData<T>) = GUIIndividual(guiData, resetOnClose, resetOnQuit)
} }