private async Task <TContext> RunBranch(TContext context, ISection section) { var branchScript = section.GetScript() as Script <bool>; var branchDecision = await this.producer.ProduceFromScriptAsync(context, branchScript); var se = section.GetNextSection(branchDecision); return(await this.Run(context, se)); }
private async Task <TContext> RunTrunk(TContext context, ISection section) { await this.producer.ProduceContextFromScriptAsync(context, section.GetScript()); if (section.IsLeaf()) { return(context); } var nextSection = section.GetNextSection(); return(await this.Run(context, nextSection)); }