Пример #1
0
 protected override bool OnExecute(BehaviorContext context)
 {
     for (int i = 0; i < range; i++)
     {
         child.Execute(context);
     }
     return(true);
 }
Пример #2
0
 protected override bool OnExecute(BehaviorContext context)
 {
     if (inference(context))
     {
         return(thenChild.Execute(context));
     }
     else
     {
         return(false);
     }
 }
Пример #3
0
        protected override bool OnExecute(BehaviorContext context)
        {
            bool isSuccess = false;

            while (inference(context))
            {
                untilChild.Execute(context);
                isSuccess = true;
            }
            return(isSuccess);
        }
Пример #4
0
        protected override bool OnExecute(BehaviorContext context)
        {
            var randGen = new Random();

            if (randGen.NextDouble() > threshold)
            {
                return(child.Execute(context));
            }
            else
            {
                return(false);
            }
        }
Пример #5
0
 protected override bool OnExecute(BehaviorContext context)
 {
     child.Execute(context);
     return(true);
 }
Пример #6
0
 protected override bool OnExecute(BehaviorContext context)
 {
     return(!child.Execute(context));
 }