logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AchievementConditionContexts

    Builds the evaluation contexts every condition suite needs, so no test spells one out.

    Inheritance
    object
    AchievementConditionContexts
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Achievements.Tests.Fakes
    Assembly: Tests.dll
    Syntax
    public static class AchievementConditionContexts

    Methods

    Empty(IAchievementCustomConditionResolver)

    A context carrying nothing but a resolver.

    Declaration
    public static AchievementEvaluationContext Empty(IAchievementCustomConditionResolver resolver = null)
    Parameters
    Type Name Description
    IAchievementCustomConditionResolver resolver

    The custom condition resolver. May be null.

    Returns
    Type Description
    AchievementEvaluationContext

    Snapshot(params (string Key, float Amount)[])

    A snapshot over the given metric amounts.

    Declaration
    public static ScoreSnapshot Snapshot(params (string Key, float Amount)[] metrics)
    Parameters
    Type Name Description
    (string Key, float Amount)[] metrics

    The metric amounts, by key.

    Returns
    Type Description
    ScoreSnapshot

    WithProgress(GameProgressData)

    A context carrying global progress.

    Declaration
    public static AchievementEvaluationContext WithProgress(GameProgressData progress)
    Parameters
    Type Name Description
    GameProgressData progress

    The progress to read.

    Returns
    Type Description
    AchievementEvaluationContext

    WithScores(params (string Key, float Amount)[])

    A context carrying score metrics.

    Declaration
    public static AchievementEvaluationContext WithScores(params (string Key, float Amount)[] metrics)
    Parameters
    Type Name Description
    (string Key, float Amount)[] metrics

    The metric amounts, by key.

    Returns
    Type Description
    AchievementEvaluationContext

    WithSignal(EventDispatcherSignal)

    A context carrying a dispatched signal.

    Declaration
    public static AchievementEvaluationContext WithSignal(EventDispatcherSignal signal)
    Parameters
    Type Name Description
    EventDispatcherSignal signal

    The signal that caused the evaluation.

    Returns
    Type Description
    AchievementEvaluationContext

    WithTime(float, params (string Key, float Amount)[])

    A context carrying elapsed time, and optionally score metrics.

    Declaration
    public static AchievementEvaluationContext WithTime(float deltaSeconds, params (string Key, float Amount)[] metrics)
    Parameters
    Type Name Description
    float deltaSeconds

    Seconds elapsed, reported as both scaled and unscaled.

    (string Key, float Amount)[] metrics

    The metric amounts, by key.

    Returns
    Type Description
    AchievementEvaluationContext
    In this article
    © 2026 Serenity. All Rights Reserved