net.silkmc.silk.igui.GuiUseable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silk-igui Show documentation
Show all versions of silk-igui Show documentation
Silk is a Minecraft API for Kotlin
package net.silkmc.silk.igui
abstract class GuiUseable {
protected val registeredGuis = HashSet()
var inUse = false
private set
protected open fun onChangeUseStatus(inUse: Boolean) { }
internal open fun startUsing(gui: Gui) {
if (registeredGuis.isEmpty()) {
inUse = true
onChangeUseStatus(true)
}
registeredGuis += gui
}
internal open fun stopUsing(gui: Gui) {
registeredGuis -= gui
if (registeredGuis.isEmpty()) {
inUse = false
onChangeUseStatus(false)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy