Show / Hide Table of Contents

Class ColorRecipe

Data container for single color recipe in Mixer. Holds list of ingredients (colorant names with weights) to use in color mixing process Used in client/server transfers, so needs separate sync-able container.

Inheritance
System.Object
ColorRecipe
Implements
System.IEquatable<ColorRecipe>
Namespace: Eco.Shared.Graphics
Assembly: Eco.Shared.dll
Syntax
public class ColorRecipe : Object, IEquatable<ColorRecipe>

Constructors

ColorRecipe()

Declaration
public ColorRecipe()

Properties

HasData

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

Ingredients

List of ingredients for recipe (colorant names with weights)

Declaration
[Eco(true)]
public List<ColorantWeight> Ingredients { get; }
Property Value
Type Description
System.Collections.Generic.List<ColorantWeight>

Multiplier

Declaration
[Eco(true)]
public int Multiplier { get; set; }
Property Value
Type Description
System.Int32

Methods

AddOnce(String)

Adds one portion of requested colorant to recipe

Declaration
public void AddOnce(string colorantName)
Parameters
Type Name Description
System.String colorantName

Equals(ColorRecipe)

Declaration
public bool Equals(ColorRecipe other)
Parameters
Type Name Description
ColorRecipe other
Returns
Type Description
System.Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean

GetAmount(String, Boolean)

Gets total weight of requested colorant in recipe

Declaration
public int GetAmount(string colorant, bool includeMultiplier = true)
Parameters
Type Name Description
System.String colorant
System.Boolean includeMultiplier
Returns
Type Description
System.Int32

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

GetTotalIngredientsUsed(Boolean)

Count amount of all ingredients used

Declaration
public int GetTotalIngredientsUsed(bool includeMultiplier = true)
Parameters
Type Name Description
System.Boolean includeMultiplier
Returns
Type Description
System.Int32

MakeCopy()

Makes a copy of recipe

Declaration
public ColorRecipe MakeCopy()
Returns
Type Description
ColorRecipe

RemoveOnce(String)

Removes one portion of requested colorant from recipe

Declaration
public void RemoveOnce(string colorantName)
Parameters
Type Name Description
System.String colorantName

Implements

System.IEquatable<>

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾