예제 #1
0
 protected override Status Update(Blackboard blackboard)
 {
     if (Child.TickUpdate(blackboard) != Status.Running)
     {
         return(FixedStatus.GetValue(blackboard));
     }
     return(Status.Running);
 }
예제 #2
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     shouldRun = Predicate.GetValue(blackboard);
     if (Negate.GetValue(blackboard))
     {
         shouldRun = !shouldRun;
     }
 }
예제 #3
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     if (Child == null)
     {
         resolvedTemplateName = TemplateName.GetValue(blackboard);
         Child = blackboard.InstanciateTemplate(resolvedTemplateName);
     }
 }
예제 #4
0
        protected override Status Update(Blackboard blackboard)
        {
            // If we're throttled, fail
            if (DateTime.Now < throttledUntil)
            {
                if (BlockOnStatus != null && Child.Status == BlockOnStatus.GetValue(blackboard))
                {
                    return(Status.Running);
                }
                return(Status.Failure);
            }

            // Otherwise, if we succeed, throttle
            var status = Child.TickUpdate(blackboard);

            if (status != Status.Running && (status == ThrottleStatus.GetValue(blackboard) || Always.GetValue(blackboard)))
            {
                throttledUntil = DateTime.Now.Add(Time.GetValue(blackboard));
            }

            return(Child.Status);
        }
예제 #5
0
파일: Set.cs 프로젝트: attackgithub/refw
 protected override Status Update(Blackboard blackboard)
 {
     if (Func != null)
     {
         blackboard.Set(Destination, Func());
     }
     else if (Value != null)
     {
         blackboard.Set(Destination, Value.GetValue(blackboard));
     }
     else
     {
         blackboard.Set(Destination, FuncBlackboard(blackboard));
     }
     return(Status.Success);
 }
예제 #6
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     waitUntil = DateTime.Now.Add(Time.GetValue(blackboard));
 }
예제 #7
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     currentList  = List.GetValue(blackboard).ToList();
     currentIndex = 0;
 }
예제 #8
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     currentCount = Count.GetValue(blackboard);
     lastStatus   = null;
 }
예제 #9
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     timeoutTime = DateTime.Now.Add(Timeout.GetValue(blackboard));
 }