Skip to content

Game.UI.Menu.BetaFilter

Assembly: Game (inferred)
Namespace: Game.UI.Menu

Type: static class

Base: System.Object

Summary:
Utility static class used to collect and expose a set of "beta" filter option keys for the UI menu. It stores a global set of option identifiers (strings) that are considered beta-related and provides methods to add new entries. The set is initialized with two defaults: "Input.Editor" and "Modding".


Fields

  • private static System.Collections.Generic.HashSet<string> s_Options
    Backs the collection of option keys. Initialized in the static constructor. The HashSet provides fast membership tests and prevents duplicate entries. Note: HashSet is not synchronized — concurrent writes from multiple threads may require external synchronization.

Properties

  • public static System.Collections.Generic.IReadOnlyCollection<string> options { get; }
    Exposes the underlying set as an IReadOnlyCollection. This allows callers to enumerate the registered option keys but does not expose mutation methods directly. Because the returned object is the underlying HashSet cast to IReadOnlyCollection, callers could cast back if they choose (not recommended).

Constructors

  • static BetaFilter()
    Initializes s_Options and registers the default options. Specifically it creates a new HashSet() and calls AddOptions with "Input.Editor" and "Modding". In C#, the static constructor runs before the first use of any static member, so s_Options is guaranteed to be initialized before use.

Methods

  • public static void AddOption(string option)
    Adds a single option key into the internal set. Adding a null reference is accepted by HashSet (it will store a single null), but callers should avoid null keys. Example behavior: duplicate entries are ignored.

  • public static void AddOptions(params string[] options)
    Adds multiple option keys at once using HashSet.UnionWith. If the passed array reference is null, UnionWith will throw an ArgumentNullException — callers should ensure the parameter is not null. Duplicate values among arguments are ignored.

Usage Example

// Add a single option
Game.UI.Menu.BetaFilter.AddOption("MyMod.BetaFeature");

// Add multiple options at once
Game.UI.Menu.BetaFilter.AddOptions("Another.Feature", "Experimental.UI");

// Enumerate registered beta filter keys
foreach (var key in Game.UI.Menu.BetaFilter.options)
{
    Console.WriteLine("Beta option: " + key);
}

// Check membership
bool hasModding = Game.UI.Menu.BetaFilter.options.Contains("Modding");