Terraria.ModLoader.ModRecipe.RecipeAvailable C# (CSharp) Method

RecipeAvailable() public method

public RecipeAvailable ( ) : bool
return bool
		public virtual bool RecipeAvailable()
		{
			return true;
		}

Usage Example

Ejemplo n.º 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);
        }