All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.silkmc.silk.igui.GuiDimensions.kt Maven / Gradle / Ivy

There is a newer version: 1.10.7
Show newest version
package net.silkmc.silk.igui

data class GuiDimensions(val width: Int, val height: Int) {
    val slotAmount = width * height

    val guiSlots = ArrayList().apply {
        for (row in 1..height) for (slotInRow in 1..width) {
            add(GuiSlot(row, slotInRow))
        }
        sortBy { it.slotIndexIn(this@GuiDimensions) }
    }

    val slotMap = HashMap().apply {
        guiSlots.forEach {
            put(it.slotIndexIn(this@GuiDimensions)!!, it)
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy