/// <summary> /// Fluent API that will add the next section /// </summary> /// <param name="nextScript"> /// The next Script /// </param> /// <returns> /// <see cref="Script"/> /// </returns> public ITrunk AddSection(Script nextScript) { var trunk = new Trunk(nextScript); this.nextSection = trunk; return(trunk); }
/// <summary> /// Creates a fork where the calculation could go down different paths /// </summary> /// <param name="createBranchScript"> /// The script that will determine which branch to use /// </param> /// <param name="trueTrunk"> /// The trunk that will be executed if the branch script returns true /// </param> /// <param name="falseTrunk"> /// The trunk that will be executed if the branch script returns false /// </param> public void AddBranch(Script <bool> createBranchScript, Trunk trueTrunk, Trunk falseTrunk) { var branch = new Branch(createBranchScript, trueTrunk, falseTrunk); this.nextSection = branch; }