Пример #1
0
 protected TreeMachine.PassWF Pass(TreeMachine.IWorkflow child)
 => new TreeMachine.PassWF(child);
Пример #2
0
 protected TreeMachine.IWorkflow While(TreeMachine.IWorkflow cond, TreeMachine.IWorkflow child)
 => Pass(Loop(If(cond, Pass(child), Fail())));
Пример #3
0
 protected TreeMachine.NotWF Not(TreeMachine.IWorkflow child)
 => new TreeMachine.NotWF(child);
Пример #4
0
 protected TreeMachine.ForeverWF Forever(TreeMachine.IWorkflow child)
 => new TreeMachine.ForeverWF(child);
Пример #5
0
 protected TreeMachine.WhileWF While(Func <TreeMachine.IContext, bool> pred, TreeMachine.IWorkflow child)
 => new TreeMachine.WhileWF(pred, child);
Пример #6
0
 protected TreeMachine.TimeoutWF Timeout(TimeSpan delay, TreeMachine.IWorkflow child, TreeMachine.IWorkflow onTimeout = null)
 => new TreeMachine.TimeoutWF(_ => delay, child, onTimeout ?? Fail());
Пример #7
0
 protected TreeMachine.IWorkflow Delay(TimeSpan delay, TreeMachine.IWorkflow after = null)
 => Delay(_ => delay, after ?? Ok());
Пример #8
0
 protected TreeMachine.ReceiveAnyWF ReceiveAny(Func <object, bool> shouldHandle, TreeMachine.IWorkflow child = null)
 => new TreeMachine.ReceiveAnyWF(shouldHandle, child);
Пример #9
0
 protected TreeMachine.ReceiveWF <T> Receive <T>(TreeMachine.IWorkflow child = null)
 => new TreeMachine.ReceiveWF <T>(child);
Пример #10
0
 protected TreeMachine.IfWF If(Func <TreeMachine.IContext, bool> pred, TreeMachine.IWorkflow @then = null, TreeMachine.IWorkflow @else = null)
 => new TreeMachine.IfWF(Condition(pred), @then, @else);
Пример #11
0
 protected TreeMachine.ReceiveAnyWF ReceiveAny(TreeMachine.IWorkflow child = null)
 => new TreeMachine.ReceiveAnyWF(child);
Пример #12
0
 protected TreeMachine.IfWF If(TreeMachine.IWorkflow cond, TreeMachine.IWorkflow @then = null, TreeMachine.IWorkflow @else = null)
 => new TreeMachine.IfWF(cond, @then, @else);
Пример #13
0
 protected void StartWith(TreeMachine.IWorkflow wf, TData data)
 {
     Machine = new TreeMachine(data, null, this);
     Machine.Run(wf);
 }
Пример #14
0
 protected TreeMachine.IWorkflow Delay(Func <TreeMachine.IContext, TimeSpan> delay, TreeMachine.IWorkflow after = null)
 => new TreeMachine.TimeoutWF(delay, Never(), after ?? Ok());
Пример #15
0
 protected TreeMachine.AfterWF After(TreeMachine.IWorkflow child, TreeMachine.IWorkflow after)
 => new TreeMachine.AfterWF(child, after);
Пример #16
0
 protected TreeMachine.ReceiveWF <T> Receive <T>(Func <T, bool> shouldHandle, TreeMachine.IWorkflow child = null)
 => new TreeMachine.ReceiveWF <T>(shouldHandle, child);
Пример #17
0
 protected TreeMachine.SpawnWF Spawn(TreeMachine.IWorkflow child)
 => new TreeMachine.SpawnWF(child);
Пример #18
0
 protected TreeMachine.LoopWF Loop(TreeMachine.IWorkflow child)
 => new TreeMachine.LoopWF(child);
Пример #19
0
 protected TreeMachine.TimeoutWF Timeout(Func <TreeMachine.IContext, TimeSpan> delay, TreeMachine.IWorkflow child, TreeMachine.IWorkflow onTimeout = null)
 => new TreeMachine.TimeoutWF(delay, child, onTimeout ?? Fail());
Пример #20
0
 private TreeMachine.IWorkflow WithDoneAndDone(TreeMachine.IWorkflow wf) =>
     AllSucceed(
         AnySucceed(
             Done(),
             wf),
         Execute(_ => Sender.Tell("DONE")));