Class RecipeVariant
Recipe variant with different ingredients which may be activated for Recipe based on some conditions (like difficulty settings).
Inheritance
System.Object
RecipeVariant
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
Declaration
public readonly List<IngredientElement> Ingredients
Field Value
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 Parameters
RegisterDefault<T>(String)
Declaration
public static void RegisterDefault<T>(string preset)
where T : RecipeFamily
Parameters
| Type |
Name |
Description |
| System.String |
preset |
|
Type Parameters
Extension Methods