Class ComponentTable
java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.component.ComponentTable
Per-session component registry: maps slots to their owning component and resolves the
components watching a set of dirty token ids. Rejects slot overlaps and components
without an item source at registration time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(@NotNull ComponentInstance component) Registers a component; validated before any slot is bound so a failed add leaves the table unchanged.@NotNull List<ComponentInstance>all()@Nullable ComponentInstancecomponentAt(int slot) @NotNull List<ComponentInstance>watchersOf(@NotNull Set<Integer> dirtyTokenIds) Resolves the components whose watched token ids intersect the dirty set, in declaration order.
-
Constructor Details
-
ComponentTable
public ComponentTable()
-
-
Method Details
-
add
Registers a component; validated before any slot is bound so a failed add leaves the table unchanged.- Throws:
ViewConfigurationException- on slot overlap or when the component declares no item source
-
componentAt
- Returns:
- the component bound to the slot, or null when the slot is component-less
-
all
- Returns:
- all registered components in declaration order; unmodifiable
-
watchersOf
@NotNull public @NotNull List<ComponentInstance> watchersOf(@NotNull @NotNull Set<Integer> dirtyTokenIds) Resolves the components whose watched token ids intersect the dirty set, in declaration order.
-