Class AchievementConditionSourceReader
Reads the authored unlock conditions a definition source also declares, so the composition root can hand them to AchievementEvaluator without knowing which kind of source it was given.
Inherited Members
Namespace: Serenity.Achievements.Application.Services
Assembly: Serenity.Achievements.Application.dll
Syntax
public static class AchievementConditionSourceReader
Remarks
The counterpart of BuildFrom(IAchievementDefinitionSource, ILogService), and isolated for the same reason: the source is project code — an asset loader, a generated list, a mod — so "it threw" is a case, not an accident. A failing source costs the conditions and nothing else; the module still installs and every achievement is still unlockable from code.
Methods
ReadFrom(IAchievementDefinitionSource, ILogService)
Reads the authored conditions a definition source declares, if it declares any.
Declaration
public static IReadOnlyDictionary<AchievementId, AchievementCondition> ReadFrom(IAchievementDefinitionSource definitionSource, ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| IAchievementDefinitionSource | definitionSource | The source the definitions were read from. May be |
| ILogService | logService | Logging service used to report a failing source. May be |
Returns
| Type | Description |
|---|---|
| IReadOnlyDictionary<AchievementId, AchievementCondition> | The authored conditions by achievement id. Never |