using System.Threading; using System.Threading.Tasks; namespace RudderSdk.Core; /// Session of a scenario battle-pass-level node. public sealed class BattlePassLevelSession { internal BattlePassLevelSession(ScenarioNodeContext context) => Context = context; /// Underlying node context. public ScenarioNodeContext Context { get; } /// Node id. public string Id => Context.NodeId; /// Reads a typed value from the node data. public T Get(string key, T defaultValue = default!) => Context.Get(key, defaultValue); /// Advances the run through the onComplete handle. public Task CompleteAsync(CancellationToken cancellationToken = default) => Context.CompleteAsync("onComplete", cancellationToken); /// Advances the run through the onComplete handle (fire-and-forget). public void Complete() => Context.Complete("onComplete"); }