Mod Helpers  v5.9.6
A centralized collection of library code, helpful services, and end-user functions for mod management and information.
HamstarHelpers.Helpers.Recipes.RecipeHelpers Class Reference

Assorted static "helper" functions pertaining to recipes. More...

Static Public Member Functions

static RecipeCraftFailReason GetRecipeFailReasons (Player player, Recipe recipe, out int[] missingTile, out IDictionary< int, int > missingItemTypesStacks, IEnumerable< Item > availableIngredients=null)
 Reports all the reasons a given recipe for a givne player will fail with a given set of ingredients (defaults to the player's inventory). More...
 
static IList< int > GetAvailableRecipesOfIngredients (Player player, IEnumerable< Item > ingredients)
 Gets available recipes of a given set of ingredient items for a given player. More...
 
static bool ItemHasIngredients (int itemType, IDictionary< int, int > ingredients)
 Indicates if a given item type has the ingredients it needs to be crafted from any of its recipes. Does not check tile requirements. More...
 

Detailed Description

Assorted static "helper" functions pertaining to recipes.

Definition at line 34 of file RecipeHelpers.cs.

Member Function Documentation

◆ GetAvailableRecipesOfIngredients()

static IList<int> HamstarHelpers.Helpers.Recipes.RecipeHelpers.GetAvailableRecipesOfIngredients ( Player  player,
IEnumerable< Item >  ingredients 
)
static

Gets available recipes of a given set of ingredient items for a given player.

Parameters
player
ingredients
Returns

Definition at line 147 of file RecipeHelpers.cs.

◆ GetRecipeFailReasons()

static RecipeCraftFailReason HamstarHelpers.Helpers.Recipes.RecipeHelpers.GetRecipeFailReasons ( Player  player,
Recipe  recipe,
out int []  missingTile,
out IDictionary< int, int >  missingItemTypesStacks,
IEnumerable< Item >  availableIngredients = null 
)
static

Reports all the reasons a given recipe for a givne player will fail with a given set of ingredients (defaults to the player's inventory).

Parameters
player
recipe
missingTileReturns the tile IDs (crafting stations) needed for the recipe.
missingItemTypesStacksReturns the missing item ids and amounts for the recipe.
availableIngredients
Returns

Definition at line 45 of file RecipeHelpers.cs.

◆ ItemHasIngredients()

static bool HamstarHelpers.Helpers.Recipes.RecipeHelpers.ItemHasIngredients ( int  itemType,
IDictionary< int, int >  ingredients 
)
static

Indicates if a given item type has the ingredients it needs to be crafted from any of its recipes. Does not check tile requirements.

Parameters
itemTypeItem type to find recipes for.
ingredientsIngredient item types and their stack sizes.
Returns

Definition at line 183 of file RecipeHelpers.cs.


The documentation for this class was generated from the following file: