RecipeAvailable() public method

public RecipeAvailable ( ) : bool
return bool
示例#1
0
        /// <summary>
        /// Returns whether or not the conditions are met for this recipe to be available for the player to use.
        /// </summary>
        /// <param name="recipe">The recipe to check.</param>
        /// <returns>Whether or not the conditions are met for this recipe.</returns>
        public static bool RecipeAvailable(Recipe recipe)
        {
            ModRecipe modRecipe = recipe as ModRecipe;

            if (modRecipe != null && !modRecipe.RecipeAvailable())
            {
                return(false);
            }
            foreach (GlobalRecipe globalRecipe in globalRecipes)
            {
                if (!globalRecipe.RecipeAvailable(recipe))
                {
                    return(false);
                }
            }
            return(true);
        }