Class AchievementProjectRules
The rules about a project's achievement configuration as a whole: whether anything configures the module, whether it is configured once, whether the storefronts it claims are ones its achievements actually reach, and whether anything installs it at boot.
Inherited Members
Namespace: Serenity.Achievements.Application.Authoring
Assembly: Serenity.Achievements.Application.dll
Syntax
public static class AchievementProjectRules
Remarks
Separate from AchievementAuthoringRules because these findings have no achievement to blame. "This project ships on Steam and not one achievement names a Steam id" is a fact about the project; reported once per achievement it would bury every real per-achievement finding under copies of itself.
Engine-free like the per-achievement rules, so the project validator, a wizard's preview and a headless test all read the same sentences. Everything these rules need arrives as an AchievementProjectSnapshot or a plain list, so no rule here has to know what an asset is.
Severity policy. Two findings are Errors, and they are the two that mean the subsystem
cannot work at all: a project that authors achievements but carries no settings asset has
nothing saying where an unlock persists, and one whose boot profiles never install the module
has nothing to record an unlock with. Both describe a game in which every unlock is silently
lost, which is the same consequence SerenityHudBindingValidator already calls an Error
for a HUD that nothing installs — the two validators must not disagree about what "the module
never runs" is worth.
Everything else here is a Warning: a duplicate or empty platform slot, a storefront no achievement reaches, a second settings asset. Each of those describes a project that still works — unlocks are recorded, some of them just do not travel as far as the author intended — so none of them should fail a build.
Both Errors are silent for a project that authors no achievement at all, so adopting the module never starts by failing. A project that installs the module from its own composition root rather than a pipeline profile is the one false positive this policy accepts; the finding names that case so the author can recognise it.
Methods
CheckProject(AchievementProjectSnapshot)
Checks a project's achievement configuration as a whole.
Declaration
public static IReadOnlyList<AuthoringIssue> CheckProject(AchievementProjectSnapshot project)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementProjectSnapshot | project | What the project's configuration looks like. May be |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AuthoringIssue> | Every finding about the project itself, in report order. |
CheckSettingsAsset(IReadOnlyList<AchievementPlatformKind?>)
Checks the storefront slots one achievement settings asset assigns.
Declaration
public static IReadOnlyList<AuthoringIssue> CheckSettingsAsset(IReadOnlyList<AchievementPlatformKind?> platformSlots)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<AchievementPlatformKind?> | platformSlots | One entry per slot the asset declares, in declaration order. A |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AuthoringIssue> | Every finding about that asset's storefront slots, in slot order. |