Show / Hide Table of Contents

Class Recipe

Inheritance
System.Object
Recipe
Implements
IController
IViewController
IHasUniversalID
ILinkable
Namespace: Eco.Gameplay.Items.Recipes
Assembly: Eco.Gameplay.dll
Syntax
public class Recipe : Object, IController, IViewController, IHasUniversalID, ILinkable

Constructors

Recipe()

Declaration
public Recipe()

Recipe(String, LocString, IngredientElement[], CraftingElement[])

Declaration
public Recipe(string name, LocString displayName, IngredientElement[] ingredients, params CraftingElement[] outputs)
Parameters
Type Name Description
System.String name
LocString displayName
IngredientElement[] ingredients
CraftingElement[] outputs

Properties

ControllerID

Declaration
public ref int ControllerID { get; }
Property Value
Type Description
System.Int32

DisplayName

Declaration
public LocString DisplayName { get; set; }
Property Value
Type Description
LocString

Family

Declaration
public RecipeFamily Family { get; }
Property Value
Type Description
RecipeFamily

Ingredients

Declaration
public List<IngredientElement> Ingredients { get; protected set; }
Property Value
Type Description
System.Collections.Generic.List<IngredientElement>

Name

Declaration
public string Name { get; protected set; }
Property Value
Type Description
System.String

Products

Declaration
[NewTooltipChildren]
public List<CraftingElement> Products { get; protected set; }
Property Value
Type Description
System.Collections.Generic.List<CraftingElement>

RequiresStrangeBlueprint

When true, this recipe will require the user to possess the strange blueprint with the corresponding name.

Declaration
public bool RequiresStrangeBlueprint { get; set; }
Property Value
Type Description
System.Boolean

UsesPlayerInventory

When false,this recipe will not use player inventory on craft. Can be useful for dangerous recipes like tool scrap, etc.

Declaration
public bool UsesPlayerInventory { get; set; }
Property Value
Type Description
System.Boolean

Methods

ActivateVariant(RecipeVariant)

Activates RecipeVariant for this recipe.

Declaration
public void ActivateVariant(RecipeVariant variant)
Parameters
Type Name Description
RecipeVariant variant

HasIngredients(User, Inventory)

Checks if the inventory has any of the required ingredients.

Declaration
public bool HasIngredients(User user, Inventory inv)
Parameters
Type Name Description
User user
Inventory inv
Returns
Type Description
System.Boolean

Init(String, LocString, List<IngredientElement>, List<CraftingElement>)

Declaration
public void Init(string name, LocString displayName, List<IngredientElement> ingredients, List<CraftingElement> items)
Parameters
Type Name Description
System.String name
LocString displayName
System.Collections.Generic.List<IngredientElement> ingredients
System.Collections.Generic.List<CraftingElement> items

MainProductQuantity()

Declaration
public int MainProductQuantity()
Returns
Type Description
System.Int32

OnLinkClicked(TooltipOrigin, TooltipClickContext, User)

Declaration
public void OnLinkClicked(TooltipOrigin origin, TooltipClickContext clickContext, User user)
Parameters
Type Name Description
TooltipOrigin origin
TooltipClickContext clickContext
User user

UILinkContent()

Declaration
public LocString UILinkContent()
Returns
Type Description
LocString

Implements

IController
IViewController
IHasUniversalID
ILinkable

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
MarketplaceExtensions.IsPaidItem(Recipe)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾