Пример #1
0
 internal void ChangeFocus(Mode toThis)
 {
     currentMode = toThis;
     if (currentMode != null)
     {
         currentMode.Start();
     }
 }
Пример #2
0
        /// <summary>
        /// Start an interrupting conversation.
        /// </summary>
        void StartInterruption()
        {
            // Remember what we were talking about.
            if (interrupted == null)
            {
                interrupted = currentMode;
            }

            // Visually they stack up, so we take the last one first.
            currentMode = interruptions.Last();
            currentMode.Start();
        }
Пример #3
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();
        }
Пример #4
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();
                }
            }
        }
Пример #5
0
 internal void ChangeFocus(Mode toThis)
 {
     currentMode = toThis;
     currentMode?.Start();
 }
Пример #6
0
        /// <summary>
        /// Start an interrupting conversation.
        /// </summary>
        void StartInterruption()
        {
            // Remember what we were talking about.
            if (interrupted == null)
                interrupted = currentMode;

            // Visually they stack up, so we take the last one first.
            currentMode = interruptions.Last();
            currentMode.Start();
        }
Пример #7
0
        internal void SelectConversation(Mode c)
        {
            if (c == null)
            {
                Talker.Say("Trying to start non-existant conversation", Talk.BeepType.Bad );
                return;
            }
            // Avoid multiple starts.
            if (currentMode == c) return;

            // Let the old conversation deactivate any event hooks, grammars, etc.
            if (currentMode != null)
                currentMode.Stop();

            currentMode = c;
            currentMode.Start();
        }
Пример #8
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();
                }
            }
        }
Пример #9
0
 internal void ChangeFocus(Mode toThis)
 {
     currentMode = toThis;
      if (currentMode != null)
         currentMode.Start();
 }
Пример #10
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.
            if (currentMode != null)
                currentMode.Stop();

            currentMode = c;
            currentMode.Start();
        }