private AdventureNode GetSearchHedgeNode()
        {
            AdventureNode outNode = new AdventureNode();

            outNode.Name         = SEARCHHEDGE_NAME;
            outNode.OutputSpeech = new List <SpeechFragement>();
            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("It's a rabid possum!"));

            //  outNode.OutputSpeech.Add(SpeechFragement.CreateAudioLibraryFragment(Whetstone.Alexa.Audio.AmazonSoundLibrary.Animals.CAT_ANGRY_SCREECH_1X_01))

            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("It bites you! Better have that looked at. Maybe you should walk it off. To walk it off, say walk it off."));

            outNode.Reprompt = new List <SpeechFragement>();
            outNode.Reprompt.Add(SpeechFragement.CreateTextFragment("To walk it off, say walk it off."));

            outNode.Card = new CardInfo()
            {
                Title = "Rabid Possum",
                Text  = "It's a rabid possum. It bites you! Better have that looked at. Maybe you should walk it off."
            };


            outNode.NodeRoutes = new List <NodeRoute>();
            outNode.NodeRoutes.Add(new NodeRoute
            {
                IntentName   = "WalkIntent",
                NextNodeName = OUTOFWOODS_NAME
            });

            return(outNode);
        }
        private AdventureNode GetTrollTalksNode()
        {
            AdventureNode outNode = new AdventureNode();

            outNode.Name         = TROLLTALKS_NAME;
            outNode.OutputSpeech = new List <SpeechFragement>();
            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("The troll shares his opinion of earl grey tea, Darjeeling and green tea. He drones on and on. Maybe you should just keep walking."));

            outNode.Reprompt = new List <SpeechFragement>();

            outNode.Reprompt.Add(SpeechFragement.CreateTextFragment("To keep walking, say keep walking."));

            outNode.Card = new CardInfo()
            {
                Title = "Talkative Troll",
                Text  = "The troll shares his opinion of earl grey tea, Darjeeling and green tea. He drones on and on. Maybe you should just keep walking."
            };


            outNode.NodeRoutes = new List <NodeRoute>();

            outNode.NodeRoutes.Add(
                new NodeRoute()
            {
                IntentName   = "WalkIntent",
                NextNodeName = OUTOFWOODS_NAME
            });

            return(outNode);
        }
        private AdventureNode GetStopNode()
        {
            AdventureNode outNode = new AdventureNode();

            outNode.Name         = "StopNode";
            outNode.OutputSpeech = new List <SpeechFragement>();
            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("Thanks for playing!"));

            return(outNode);
        }
        private AdventureNode GetHelpNode()
        {
            AdventureNode outNode = new AdventureNode();

            outNode.Name         = "HelpNode";
            outNode.OutputSpeech = new List <SpeechFragement>();
            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("You're playing the Sample Adventure. "));

            return(outNode);
        }
        private AdventureNode GetUnknownNode()
        {
            AdventureNode outNode = new AdventureNode();

            outNode.Name         = "UnknownNode";
            outNode.OutputSpeech = new List <SpeechFragement>();
            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("I'm sorry. I didn't get that. "));

            return(outNode);
        }
        private AdventureNode GetOutOfWoodsNode()
        {
            AdventureNode outNode = new AdventureNode();

            outNode.Name         = OUTOFWOODS_NAME;
            outNode.OutputSpeech = new List <SpeechFragement>();
            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("The sun is shining. "));
            outNode.OutputSpeech.Add(SpeechFragement.CreateAudioLibraryFragment(Whetstone.Alexa.Audio.AmazonSoundLibrary.Animals.BIRD_FOREST_02));
            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("The birds are chirping and you're out of the woods. Hurray! You won!"));


            outNode.Card = new CardInfo()
            {
                Title = "Out of the Woods",
                Text  = "The sun is shining. The birds are chirping and you're out of the woods. Hurray! You won!"
            };

            return(outNode);
        }
        private AdventureNode GetTrollLaughsNode()
        {
            AdventureNode outNode = new AdventureNode();

            outNode.Name         = TROLLLAUNGHS_NAME;
            outNode.OutputSpeech = new List <SpeechFragement>();

            outNode.OutputSpeech.Add(SpeechFragement.CreateAudioLibraryFragment(Whetstone.Alexa.Audio.AmazonSoundLibrary.Impact.PUNCH_01));

            //outNode.OutputSpeech.Add(SpeechFragement.CreateAudioLibraryFragment(Whetstone.Alexa.Audio.AmazonSoundLibrary.Battle.BATTLE_MAN_GRUNTS_01));

            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("His skin is too tough. You scrape your knuckles and the troll just laughs at you."));

            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("Ha! Ha! ", "Joey"));

            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("Perhaps you should try giving him some tea instead. To serve tea, say serve tea."));

            outNode.Reprompt = new List <SpeechFragement>();

            outNode.Reprompt.Add(SpeechFragement.CreateTextFragment("To serve tea, say serve tea."));

            outNode.Card = new CardInfo()
            {
                Title = "The Troll Laughs",
                Text  = "His skin is too tough. You scrape your knuckles and the troll just laughs at you. Perhaps you should try giving him some tea instead.",
            };



            outNode.NodeRoutes = new List <NodeRoute>();

            outNode.NodeRoutes.Add(
                new NodeRoute()
            {
                IntentName   = "TeaIntent",
                NextNodeName = GOODTEA_NAME
            });

            return(outNode);
        }
        private AdventureNode GetGoodTeaNode()
        {
            AdventureNode outNode = new AdventureNode();

            outNode.Name         = GOODTEA_NAME;
            outNode.OutputSpeech = new List <SpeechFragement>();
            outNode.OutputSpeech.Add(SpeechFragement.CreateTextFragment("He takes a sip and seems happy with the tea. He smiles. He looks like he would enjoy a conversation. Would you like to talk to him or keep walking?"));

            outNode.Reprompt = new List <SpeechFragement>();

            outNode.Reprompt.Add(SpeechFragement.CreateTextFragment("Would you like to talk to him or keep walking?"));

            outNode.Card = new CardInfo()
            {
                Title = "Good Tea",
                Text  = "He takes a sip and seems happy with the tea. He smiles. He looks like he would enjoy a conversation.",
            };


            outNode.NodeRoutes = new List <NodeRoute>();

            outNode.NodeRoutes.Add(
                new NodeRoute()
            {
                IntentName   = "WalkIntent",
                NextNodeName = OUTOFWOODS_NAME
            });

            outNode.NodeRoutes.Add(
                new NodeRoute()
            {
                IntentName   = "TalkIntent",
                NextNodeName = TROLLTALKS_NAME
            });

            return(outNode);
        }
        public void BuildStoryNode()
        {
            Adventure adv = new Adventure();

            adv.VoiceId = Amazon.Polly.VoiceId.Joey.Value;

            adv.VoiceId = Amazon.Polly.VoiceId.Emma;

            AdventureNode startNode = new AdventureNode();

            startNode.Name         = "PathStart";
            startNode.OutputSpeech = new List <SpeechFragement>();


            string fullIntro = "You stand on a mountain side overlooking a slope that descends into a valley that disappears into forest. Miles away, it ends in a beach where land yields to sea in a crumble of sand. You are at a fork in the road. Would you like to go left or right?";

            startNode.OutputSpeech.Add(
                SpeechFragement.CreateTextFragment(fullIntro));

            startNode.Card = new CardInfo()
            {
                Title = "A Fork in the Road",
                Text  = fullIntro
            };


            adv.StartNodeName = "PathStart";


            startNode.Reprompt = new List <SpeechFragement>();

            startNode.Reprompt.Add(SpeechFragement.CreateTextFragment("Left or right?"));

            adv.Nodes = new List <AdventureNode>();

            adv.Nodes.Add(startNode);

            AdventureNode trollinPath = new AdventureNode();

            trollinPath.Name         = "TrollInPath";
            trollinPath.OutputSpeech = new List <SpeechFragement>();

            trollinPath.OutputSpeech.Add(SpeechFragement.CreateAudioFragment("trollgrowl.mp3"));
            trollinPath.OutputSpeech.Add(SpeechFragement.CreateTextFragment("There's a troll in your way."));
            trollinPath.OutputSpeech.Add(SpeechFragement.CreateAudioFragment("trollsniff.mp3"));
            trollinPath.OutputSpeech.Add(SpeechFragement.CreateTextFragment("Would you like to punch him or serve him tea?"));

            trollinPath.Card = new CardInfo()
            {
                Title      = "Rabid Possum",
                Text       = "There's a troll in your way. You can punch him or serve him tea.",
                LargeImage = "troll_lg.jpg",
                SmallImage = "troll_sm.jpg"
            };


            trollinPath.Reprompt = new List <SpeechFragement>();

            trollinPath.Reprompt.Add(SpeechFragement.CreateTextFragment("Punch him or serve him tea?"));

            trollinPath.NodeRoutes = new List <NodeRoute>();

            trollinPath.NodeRoutes.Add(
                new NodeRoute
            {
                IntentName   = "PunchIntent",
                NextNodeName = TROLLLAUNGHS_NAME
            });

            trollinPath.NodeRoutes.Add(
                new NodeRoute
            {
                IntentName   = "TeaIntent",
                NextNodeName = GOODTEA_NAME
            });



            adv.Nodes.Add(trollinPath);

            AdventureNode animalInBush = new AdventureNode();

            animalInBush.Name         = "HedgeNode";
            animalInBush.OutputSpeech = new List <SpeechFragement>();

            animalInBush.OutputSpeech.Add(SpeechFragement.CreateAudioLibraryFragment(Whetstone.Alexa.Audio.AmazonSoundLibrary.Foley.SWOOSH_FAST_1X_01));

            animalInBush.OutputSpeech.Add(SpeechFragement.CreateTextFragment("You see a small animal dart into a bush. Would you like to look in the bush or keep walking?"));

            animalInBush.Reprompt = new List <SpeechFragement>();
            animalInBush.Reprompt.Add(SpeechFragement.CreateTextFragment("Look in bush or keep walking?"));

            animalInBush.NodeRoutes = new List <NodeRoute>();
            animalInBush.NodeRoutes.Add(new NodeRoute
            {
                IntentName   = "WalkIntent",
                NextNodeName = OUTOFWOODS_NAME
            });

            animalInBush.NodeRoutes.Add(new NodeRoute
            {
                IntentName   = "SearchHedgeIntent",
                NextNodeName = SEARCHHEDGE_NAME
            });



            adv.Nodes.Add(animalInBush);

            startNode.NodeRoutes = new List <NodeRoute>();
            NodeRoute leftRoute = new NodeRoute();

            leftRoute.IntentName   = "LeftIntent";
            leftRoute.NextNodeName = trollinPath.Name;

            startNode.NodeRoutes.Add(leftRoute);


            NodeRoute rightRoute = new NodeRoute();

            rightRoute.IntentName   = "RightIntent";
            rightRoute.NextNodeName = animalInBush.Name;

            startNode.NodeRoutes.Add(rightRoute);

            AdventureNode stopNode = GetStopNode();

            adv.StopNodeName = stopNode.Name;
            adv.Nodes.Add(stopNode);

            adv.Nodes.Add(GetSearchHedgeNode());

            adv.Nodes.Add(GetOutOfWoodsNode());
            adv.Nodes.Add(GetTrollLaughsNode());
            adv.Nodes.Add(GetGoodTeaNode());
            adv.Nodes.Add(GetTrollTalksNode());


            AdventureNode helpNode = GetHelpNode();

            adv.Nodes.Add(helpNode);
            adv.HelpNodeName = helpNode.Name;

            AdventureNode unknownNode = GetUnknownNode();

            adv.Nodes.Add(unknownNode);
            adv.UnknownNodeName = unknownNode.Name;

            var serializer = new Serializer();

            string        yamlOut;
            StringBuilder builder = new StringBuilder();

            using (StringWriter writer = new StringWriter(builder))
            {
                serializer.Serialize(writer, adv);
                yamlOut = builder.ToString();
            }
        }