logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class CorruptedConditionTrees

    Builds the corrupted trees the structural guard exists for.

    Inheritance
    object
    CorruptedConditionTrees
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Achievements.Tests.Conditions
    Assembly: Tests.dll
    Syntax
    public static class CorruptedConditionTrees
    Remarks

    A cycle cannot be authored through the public API, which is the point: it only exists in a serialized graph that was hand-edited or damaged. Reaching for the backing list directly is how a test reproduces that, and it is exactly what Unity's serializer does when it restores a [SerializeReference] field.

    Built over the real Infrastructure composites — AndCondition and its siblings — rather than a Business-side fake, because the suites that use this exercise those concrete types' own reflection-backed child list. A Business-side suite that needs the same malformed shapes without that dependency reaches for CompositeTestAchievementCondition instead.

    Methods

    MutuallyReferencing()

    Two composites that hold each other.

    Declaration
    public static AndCondition MutuallyReferencing()
    Returns
    Type Description
    AndCondition

    NestedTo(int)

    A legitimately built tree nested past the depth cap.

    Declaration
    public static AchievementCondition NestedTo(int depth)
    Parameters
    Type Name Description
    int depth

    How many composites to nest.

    Returns
    Type Description
    AchievementCondition

    SelfReferencing()

    A composite that holds itself.

    Declaration
    public static AndCondition SelfReferencing()
    Returns
    Type Description
    AndCondition

    WithoutChildList<TComposite>(TComposite)

    A composite whose backing child list is null rather than empty — what a recipe import produces for a composite node that authors no children, because the node is materialized without its field initializer ever running.

    Declaration
    public static TComposite WithoutChildList<TComposite>(TComposite composite) where TComposite : CompositeAchievementCondition
    Parameters
    Type Name Description
    TComposite composite

    The composite to strip. Returned for chaining.

    Returns
    Type Description
    TComposite
    Type Parameters
    Name Description
    TComposite
    In this article
    © 2026 Serenity. All Rights Reserved