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.
Assembly: Serenity.Menu.Application.dll
public interface ICascadeMenuContext
Methods
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 |
|
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
Reads a previously remembered choice.
Declaration
object GetSelection(string key)
Parameters
| Type |
Name |
Description |
| string |
key |
|
Returns
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
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
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 |
|
Remembers an intermediate choice (e.g. the chosen spell/item, or the pending action id).
Declaration
void SetSelection(string key, object value)
Parameters