Class AchievementAuthoringJudge
Runs the shared authoring rules over every achievement in the project, and makes sure one achievement that cannot be judged costs its own row rather than the whole list.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Editor
Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
Syntax
public static class AchievementAuthoringJudge
Remarks
The rules walk an authored [SerializeReference] graph, which is exactly the kind of data a
corrupted or hand-edited asset can make hostile. Run as one pass over the project — which is what the
duplicate-id rule needs, and what keeps the cost linear — a single throwing node takes every finding
with it and the caller reports a project on which nothing is wrong. That failure mode is worse than the
broken asset: it is silent.
So the fast path stays a single pass, and the slow path exists only for when it throws: each achievement is then judged on its own, which isolates the failure to the achievement that caused it. The cost is that the duplicate-id rule cannot see the rest of the project in that mode, so a duplicate goes unreported until the broken asset is fixed — a trade this makes deliberately, because the alternative is reporting nothing about anything.
Methods
JudgeAll(IReadOnlyList<UnityAchievementDefinition>, IReadOnlyCollection<AchievementPlatformKind>, Func<IReadOnlyList<AchievementAuthoringSnapshot>, IReadOnlyList<AuthoringIssue>>)
Judges every achievement, isolating the ones that cannot be judged.
Declaration
public static IReadOnlyList<AchievementAuthoringJudgement> JudgeAll(IReadOnlyList<UnityAchievementDefinition> authored, IReadOnlyCollection<AchievementPlatformKind> enabledPlatforms, Func<IReadOnlyList<AchievementAuthoringSnapshot>, IReadOnlyList<AuthoringIssue>> checkRules = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<UnityAchievementDefinition> | authored | The achievements to judge, in list order. Must contain no nulls. |
| IReadOnlyCollection<AchievementPlatformKind> | enabledPlatforms | The storefronts the project ships on. May be null. |
| Func<IReadOnlyList<AchievementAuthoringSnapshot>, IReadOnlyList<AuthoringIssue>> | checkRules | What answers "what is wrong with these achievements". Defaults to Check(IReadOnlyList<AchievementAuthoringSnapshot>, IAchievementCustomConditionResolver); a test hands in one that throws, which is the only way to prove the isolation without a corrupted asset on disk. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AchievementAuthoringJudgement> | One judgement per achievement, in the order given. |