示例#1
0
        /// <summary>
        /// Update the next active behavior.
        /// </summary>
        /// <returns></returns>
        public bool Step()
        {
            IBehavior current = _activeBehaviors.GrabFirst();

            if (current == null)
            {
                return(false);
            }

            Behavior.Status result = current.Tick();

            if (result == Behavior.Status.Running)
            {
                _activeBehaviors.AddLast(current);
            }

            return(true);
        }