Class AchievementDefinitionAuthoringReview
Answers what is wrong with one authored achievement, judged against every other achievement in the project — which is the only way the question "is this id already taken" can be asked at all.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Editor
Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
Syntax
public static class AchievementDefinitionAuthoringReview
Remarks
The rules themselves live in engine-free Application code, so the same answers can be given by the project validator and the headless run a later slice adds. What is here is the editor's half: finding the other assets, and reducing the project-wide report to the findings this inspector is allowed to show.
Separate from the inspector that draws it so the reduction is directly testable without an
Editor instance, and so a wizard or a validator can ask the same question later.
Fields
UnknownFailure
What a failure with no message of its own is reported as.
Declaration
public const string UnknownFailure = "The authoring rules threw without saying why."
Field Value
| Type | Description |
|---|---|
| string |
Methods
Check(UnityAchievementDefinition)
Checks one achievement against every achievement asset in the project.
Declaration
public static IReadOnlyList<AuthoringIssue> Check(UnityAchievementDefinition definition)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityAchievementDefinition | definition | The achievement to check. May be |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AuthoringIssue> | The findings about that achievement, in report order. |
Remarks
The storefronts the project ships on are read here rather than asked for, because the platform rule is silent without them: an achievement that names no Steam identifier is only a finding once the settings asset says this project ships on Steam.
CheckAgainst(UnityAchievementDefinition, IReadOnlyList<UnityAchievementDefinition>, IReadOnlyCollection<AchievementPlatformKind>)
Checks one achievement against a known set of authored achievements.
Declaration
public static IReadOnlyList<AuthoringIssue> CheckAgainst(UnityAchievementDefinition definition, IReadOnlyList<UnityAchievementDefinition> everyAuthoredAchievement, IReadOnlyCollection<AchievementPlatformKind> enabledPlatforms = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityAchievementDefinition | definition | The achievement to check. May be |
| IReadOnlyList<UnityAchievementDefinition> | everyAuthoredAchievement | Every achievement the project declares, including the one being checked. May be |
| IReadOnlyCollection<AchievementPlatformKind> | enabledPlatforms | The storefronts the project ships on. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AuthoringIssue> | The findings about that achievement, in report order. |
DescribeFailure(Exception)
Describes a failure the way a list row, an inspector notice and a log line all want to read it.
Declaration
public static string DescribeFailure(Exception failure)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | failure | The exception that ended the check. May be null. |
Returns
| Type | Description |
|---|---|
| string | Its type and message. |
Remarks
Here rather than beside any one of its callers because all three answer the same question — "why is there no answer about this achievement?" — and three wordings of it would let a reader think they were looking at three different problems.