Class RecipeIndexDefault
java.lang.Object
org.cyclops.integratedcrafting.core.RecipeIndexDefault
- All Implemented Interfaces:
IRecipeIndex,IRecipeIndexModifiable
A default implementation of
IRecipeIndex and IRecipeIndexModifiable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecipe(org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe) Add the given recipe to this index.protected <T,M> void addRecipeForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T, M, Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> index, org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe) Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition><T,M> Iterator<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> getRecipes(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> outputType, T output, M matchCondition) Find recipes with the given output.protected <T,M> org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T, M, Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> initializeIndex(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> recipeComponent) voidremoveRecipe(org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe) Remove the given recipe from this index.protected <T,M> void removeRecipeForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T, M, Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> index, org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
-
Constructor Details
-
RecipeIndexDefault
public RecipeIndexDefault()
-
-
Method Details
-
getRecipes
public Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> getRecipes()- Specified by:
getRecipesin interfaceIRecipeIndex- Returns:
- All recipes that are available.
-
getRecipes
public <T,M> Iterator<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> getRecipes(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> outputType, T output, M matchCondition) Description copied from interface:IRecipeIndexFind recipes with the given output.- Specified by:
getRecipesin interfaceIRecipeIndex- Type Parameters:
T- The instance type.M- The matching condition parameter, may be Void.- Parameters:
outputType- The recipe component type.output- An output ingredient instance.matchCondition- A condition under which the matching should be done.- Returns:
- An iterator of the recipes that have the given output.
-
initializeIndex
@Nullable protected <T,M> org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M, initializeIndexSet<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> (org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> recipeComponent) -
addRecipe
public void addRecipe(org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe) Description copied from interface:IRecipeIndexModifiableAdd the given recipe to this index.- Specified by:
addRecipein interfaceIRecipeIndexModifiable- Parameters:
prioritizedRecipe- A recipe.
-
addRecipeForComponent
protected <T,M> void addRecipeForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T, M, Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> index, org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe) -
removeRecipe
public void removeRecipe(org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe) Description copied from interface:IRecipeIndexModifiableRemove the given recipe from this index.- Specified by:
removeRecipein interfaceIRecipeIndexModifiable- Parameters:
prioritizedRecipe- A recipe.
-
removeRecipeForComponent
protected <T,M> void removeRecipeForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T, M, Set<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>> index, org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition prioritizedRecipe)
-