mmb.engine.craft.singles.MultiRecipeGroup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multimachinebuilder Show documentation
Show all versions of multimachinebuilder Show documentation
Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world.
THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<
/**
*
*/
package mmb.engine.craft.singles;
import java.util.Set;
import mmb.Nil;
import mmb.engine.craft.Recipe;
import mmb.engine.craft.RecipeGroup;
import mmb.engine.item.ItemEntry;
import monniasza.collects.Collects;
/**
*
* @author oskar
*
*/
public interface MultiRecipeGroup> extends RecipeGroup {
/**
* Finds recipe(s) which meets criteria
* @param in required input item
* @return a matching recipe or null if not found
*/
@Nil public Set findPlausible(ItemEntry in);
/**
* Finds a single recipe which meets criteria
* @param catalyst required catalyst (null if none)
* @param in required inputs
* @return a matching recipe or null if not found
*/
@Nil public default T findExact(Set in, @Nil ItemEntry catalyst) {
Set candidates = findPlausible(Collects.first(in));
if(candidates == null) return null;
for(T candidate: candidates) {
if(candidate.catalyst() == catalyst && candidate.inputs().items().equals(in)) return candidate;
}
return null;
}
/** @return minimum ingredients */
public int minIngredients();
}