Class AchievementConditionSummary
Turns an authored condition tree into the one line that says what it actually demands, such
as "Signal EnemyKilled ×100 AND Score kills ≥ 10".
Inherited Members
Namespace: Serenity.Achievements.Application.Conditions
Assembly: Serenity.Achievements.Application.dll
Syntax
public static class AchievementConditionSummary
Remarks
Pure and engine-free so the same sentence appears in the authoring tree's header, in the Studio's list rows, in a validation finding and in a headless report — a summary computed three times is a summary that disagrees with itself in two of them.
Each node phrases itself through Describe(bool); this class owns only what no single node can own by itself: refusing to walk a malformed tree, and the recursion policy — how a missing child reads depending on whether it is the whole tree or a slot inside one. Formatting knowledge shared by more than one node's phrasing (quantities, placeholders, brackets, joining children) lives in AchievementConditionPhrasing.
Fields
MalformedTreeSummary
What a tree too broken to walk reads as.
Declaration
public const string MalformedTreeSummary = "Cyclic or too deeply nested (cannot be evaluated)"
Field Value
| Type | Description |
|---|---|
| string |
NoConditionSummary
What an achievement with no authored condition demands: nothing.
Declaration
public const string NoConditionSummary = "Always (no condition)"
Field Value
| Type | Description |
|---|---|
| string |
Methods
Describe(AchievementCondition)
Describes a whole condition tree in one line.
Declaration
public static string Describe(AchievementCondition condition)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementCondition | condition | The tree's root, or null for an achievement unlocked from code. |
Returns
| Type | Description |
|---|---|
| string | The summary line. |
Remarks
A tree that is cyclic or nested past MaxDepth is reported as such instead of being walked: the walk below is recursive, and a corrupted asset would otherwise take the stack with it before it could produce a sentence.