logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    AchievementConditionSourceReader
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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 null.

    ILogService logService

    Logging service used to report a failing source. May be null.

    Returns
    Type Description
    IReadOnlyDictionary<AchievementId, AchievementCondition>

    The authored conditions by achievement id. Never null; empty when the source declares none.

    In this article
    © 2026 Serenity. All Rights Reserved