logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface ICascadeMenuContext

    The bridge between data-authored menu definitions and the game. A definition describes the STRUCTURE (which menus, their offsets, which dynamic sources); the game supplies the CONTENT and handles the outcome through this context. Pure interface so menu building stays engine-agnostic and testable.

    Namespace: Serenity.Menu.Application.Cascade
    Assembly: Serenity.Menu.Application.dll
    Syntax
    public interface ICascadeMenuContext

    Methods

    Dispatch(object)

    Acts on a terminal selection (e.g. dispatches its optional signal) WITHOUT resolving/closing the menu, leaving the cascade open. Use for options that should fire a side effect and let the player keep choosing — e.g. a row of test actions each popping a notification.

    Declaration
    void Dispatch(object selection)
    Parameters
    Type Name Description
    object selection

    GetEntries(string)

    Returns the runtime entries for a dynamic source id (e.g. "abilities", "items", "targets.enemies").

    Declaration
    IReadOnlyList<CascadeDynamicEntry> GetEntries(string sourceId)
    Parameters
    Type Name Description
    string sourceId
    Returns
    Type Description
    IReadOnlyList<CascadeDynamicEntry>

    GetSelection(string)

    Reads a previously remembered choice.

    Declaration
    object GetSelection(string key)
    Parameters
    Type Name Description
    string key
    Returns
    Type Description
    object

    IsConditionMet(string)

    Evaluates a gating condition for an option (e.g. "in_limit"); empty/unknown ⇒ true.

    Declaration
    bool IsConditionMet(string conditionId)
    Parameters
    Type Name Description
    string conditionId
    Returns
    Type Description
    bool

    Localize(string)

    Resolves a label/title key to display text (e.g. via a localization table). May pass through.

    Declaration
    string Localize(string key)
    Parameters
    Type Name Description
    string key
    Returns
    Type Description
    string

    Resolve(object)

    Resolves the accumulated command with the final selection (e.g. the chosen target, or null).

    Declaration
    void Resolve(object selection)
    Parameters
    Type Name Description
    object selection

    SetSelection(string, object)

    Remembers an intermediate choice (e.g. the chosen spell/item, or the pending action id).

    Declaration
    void SetSelection(string key, object value)
    Parameters
    Type Name Description
    string key
    object value
    In this article
    © 2026 Serenity. All Rights Reserved