logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct AchievementPointsSummary

    How far the player is through everything the project has to award, as the one line the achievements screen prints above the list: "120 / 500".

    Implements
    IEquatable<AchievementPointsSummary>
    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Achievements.Infrastructure.Views
    Assembly: Serenity.Achievements.Infrastructure.dll
    Syntax
    public readonly struct AchievementPointsSummary : IEquatable<AchievementPointsSummary>
    Remarks

    A value object rather than a bare formatted string so the two numbers survive alongside their rendering — a progress bar over the same summary needs Completion, and re-parsing the text to get it back is how a summary and its bar end up disagreeing.

    Fields

    DefaultFormat

    How the two point totals are rendered, earned as {0} and maximum as {1}.

    Declaration
    public const string DefaultFormat = "{0} / {1}"
    Field Value
    Type Description
    string

    Earned

    The points the player has actually earned.

    Declaration
    public readonly int Earned
    Field Value
    Type Description
    int

    Maximum

    The points every registered achievement adds up to.

    Declaration
    public readonly int Maximum
    Field Value
    Type Description
    int

    Text

    The summary rendered for display.

    Declaration
    public readonly string Text
    Field Value
    Type Description
    string

    Properties

    Completion

    The share of the available points the player has earned, as a 0..1 fraction. A project that awards no points at all reads as complete rather than as an unreachable zero.

    Declaration
    public double Completion { get; }
    Property Value
    Type Description
    double

    Methods

    Create(int, int, string, IFormatProvider)

    Builds the summary of a player's progress through the project's points.

    Declaration
    public static AchievementPointsSummary Create(int earnedPoints, int maximumPoints, string format = "{0} / {1}", IFormatProvider formatProvider = null)
    Parameters
    Type Name Description
    int earnedPoints

    The points the player has earned. Negative values are clamped to zero.

    int maximumPoints

    The points on offer. Negative values are clamped to zero.

    string format

    The format string. null or empty uses DefaultFormat.

    IFormatProvider formatProvider

    The culture the numbers are rendered in. null uses the invariant culture.

    Returns
    Type Description
    AchievementPointsSummary

    The summary.

    Equals(AchievementPointsSummary)

    Declaration
    public bool Equals(AchievementPointsSummary other)
    Parameters
    Type Name Description
    AchievementPointsSummary 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 ==(AchievementPointsSummary, AchievementPointsSummary)

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

    operator !=(AchievementPointsSummary, AchievementPointsSummary)

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

    Implements

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