SlotData¶
@Serializable
data class SlotData(
val groups: MutableMap<String, SlotGroup> = mutableMapOf(),
val playerGroup: SlotGroup = SlotGroup(size = IntSize(9, 3))
)
Aggregated slot layout data for an entire ComposeContainerScreen.
Contains named groups for block-entity slots and a separate playerGroup for the player inventory rows.
Constructors¶
SlotData¶
constructor(groups: MutableMap<String, SlotGroup> = mutableMapOf(), playerGroup: SlotGroup = SlotGroup(size = IntSize(9, 3)))
Types¶
Companion¶
object Companion
Properties¶
groups¶
val groups: MutableMap<String, SlotGroup>
playerGroup¶
val playerGroup: SlotGroup
playerSlotsOwner¶
val playerSlotsOwner: Int
slotGroupOwner for the player inventory - see PLAYER_GROUP_ID.
slots¶
val slots: Set<IntCoordinates>
All slot coordinates across all groups (does not include playerGroup).
Functions¶
slotGroupOwner¶
fun slotGroupOwner(id: String): Int
The layer depth currently placing the group named id - the deepest Slots on screen declaring it, or 0 when nothing has claimed it.
Backed by a snapshot map holding immutable lists, so a shallower declaration of the same group recomposes when a layer takes it over; a plain map of mutable lists would mutate unobserved and leave the loser still drawing a group that has moved.