/// <summary> /// Pushes a command to aggragate returned variables from multiple following branches. /// </summary> /// <param name="Time">How many variables to collect.</param> /// <returns></returns> public State Await(int Time) { ReturnValues.Push(new List <ReturnValue>()); if (Time == 0) { return(this); } Stack.Push(x => { var v = x.ReturnValues.Pop(); x.ReturnValues.Push(x.ReturnValues.Pop().Concat(v).ToList()); if (Time == 1) { return(x); } return(x.Await2(Time - 1)); }); return(MoveNext()); }