Files
CalamityModPublic/CustomRecipes/ArsenalTierGatedRecipe.cs
T
tomat 67bceff6e7 Initial dotnet format pass.
This commit formats the entire codebase according to `dotnet format` and its limited understanding of our provided `.editorconfig`.
2024-02-28 21:49:50 -08:00

29 lines
968 B
C#

using System;
using Terraria;
using Terraria.Localization;
namespace CalamityMod.CustomRecipes
{
public static class ArsenalTierGatedRecipe
{
public static LocalizedText ConstructRecipeCondition(int tier, out Func<bool> condition)
{
condition = new Func<bool>(() => HasTierBeenLearned(tier));
return Language.GetOrRegister($"Mods.CalamityMod.Misc.Tier{tier}ArsenalRecipeCondition");
}
public static bool HasTierBeenLearned(int tier)
{
return tier switch
{
1 => RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes,
2 => RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes,
3 => RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes,
4 => RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes,
5 => RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes,
_ => false,
};
}
}
}