Class CompositeAchievementCondition
Shared shape of every condition that holds a list of children: the serialized list itself,
and the walks that have to visit all of them — reset, validation, signal collection, and the
state round trip.
Inheritance
CompositeAchievementCondition
Assembly: Serenity.UnityAchievements.Infrastructure.dll
Syntax
public abstract class CompositeAchievementCondition : AchievementCondition
Constructors
CompositeAchievementCondition()
Creates an empty composite, as Unity's polymorphic serializer does.
Declaration
protected CompositeAchievementCondition()
CompositeAchievementCondition(IEnumerable<AchievementCondition>)
Creates a composite over the given children.
Declaration
protected CompositeAchievementCondition(IEnumerable<AchievementCondition> children)
Parameters
Fields
ChildrenFieldName
The name the child list is serialized under, on every composite. Named here because more than one
tool binds to it by string — the authoring drawer, and the recipe importer checking that an
authored composite actually declares its children — and a rename that missed one of them would
silently stop matching.
Declaration
public const string ChildrenFieldName = "conditions"
Field Value
MinimumChildren
How many children a composite needs before combining them means anything. One child is
not a combination — it is the child, wearing a wrapper that changes nothing.
Declaration
public const int MinimumChildren = 2
Field Value
Properties
Children
Declaration
public override IReadOnlyList<AchievementCondition> Children { get; }
Property Value
Conditions
The children this node combines. Never null, even when the backing list is.
Declaration
public IReadOnlyList<AchievementCondition> Conditions { get; }
Property Value
NeedsTick
Declaration
public override bool NeedsTick { get; }
Property Value
PersistsState
Declaration
public override bool PersistsState { get; }
Property Value
Methods
AnyChild(Func<AchievementCondition, bool>)
Whether any child answers true to the given question.
Declaration
protected bool AnyChild(Func<AchievementCondition, bool> question)
Parameters
Returns
CaptureOwnState()
The composite's own counter, for a composite that keeps one. Null by default.
Declaration
protected virtual string CaptureOwnState()
Returns
CaptureState()
Declaration
public override string CaptureState()
Returns
CollectSignalTypeNames(ICollection<string>)
Declaration
public override void CollectSignalTypeNames(ICollection<string> sink)
Parameters
Reset()
Declaration
public override void Reset()
RestoreOwnState(string)
Restores the composite's own counter.
Declaration
protected virtual void RestoreOwnState(string ownState)
Parameters
RestoreState(string)
Declaration
public override void RestoreState(string state)
Parameters
| Type |
Name |
Description |
| string |
state |
|
Validate()
Declaration
public override string Validate()
Returns