logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct ScoreRecord

    Aggregated statistics for a single score metric (top, max, min, average). Immutable value object used for persistence and leaderboard purposes.

    Implements
    IEquatable<ScoreRecord>
    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Score.Domain.ValueObjects
    Assembly: Serenity.Score.Domain.dll
    Syntax
    public readonly struct ScoreRecord : IEquatable<ScoreRecord>

    Constructors

    ScoreRecord(ScoreKey, float, float, float, int)

    Creates a new ScoreRecord with the specified statistics.

    Declaration
    public ScoreRecord(ScoreKey key, float best, float worst, float average, int sessionCount)
    Parameters
    Type Name Description
    ScoreKey key

    The metric key.

    float best

    The best recorded value.

    float worst

    The worst recorded value.

    float average

    The average value.

    int sessionCount

    The number of recorded sessions.

    Fields

    Average

    The average value across all recorded sessions.

    Declaration
    public readonly float Average
    Field Value
    Type Description
    float

    Best

    The best (highest) value ever recorded for this metric.

    Declaration
    public readonly float Best
    Field Value
    Type Description
    float

    Key

    The metric key this record belongs to.

    Declaration
    public readonly ScoreKey Key
    Field Value
    Type Description
    ScoreKey

    SessionCount

    The number of sessions recorded.

    Declaration
    public readonly int SessionCount
    Field Value
    Type Description
    int

    Worst

    The lowest value ever recorded for this metric.

    Declaration
    public readonly float Worst
    Field Value
    Type Description
    float

    Methods

    Equals(ScoreRecord)

    Declaration
    public bool Equals(ScoreRecord other)
    Parameters
    Type Name Description
    ScoreRecord other
    Returns
    Type Description
    bool

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    ToString()

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

    Operators

    operator ==(ScoreRecord, ScoreRecord)

    Declaration
    public static bool operator ==(ScoreRecord left, ScoreRecord right)
    Parameters
    Type Name Description
    ScoreRecord left
    ScoreRecord right
    Returns
    Type Description
    bool

    operator !=(ScoreRecord, ScoreRecord)

    Declaration
    public static bool operator !=(ScoreRecord left, ScoreRecord right)
    Parameters
    Type Name Description
    ScoreRecord left
    ScoreRecord right
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    In this article
    © 2026 Serenity. All Rights Reserved