Esempio n. 1
0
        // <summary>
        ///  Process intents that are dialog based and may not have a speech
        ///  response. Speech responses cannot be returned with a delegate response
        /// </summary>
        /// <param name="data"></param>
        /// <param name="input"></param>
        /// <param name="response"></param>
        /// <returns>bool true if processed</returns>
        private bool ProcessDialogRequest(YogaBreak data, SkillRequest input, SkillResponse response)
        {
            var    intentRequest  = input.Request;
            string speech_message = string.Empty;
            bool   processed      = false;

            return(processed);
        }
Esempio n. 2
0
        /// <summary>
        /// Get the fatcs and questions for the specified locale
        /// </summary>
        /// <param name="locale"></param>
        /// <returns>factdata for the locale</returns>
        private YogaBreak NewSession(string locale)
        {
            if (string.IsNullOrEmpty(locale))
            {
                locale = USA_Locale;
            }

            return(YogaBreak.NewSession());
        }
Esempio n. 3
0
 /// <summary>
 /// Process and respond to the LaunchRequest with launch
 /// and reprompt message
 /// </summary>
 /// <param name="data"></param>
 /// <param name="response"></param>
 /// <returns>void</returns>
 private void ProcessLaunchRequest(YogaBreak data, ResponseBody response)
 {
     if (data != null)
     {
         IOutputSpeech innerResponse = new SsmlOutputSpeech();
         (innerResponse as SsmlOutputSpeech).Ssml = SsmlDecorate(data.LaunchMessage);
         response.OutputSpeech = innerResponse;
         IOutputSpeech prompt = new PlainTextOutputSpeech();
         (prompt as PlainTextOutputSpeech).Text = data.LaunchMessageReprompt;
         response.Reprompt = new Reprompt()
         {
             OutputSpeech = prompt
         };
     }
 }
Esempio n. 4
0
        /// <summary>
        ///  Runs the yoga break session
        /// </summary>
        /// <param name="data"></param>
        /// <param name="withPreface"></param>
        /// <returns>string newfact</returns>
        private string StartYogaSession(YogaBreak data, bool withPreface)
        {
            string preface = string.Empty;

            if (data == null)
            {
                return(string.Empty);
            }

            if (withPreface)
            {
                preface = data.StartSessionMessage;
            }

            return(preface + @"<break time=""3s""/>" + data.FirstPose + data.SecondPose + data.ThirdPose + data.FourthPose + data.FifthPose + data.SixthPose + data.SeventhPose + data.EighthPose + data.NinthPose + data.StopMessage);
        }
Esempio n. 5
0
        /// <summary>
        /// Process all not dialog based Intents
        /// </summary>
        /// <param name="factdata"></param>
        /// <param name="input"></param>
        /// <returns>IOutputSpeech innerResponse</returns>
        private IOutputSpeech ProcessIntentRequest(YogaBreak data, SkillRequest input)
        {
            var           intentRequest = input.Request;
            IOutputSpeech innerResponse = new PlainTextOutputSpeech();

            switch (intentRequest.Intent.Name)
            {
            case "StartYogaBreakIntent":
                innerResponse = new SsmlOutputSpeech();
                (innerResponse as SsmlOutputSpeech).Ssml = StartYogaSession(data, true);
                response.Response.ShouldEndSession       = true;
                break;

            case AlexaConstants.CancelIntent:
                (innerResponse as PlainTextOutputSpeech).Text = data.StopMessage;
                response.Response.ShouldEndSession            = true;
                break;

            case AlexaConstants.StopIntent:
                (innerResponse as PlainTextOutputSpeech).Text = data.StopMessage;
                response.Response.ShouldEndSession            = true;
                break;

            case AlexaConstants.HelpIntent:
                (innerResponse as PlainTextOutputSpeech).Text = data.HelpMessage;
                break;

            default:
                (innerResponse as PlainTextOutputSpeech).Text = data.HelpReprompt;
                break;
            }
            if (innerResponse.Type == AlexaConstants.SSMLSpeech)
            {
                BuildCard(data.SkillName, (innerResponse as SsmlOutputSpeech).Ssml);
                (innerResponse as SsmlOutputSpeech).Ssml = SsmlDecorate((innerResponse as SsmlOutputSpeech).Ssml);
            }
            return(innerResponse);
        }
Esempio n. 6
0
        /// <summary>
        ///  create a invalid slot value message
        /// </summary>
        /// <param name="data"></param>
        /// <returns>string invalid planet name or empty string</returns>
        private string InvalidSlotMessage(YogaBreak data, string departKey, string arriveKey)
        {
            string output = String.Empty;

            return(output);
        }