logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct UniqueNameSuffixStyle

    Describes how UniqueNameGenerator turns a taken base name into a fresh candidate: what text separates the base from the numeric suffix, which number the suffix counting starts from, and whether the bare base name itself is an acceptable first candidate.

    Implements
    IEquatable<UniqueNameSuffixStyle>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Shared.Utils
    Assembly: Serenity.Shared.dll
    Syntax
    public readonly struct UniqueNameSuffixStyle : IEquatable<UniqueNameSuffixStyle>

    Constructors

    UniqueNameSuffixStyle(string, int, bool)

    Creates a suffix style.

    Declaration
    public UniqueNameSuffixStyle(string separator, int firstSuffix, bool allowsBareBaseName)
    Parameters
    Type Name Description
    string separator

    Text between the base name and the numeric suffix. A null becomes empty.

    int firstSuffix

    The first number tried once suffixing starts.

    bool allowsBareBaseName

    Whether the bare base name is a valid first candidate.

    Fields

    AllowsBareBaseName

    Whether the bare base name is itself a valid candidate before any suffix is tried.

    Declaration
    public readonly bool AllowsBareBaseName
    Field Value
    Type Description
    bool

    FirstSuffix

    The first number tried once suffixing starts.

    Declaration
    public readonly int FirstSuffix
    Field Value
    Type Description
    int

    Separator

    Text placed between the base name and the numeric suffix. Never null.

    Declaration
    public readonly string Separator
    Field Value
    Type Description
    string

    Properties

    ConcatenatedFromTwo

    Always suffixed, no separator: "baseName2", "baseName3", ... Used for HUD element ids.

    Declaration
    public static UniqueNameSuffixStyle ConcatenatedFromTwo { get; }
    Property Value
    Type Description
    UniqueNameSuffixStyle

    DashedFromTwo

    Bare base name allowed; then "baseName-2", "baseName-3", ... Used for leaderboard button ids.

    Declaration
    public static UniqueNameSuffixStyle DashedFromTwo { get; }
    Property Value
    Type Description
    UniqueNameSuffixStyle

    UnderscoredFromOne

    Bare base name allowed; then "baseName_1", "baseName_2", ... Used for audio mixer group names.

    Declaration
    public static UniqueNameSuffixStyle UnderscoredFromOne { get; }
    Property Value
    Type Description
    UniqueNameSuffixStyle

    UnderscoredFromZero

    Always suffixed: "baseName_0", "baseName_1", ... Used for menu option ids.

    Declaration
    public static UniqueNameSuffixStyle UnderscoredFromZero { get; }
    Property Value
    Type Description
    UniqueNameSuffixStyle

    Methods

    Equals(UniqueNameSuffixStyle)

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

    Operators

    operator ==(UniqueNameSuffixStyle, UniqueNameSuffixStyle)

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

    operator !=(UniqueNameSuffixStyle, UniqueNameSuffixStyle)

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

    Implements

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