Class DishFactory
java.lang.Object
com.csse3200.game.entities.factories.DishFactory
Factory to create a cooking entity with predefined components.
Predefined recipe properties are loaded from a config stored as a json file and should have
the properties stores in 'CookingConfig'.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the DishFactory class, no parameters required. -
Method Summary
Modifier and TypeMethodDescriptionGet all the recipes from the dish factorygetDefinitiveRecipe
(List<String> ingredients) Gets a recipe if and only if it matches exactly the list of ingredientsstatic MultiStationRecipeConfig
getMultiStationRecipe
(String recipeName) Returns the multi station recipe config for the given recipe name.getPossibleRecipes
(List<String> ingredients) Get the list of possible recipes for associated ingredientsgetRealRecipe
(List<String> ingredients) get the recipe from a list of ingredientsstatic SingleStationRecipeConfig
getSingleStationRecipe
(String recipeName) Returns the single station recipe config for the given recipe name.static boolean
recipeExists
(String recipeName) Checks if the provided recipe name is a valid recipe as defined in the recipe.json.
-
Constructor Details
-
DishFactory
public DishFactory()Constructor for the DishFactory class, no parameters required.
-
-
Method Details
-
getPossibleRecipes
Get the list of possible recipes for associated ingredients- Parameters:
ingredients
- - needed to make the dish (specify in the recipe.json)- Returns:
- - list of recipes that contain associated ingredients
-
getDefinitiveRecipe
Gets a recipe if and only if it matches exactly the list of ingredients- Parameters:
ingredients
- - needed to make the dish (specify in the recipe.json- Returns:
- - name of recipe that contain associated ingredients
-
getSingleStationRecipe
Returns the single station recipe config for the given recipe name.- Parameters:
recipeName
- - the recipe config searched for.- Returns:
- - the SingleStationRecipeConfig for the given recipe name.
-
getMultiStationRecipe
Returns the multi station recipe config for the given recipe name.- Parameters:
recipeName
- - the recipe config searched for.- Returns:
- - the MultiStationRecipeConfig for the given recipe name.
-
recipeExists
Checks if the provided recipe name is a valid recipe as defined in the recipe.json.- Parameters:
recipeName
- - the recipe searched for.- Returns:
- - true if the recipe is valid, false otherwise.
-
getAllRecipes
Get all the recipes from the dish factory- Returns:
- the recipes from the dish factory
-
getRealRecipe
get the recipe from a list of ingredients- Parameters:
ingredients
- : The list of ingredients in the dish- Returns:
- The recipe made from the ingredients
-