Exemplo n.º 1
0
        public ActionChain AddLoop(IActor conditionActor, Func <bool> condition, ActionChain body)
        {
            AddAction(new ChainElement(conditionActor, new LoopAction(conditionActor, condition, body)));

            return(this);
        }
Exemplo n.º 2
0
        public ActionChain AddBranch(IActor conditionActor, Func <bool> condition, ActionChain trueBranch, ActionChain falseBranch)
        {
            AddAction(new ChainElement(conditionActor, new ConditionalAction(condition, trueBranch, falseBranch)));

            return(this);
        }
Exemplo n.º 3
0
 public LoopAction(IActor conditionActor, Func <bool> condition, ActionChain body)
 {
     Body      = body;
     Condition = condition;
     body.AddAction(conditionActor, this);
 }
Exemplo n.º 4
0
 public void AddLoop(IActor conditionActor, Func <bool> condition, ActionChain body)
 {
     AddAction(new ChainElement(conditionActor, new LoopAction(conditionActor, condition, body)));
 }
Exemplo n.º 5
0
 public ConditionalAction(Func <bool> condition, ActionChain trueChain, ActionChain falseChain)
 {
     TrueChain  = trueChain;
     FalseChain = falseChain;
 }