logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct ScoreSnapshot

    Immutable representation of all score metrics at a point in time.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Score.Domain.ValueObjects
    Assembly: Serenity.Score.Domain.dll
    Syntax
    public readonly struct ScoreSnapshot

    Constructors

    ScoreSnapshot(IReadOnlyDictionary<ScoreKey, ScoreValue>)

    Creates a new ScoreSnapshot from the provided metrics dictionary.

    Declaration
    public ScoreSnapshot(IReadOnlyDictionary<ScoreKey, ScoreValue> metrics)
    Parameters
    Type Name Description
    IReadOnlyDictionary<ScoreKey, ScoreValue> metrics

    The metrics to snapshot. A defensive copy is recommended.

    Fields

    Metrics

    Read-only dictionary of all metric values keyed by ScoreKey.

    Declaration
    public readonly IReadOnlyDictionary<ScoreKey, ScoreValue> Metrics
    Field Value
    Type Description
    IReadOnlyDictionary<ScoreKey, ScoreValue>

    Properties

    Count

    Gets the number of metrics in this snapshot.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    Methods

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    TryGet(ScoreKey, out ScoreValue)

    Gets the value of a specific metric.

    Declaration
    public bool TryGet(ScoreKey key, out ScoreValue value)
    Parameters
    Type Name Description
    ScoreKey key

    The metric key.

    ScoreValue value

    The metric value, if found.

    Returns
    Type Description
    bool

    True if the metric exists; otherwise false.

    In this article
    © 2026 Serenity. All Rights Reserved