示例#1
0
        public bool execute()
        {
            bool forcewait = false;

            if (current == null)
            {
                current = nodes[0];
            }

            while (!forcewait)
            {
                if (current.execute())
                {
                    forcewait = true;
                    break;
                }
                else
                {
                    ConversationNodeHolder child = current.getChild();
                    if (current.TracePending)
                    {
                        // If the current node has a pending trace
                        // We end the previous trace pending
                        if (tracePendingNode != null)
                        {
                            tracePendingNode.EndTrace();
                        }

                        // And we put this into pending
                        tracePendingNode = current;
                    }

                    current = child;
                    if (current == null)
                    {
                        // When the conversation is over if there's a
                        // pending node, we end it
                        if (tracePendingNode != null)
                        {
                            tracePendingNode.EndTrace();
                        }
                        break;
                    }
                }
            }

            if (!forcewait)
            {
                this.current = null;
            }

            return(forcewait);
        }
示例#2
0
        public bool execute()
        {
            bool forcewait = false;

            if (current == null)
            {
                current = nodes[0];
            }

            while (!forcewait)
            {
                if (current.execute())
                {
                    forcewait = true;
                    break;
                }
                else
                {
                    ConversationNodeHolder child = current.getChild();
                    if (current.TracePending)
                    {
                        if (tracePendingNode != null)
                        {
                            tracePendingNode.EndTrace();
                        }

                        tracePendingNode = current;
                    }

                    current = child;
                    if (current == null)
                    {
                        if (tracePendingNode != null)
                        {
                            tracePendingNode.EndTrace();
                        }
                        break;
                    }
                }
            }

            if (!forcewait)
            {
                this.current = null;
            }

            return(forcewait);
        }
示例#3
0
 public void EndTracePending()
 {
     if (tracePendingNode != null && tracePendingNode.TracePending)
     {
         tracePendingNode.EndTrace();
     }
 }