예제 #1
0
        internal void SelectConversation(Mode c)
        {
            if (c == null)
            {
                Logger.Log("Trying to start non-existant conversation", Helpers.LogLevel.Warning);
                return;
            }
            // Avoid multiple starts.
            if (currentMode == c)
            {
                return;
            }

            // Let the old conversation deactivate any event hooks, grammars, etc.
            currentMode?.Stop();

            currentMode = c;
            currentMode.Start();
        }
예제 #2
0
        /// <summary>
        /// Finish an interruption and resume normal conversation
        /// </summary>
        internal void FinishInterruption(Mode m)
        {
            lock (interruptions)
            {
                // Remove the terminating interruption from the list.
                interruptions.Remove(m);

                // Let it remove any event hooks, etc
                m.Stop();

                // If there are any other interruptions pending, start one.
                // Otherwise resume the interrupted conversation.
                if (interruptions.Count > 0)
                {
                    StartInterruption();
                }
                else
                {
                    currentMode = interrupted;
                    interrupted = null;
                    currentMode.Start();
                }
            }
        }
예제 #3
0
파일: Control.cs 프로젝트: Nuriat/radegast
        /// <summary>
        /// Finish an interruption and resume normal conversation
        /// </summary>
        internal void FinishInterruption( Mode m )
        {
            lock (interruptions)
            {
                // Remove the terminating interruption from the list.
                interruptions.Remove(m);

                // Let it remove any event hooks, etc
                m.Stop();

                // If there are any other interruptions pending, start one.
                // Otherwise resume the interrupted conversation.
                if (interruptions.Count > 0)
                    StartInterruption();
                else
                {
                    currentMode = interrupted;
                    interrupted = null;
                    currentMode.Start();
                }
            }
        }