示例#1
0
        void SpeechInput.ICommandListener.OnCommandDetected(SpeechInput.Command command)
        {
            switch (command)
            {
            case SpeechInput.Command.Alpha:
                if (_state != State.Tour)
                {
                    StartTour(TourController.TourMode.Guided);
                }
                break;

            case SpeechInput.Command.Bravo:
                if (_state != State.Tour)
                {
                    StartTour(TourController.TourMode.Unguided);
                }
                break;

            case SpeechInput.Command.Charlie:
                if (_state != State.Tour)
                {
                    StartTour(TourController.TourMode.Mixed);
                }
                break;

            case SpeechInput.Command.CancelTour:
                if (_state == State.Tour)
                {
                    _tourController.AbortTour();
                    _tourLog.CompleteLog();
                }

                break;

            case SpeechInput.Command.Admin:
                if (_state == State.Home)
                {
                    SetState(State.Admin);
                }

                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(command), command, null);
            }
        }