logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SingleChildAchievementCondition

    Shared shape of every condition that wraps exactly one other: the serialized reference itself, and the plumbing that has to reach through it — reset, validation, signal collection, the tick and persistence questions, and the state round trip.

    Inheritance
    object
    SingleChildAchievementCondition
    AccumulateWhileCondition
    DurationCondition
    NotCondition
    Namespace: Serenity.Achievements.Infrastructure.Conditions
    Assembly: Serenity.UnityAchievements.Infrastructure.dll
    Syntax
    public abstract class SingleChildAchievementCondition : AchievementCondition
    Remarks

    The child is named inner on every wrapper, the way CompositeAchievementCondition names its list conditions on every composite, so one authoring drawer binds to one serialized property name rather than one per node type. Together the two classes are the whole structural vocabulary of a tree, which is what lets ChildrenOf(AchievementCondition) walk any node without testing for concrete types.

    Constructors

    SingleChildAchievementCondition()

    Creates an unwrapped node, as Unity's polymorphic serializer does.

    Declaration
    protected SingleChildAchievementCondition()

    SingleChildAchievementCondition(AchievementCondition)

    Creates a node wrapping the given child.

    Declaration
    protected SingleChildAchievementCondition(AchievementCondition child)
    Parameters
    Type Name Description
    AchievementCondition child

    The condition to wrap.

    Fields

    ChildFieldName

    The name the wrapped child is serialized under, on every wrapper. See ChildrenFieldName for why it is named rather than spelled out at each binding site.

    Declaration
    public const string ChildFieldName = "inner"
    Field Value
    Type Description
    string

    Properties

    Child

    The condition this node wraps.

    Declaration
    public AchievementCondition Child { get; }
    Property Value
    Type Description
    AchievementCondition

    Children

    Declaration
    public override IReadOnlyList<AchievementCondition> Children { get; }
    Property Value
    Type Description
    IReadOnlyList<AchievementCondition>

    MissingChildMessage

    What this node reports when it wraps nothing at all.

    Declaration
    protected abstract string MissingChildMessage { get; }
    Property Value
    Type Description
    string

    NeedsTick

    Declaration
    public override bool NeedsTick { get; }
    Property Value
    Type Description
    bool

    PersistsState

    Declaration
    public override bool PersistsState { get; }
    Property Value
    Type Description
    bool

    Methods

    CaptureOwnState()

    The node's own counter, for a wrapper that keeps one. Null by default.

    Declaration
    protected virtual string CaptureOwnState()
    Returns
    Type Description
    string

    CaptureState()

    Declaration
    public override string CaptureState()
    Returns
    Type Description
    string

    CollectSignalTypeNames(ICollection<string>)

    Declaration
    public override void CollectSignalTypeNames(ICollection<string> sink)
    Parameters
    Type Name Description
    ICollection<string> sink

    Reset()

    Declaration
    public override void Reset()

    RestoreOwnState(string)

    Restores the node's own counter.

    Declaration
    protected virtual void RestoreOwnState(string ownState)
    Parameters
    Type Name Description
    string ownState

    The counter previously produced by CaptureOwnState().

    RestoreState(string)

    Declaration
    public override void RestoreState(string state)
    Parameters
    Type Name Description
    string state

    Validate()

    Declaration
    public override string Validate()
    Returns
    Type Description
    string

    ValidateOwnConfiguration()

    Checks the node's own fields, once the child is known to be present.

    Declaration
    protected virtual string ValidateOwnConfiguration()
    Returns
    Type Description
    string

    What is wrong, or null when the node's own configuration is valid.

    In this article
    © 2026 Serenity. All Rights Reserved