logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SingletonSettingsSelection

    The ownership rule every singleton settings lookup applies, both at runtime (UnitySingletonSettingsLoader) and in editor validation (SerenitySystemConfigurationResolver): a project-owned settings asset beats a shipped one with the same Id. Engine-agnostic and Unity-free — the caller decides what "project-owned" and "Id" mean for its own candidate type.

    Not the rule a COLLECTION lookup applies. This one asks "which candidate is authoritative for one slot" and answers by OWNERSHIP; CollectionSettingsSelection asks "is this asset the one another was cloned from" and answers by ID PAIRING, without consulting ownership at all. Two questions, two rules — do not merge them.

    Inheritance
    object
    SingletonSettingsSelection
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Shared.Utils
    Assembly: Serenity.Shared.dll
    Syntax
    public static class SingletonSettingsSelection

    Methods

    Pick<T>(IReadOnlyList<T>, Func<T, bool>, Func<T, string>, out SingletonSelectionOutcome)

    Picks the single candidate a singleton settings lookup should use.

    Declaration
    public static T Pick<T>(IReadOnlyList<T> candidates, Func<T, bool> isProjectOwned, Func<T, string> idOf, out SingletonSelectionOutcome outcome)
    Parameters
    Type Name Description
    IReadOnlyList<T> candidates

    Every candidate found for the settings type, in any order.

    Func<T, bool> isProjectOwned

    True when a candidate lives in the user's own project content.

    Func<T, string> idOf

    The candidate's IFoundationSettings.Id (or equivalent), used only to make an ambiguous pick deterministic.

    SingletonSelectionOutcome outcome

    How the pick was made — see SingletonSelectionOutcome.

    Returns
    Type Description
    T

    The picked candidate, or default when candidates is empty.

    Type Parameters
    Name Description
    T
    In this article
    © 2026 Serenity. All Rights Reserved