docs.unity3d.com
    Show / Hide Table of Contents

    Class ExpressionCondition

    List of multiple conditions. Similiar to the CombinedCondition class except each condition has an operator that is separate of the other conditions. Used to describe complex, one-level logic equations.

    Inheritance
    Object
    ExpressionCondition
    Namespace: Unity.Industrial.Forma.Core.Ruling
    Syntax
    [MovedFrom(true, "UnityEngine.Industrial.Configuring.Core.Ruling", "Unity.Industrial.Configurator", null)]
    [Serializable]
    public class ExpressionCondition : IMultiOperatorCondition, IRuleCondition

    Constructors

    ExpressionCondition()

    Initializes a new instance of the ExpressionCondition class.

    Declaration
    public ExpressionCondition()

    Properties

    Conditions

    Conditions within this expression

    Declaration
    public IReadOnlyList<IRuleCondition> Conditions { get; }
    Property Value
    Type Description
    IReadOnlyList<IRuleCondition>

    Expressions

    Expressions contained within this rule

    Declaration
    public List<ConditionLink> Expressions { get; }
    Property Value
    Type Description
    List<ConditionLink>

    Methods

    Add(IRuleCondition)

    Adds the specified condition.

    Declaration
    public bool Add(IRuleCondition condition)
    Parameters
    Type Name Description
    IRuleCondition condition

    The condition.

    Returns
    Type Description
    Boolean

    trueThe condition was added. false Condition would have led to an infinite cycle and was not added.

    Add(IRuleCondition, Operator)

    Adds the specified condition.

    Declaration
    public bool Add(IRuleCondition condition, Operator op)
    Parameters
    Type Name Description
    IRuleCondition condition

    The condition.

    Operator op

    Condition operator.

    Returns
    Type Description
    Boolean

    trueThe condition was added. false Condition would have led to an infinite cycle and was not added.

    Applies(RuleExecutionContext)

    Applies the specified context.

    Declaration
    public bool Applies(RuleExecutionContext context)
    Parameters
    Type Name Description
    RuleExecutionContext context

    The context.

    Returns
    Type Description
    Boolean

    true Rule is active false Rule is inactive.

    Implements
    IRuleCondition.Applies(RuleExecutionContext)

    ClearEmptyChildren()

    Clears the empty children.

    Declaration
    public void ClearEmptyChildren()

    GetIndicesInTree(IRuleCondition)

    Find the location of a specific condition in the rule tree.

    Declaration
    public int[] GetIndicesInTree(IRuleCondition targetRuleCondition)
    Parameters
    Type Name Description
    IRuleCondition targetRuleCondition

    Target condition

    Returns
    Type Description
    Int32[]

    Array of the indices on each tree level you need to follow to reach the node.

    GetOperator(IRuleCondition)

    Get the Operator for this condition.

    Declaration
    public Operator GetOperator(IRuleCondition condition)
    Parameters
    Type Name Description
    IRuleCondition condition

    condition

    Returns
    Type Description
    Operator

    Operator

    Insert(Int32, IRuleCondition)

    Inserts the condition at the specified index.

    Declaration
    public bool Insert(int index, IRuleCondition condition)
    Parameters
    Type Name Description
    Int32 index

    The index.

    IRuleCondition condition

    The condition.

    Returns
    Type Description
    Boolean

    trueThe condition was added. false Condition would have led to an infinite cycle and was not added.

    Remove(IRuleCondition)

    Removes the specified condition.

    Declaration
    public bool Remove(IRuleCondition condition)
    Parameters
    Type Name Description
    IRuleCondition condition

    The condition.

    Returns
    Type Description
    Boolean

    true Condition was removed false Condition could not be found and was not removed.

    RemoveAt(Int32)

    Remove the condition at a specified index

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    Int32 index

    index

    SetAt(Int32, IRuleCondition)

    Sets the condition at a specific index.

    Declaration
    public bool SetAt(int index, IRuleCondition condition)
    Parameters
    Type Name Description
    Int32 index

    Index

    IRuleCondition condition

    Condition

    Returns
    Type Description
    Boolean

    trueThe condition was added. false Condition would have led to an infinite cycle and was not added.

    SetOperator(IRuleCondition, Operator)

    Set the Operator for this condition.

    Declaration
    public void SetOperator(IRuleCondition condition, Operator op)
    Parameters
    Type Name Description
    IRuleCondition condition

    condition

    Operator op

    operator

    ToString()

    ToString

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    string

    Overrides
    Object.ToString()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023