1717
1818package com.lambda.interaction.material.container
1919
20- import com.lambda.context.Automated
2120import com.lambda.context.AutomatedSafeContext
2221import com.lambda.context.SafeContext
2322import com.lambda.core.Loadable
@@ -113,19 +112,18 @@ object ContainerManager : Loadable {
113112 ): MaterialContainer ? = findContainersWithMaterial(containerSelection).firstOrNull()
114113
115114 context(automatedSafeContext: AutomatedSafeContext )
116- fun StackSelection.findContainerWithSpace (
117- containerSelection : ContainerSelection = automatedSafeContext.inventoryConfig.containerSelection
118- ): MaterialContainer ? =
119- findContainersWithSpace(containerSelection).firstOrNull()
120-
121- context(automated: Automated , safeContext: SafeContext )
122115 fun StackSelection.findContainersWithMaterial (
123- containerSelection : ContainerSelection = automated .inventoryConfig.containerSelection,
116+ containerSelection : ContainerSelection = automatedSafeContext .inventoryConfig.containerSelection,
124117 ): List <MaterialContainer > =
125118 containers()
126119 .filter { containerSelection.matches(it) }
127120 .filter { it.materialAvailable(this ) >= count }
128- .sortedWith(automated.inventoryConfig.providerPriority.materialComparator(this ))
121+ .sortedWith(automatedSafeContext.inventoryConfig.providerPriority.materialComparator(this ))
122+
123+ context(automatedSafeContext: AutomatedSafeContext )
124+ fun StackSelection.findContainerWithSpace (
125+ containerSelection : ContainerSelection = automatedSafeContext.inventoryConfig.containerSelection
126+ ): MaterialContainer ? = findContainersWithSpace(containerSelection).firstOrNull()
129127
130128 context(automatedSafeContext: AutomatedSafeContext )
131129 fun StackSelection.findContainersWithSpace (
@@ -136,6 +134,11 @@ object ContainerManager : Loadable {
136134 .filter { it.spaceAvailable(this ) >= count }
137135 .sortedWith(automatedSafeContext.inventoryConfig.providerPriority.spaceComparator(this ))
138136
137+ context(automatedSafeContext: AutomatedSafeContext )
138+ fun StackSelection.findSlotWithMaterial (
139+ containerSelection : ContainerSelection = automatedSafeContext.inventoryConfig.containerSelection
140+ ) = findSlotsWithMaterial(containerSelection).firstOrNull()
141+
139142 context(automatedSafeContext: AutomatedSafeContext )
140143 fun StackSelection.findSlotsWithMaterial (
141144 containerSelection : ContainerSelection = automatedSafeContext.inventoryConfig.containerSelection
0 commit comments