Show / Hide Table of Contents

Class RecipeVariant

Recipe variant with different ingredients which may be activated for Recipe based on some conditions (like difficulty settings).

Inheritance
System.Object
RecipeVariant
Namespace: Eco.Gameplay.Items.Recipes
Assembly: Eco.Gameplay.dll
Syntax
public class RecipeVariant : Object

Constructors

RecipeVariant(IEnumerable<IngredientElement>)

Declaration
public RecipeVariant(IEnumerable<IngredientElement> ingredients)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IngredientElement> ingredients

Fields

Ingredients

Set of ingredients for the recipe variant which will replace current set of ingredients when activated. See ActivateVariant(RecipeVariant).

Declaration
public readonly List<IngredientElement> Ingredients
Field Value
Type Description
System.Collections.Generic.List<IngredientElement>

Methods

ActivatePreset(String)

Declaration
public static void ActivatePreset(string preset)
Parameters
Type Name Description
System.String preset

Register(String, IEnumerable<KeyValuePair<Type, IngredientElement[]>>)

Registers multiple recipe variants for a preset. mapping param has mapping between RecipeFamily type and set of ingredients for the preset.

Declaration
public static void Register(string preset, IEnumerable<KeyValuePair<Type, IngredientElement[]>> mapping)
Parameters
Type Name Description
System.String preset
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Type, IngredientElement[]>> mapping

Register(String, Type, IngredientElement[])

Registers recipeFamily default recipe ingredients variant for preset. Then you can just activate all registered recipe variants for the preset at once with ActivatePreset(String). preset may have any value, it is just a reference name you can use to activate variants when required.

Declaration
public static void Register(string preset, Type recipeFamily, IngredientElement[] ingredients)
Parameters
Type Name Description
System.String preset
System.Type recipeFamily
IngredientElement[] ingredients

Register<T>(String, IngredientElement[])

Registers recipeFamily default recipe ingredients variant for preset. Then you can just activate all registered recipe variants for the preset at once with ActivatePreset(String). preset may have any value, it is just a reference name you can use to activate variants when required.

Declaration
public static void Register<T>(string preset, IngredientElement[] ingredients)
    where T : RecipeFamily
Parameters
Type Name Description
System.String preset
IngredientElement[] ingredients
Type Parameters
Name Description
T

RegisterDefault<T>(String)

Registers default (current, usually from startup) ingredients list of recipe family of type T for the preset. See Register(String, Type, IngredientElement[]).

Declaration
public static void RegisterDefault<T>(string preset)
    where T : RecipeFamily
Parameters
Type Name Description
System.String preset
Type Parameters
Name Description
T

Extension Methods

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