示例#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));
 }