Skip to content
ModularityKit.Mutator ModularityKit.Mutator Docs
  • Home
  • Core
  • Governance
  • Redis
  • API
Search Results for

    Show / Hide Table of Contents

    Class PolicyComposition

    Factory methods for composing multiple mutation policies into one deterministic policy.

    Inheritance
    object
    PolicyComposition
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ModularityKit.Mutator.Abstractions.Policies
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public static class PolicyComposition

    Methods

    | Edit this page View Source

    AllOf<TState>(string, IEnumerable<IMutationPolicy<TState>>, int, string?)

    Creates composed policy that requires every child policy to allow the mutation.

    Declaration
    public static IMutationPolicy<TState> AllOf<TState>(string name, IEnumerable<IMutationPolicy<TState>> policies, int priority = 0, string? description = null)
    Parameters
    Type Name Description
    string name

    The composed policy name.

    IEnumerable<IMutationPolicy<TState>> policies

    The child policies to evaluate.

    int priority

    The priority of the composed policy.

    string description

    An optional human readable description.

    Returns
    Type Description
    IMutationPolicy<TState>

    A composed policy that merges all child decisions.

    Type Parameters
    Name Description
    TState

    The state type handled by the composed policy.

    | Edit this page View Source

    AnyOf<TState>(string, IEnumerable<IMutationPolicy<TState>>, int, string?)

    Creates composed policy that succeeds when at least one child policy allows the mutation.

    Declaration
    public static IMutationPolicy<TState> AnyOf<TState>(string name, IEnumerable<IMutationPolicy<TState>> policies, int priority = 0, string? description = null)
    Parameters
    Type Name Description
    string name

    The composed policy name.

    IEnumerable<IMutationPolicy<TState>> policies

    The child policies to evaluate.

    int priority

    The priority of the composed policy.

    string description

    An optional human readable description.

    Returns
    Type Description
    IMutationPolicy<TState>

    A composed policy that selects the allowed branch when one exists.

    Type Parameters
    Name Description
    TState

    The state type handled by the composed policy.

    | Edit this page View Source

    Priority<TState>(string, IEnumerable<IMutationPolicy<TState>>, int, string?)

    Creates a composed policy that evaluates children in deterministic priority order and returns the first decisive result.

    Declaration
    public static IMutationPolicy<TState> Priority<TState>(string name, IEnumerable<IMutationPolicy<TState>> policies, int priority = 0, string? description = null)
    Parameters
    Type Name Description
    string name

    The composed policy name.

    IEnumerable<IMutationPolicy<TState>> policies

    The child policies to evaluate.

    int priority

    The priority of the composed policy.

    string description

    An optional human readable description.

    Returns
    Type Description
    IMutationPolicy<TState>

    A composed policy that stops at the first decisive child decision.

    Type Parameters
    Name Description
    TState

    The state type handled by the composed policy.

    • Edit this page
    • View Source
    In this article
    ModularityKit.Mutator Generated from XML docs and published from main. Back to top