Example #1
0
 protected override void DoStart()
 {
     isDecorateeDone    = false;
     isDecorateeSuccess = false;
     isLimitReached     = false;
     Clock.AddTimer(limit, randomVariation, 0, TimeoutReached);
     Decoratee.Start();
 }
Example #2
0
 private void checkCondition()
 {
     if (condition.Invoke())
     {
         Clock.RemoveTimer(checkCondition);
         Decoratee.Start();
     }
 }
Example #3
0
 protected override void DoStart()
 {
     if (!condition.Invoke())
     {
         Stopped(false);
     }
     else
     {
         Decoratee.Start();
     }
 }
Example #4
0
 protected override void DoStart()
 {
     if (!condition.Invoke())
     {
         Clock.AddTimer(checkInterval, checkVariance, -1, checkCondition);
     }
     else
     {
         Decoratee.Start();
     }
 }
Example #5
0
 protected override void DoStart()
 {
     if (UnityEngine.Random.value <= this.probability)
     {
         Decoratee.Start();
     }
     else
     {
         Stopped(false);
     }
 }
Example #6
0
 protected override void DoStart()
 {
     if (Mathf.Random() <= this.probability)
     {
         Decoratee.Start();
     }
     else
     {
         Stopped(false);
     }
 }
Example #7
0
 protected override void DoStart()
 {
     if (isReady)
     {
         isReady = false;
         if (!startAfterDecoratee)
         {
             Clock.AddTimer(cooldownTime, randomVariation, 0, TimeoutReached);
         }
         Decoratee.Start();
     }
 }
Example #8
0
 private void TimeoutReached()
 {
     if (IsActive && !Decoratee.IsActive)
     {
         Clock.AddTimer(cooldownTime, randomVariation, 0, TimeoutReached);
         Decoratee.Start();
     }
     else
     {
         isReady = true;
     }
 }
Example #9
0
 protected override void DoStart()
 {
     if (loopCount != 0)
     {
         currentLoop = 0;
         Decoratee.Start();
     }
     else
     {
         this.Stopped(true);
     }
 }
Example #10
0
 protected override void DoStart()
 {
     if (repeatTimes != 0)
     {
         stopRequested      = false;
         numberOfExecutions = 0;
         Decoratee.Start();
     }
     else
     {
         this.Stopped(true);
     }
 }
        protected override void DoStart()
        {
            if (stopsOnChange != Stops.NONE)
            {
                this.RootNode.Blackboard.AddObserver(this.key, OnValueChanged);
            }

            if (!IsConditionMet())
            {
                Stopped(false);
            }
            else
            {
                Decoratee.Start();
            }
        }
Example #12
0
 protected override void DoChildStopped(Node child, bool result)
 {
     if (result)
     {
         if (stopRequested || (repeatTimes > 0 && ++numberOfExecutions >= repeatTimes))
         {
             Stopped(true);
         }
         else
         {
             Decoratee.Start();
         }
     }
     else
     {
         Stopped(false);
     }
 }
Example #13
0
 protected override void DoStart()
 {
     if (this.interval <= 0f)
     {
         this.Clock.AddUpdateObserver(serviceMethod);
         serviceMethod();
     }
     else if (randomVariation <= 0f)
     {
         this.Clock.AddTimer(this.interval, -1, serviceMethod);
         serviceMethod();
     }
     else
     {
         InvokeServiceMethodWithRandomVariation();
     }
     Decoratee.Start();
 }
        protected override void DoStart()
        {
            if (stopsOnChange != Stops.NONE)
            {
                if (!isObserving)
                {
                    isObserving = true;
                    StartObserving();
                }
            }

            if (!IsConditionMet())
            {
                Stopped(false);
            }
            else
            {
                Decoratee.Start();
            }
        }
Example #15
0
        private void CheckQuorum()
        {
            List <Agent> confirmedList = RootNode.Blackboard.Get <List <Agent> >(type + "-confirmed");

            if (quorumCount == -1)
            {
                // Check quorum list
                foreach (Agent agent in quorumList)
                {
                    if (!confirmedList.Contains(agent))
                    {
                        return;
                    }
                }
                foreach (Agent agent in confirmedList)
                {
                    agent.ReceiveReconfirmation();
                }
            }
            else
            {
                // Check quorum count
                if (confirmedList.Count < quorumCount)
                {
                    return;
                }
                int remaining = quorumCount;
                foreach (Agent agent in confirmedList)
                {
                    agent.ReceiveReconfirmation();
                    remaining--;
                    if (remaining == 0)
                    {
                        break;
                    }
                }
            }
            Clock.RemoveTimer(CheckQuorum);
            Clock.RemoveTimer(QuorumNotMet);
            Decoratee.Start();
        }
Example #16
0
 protected void restartDecoratee()
 {
     Decoratee.Start();
 }
Example #17
0
 protected override void DoStart()
 {
     this.onStart();
     Decoratee.Start();
 }
Example #18
0
 protected override void DoStart()
 {
     this.isLimitReached = false;
     Clock.AddTimer(limit, randomVariation, 0, TimeoutReached);
     Decoratee.Start();
 }
Example #19
0
 protected override void DoStart()
 {
     Decoratee.Start();
 }