当前位置: 首页>>代码示例>>C#>>正文


C# Face.TwoChoices方法代码示例

本文整理汇总了C#中Face.TwoChoices方法的典型用法代码示例。如果您正苦于以下问题:C# Face.TwoChoices方法的具体用法?C# Face.TwoChoices怎么用?C# Face.TwoChoices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Face的用法示例。


在下文中一共展示了Face.TwoChoices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RunConsciousRoutine

 protected override RoutineResult RunConsciousRoutine()
 {
     using (var memory = new Memory())
     {
         var face = new Face(RendererFactory.GetPreferredRenderer(), InputFactory.GetPreferredInput());
         Interaction i = face.TwoChoices(memory, "Cake or Pie?", "Cake", "Pie");
         face.Talk(memory, "AHHHHH!", "A zombie!");
         if (string.IsNullOrEmpty(i.resultText))
         {
             face.Talk(memory, "You were eaten");
         }
         else
         {
             face.Talk(memory, "Let's get the", "grenades");
             face.Talk(memory, string.Format("{0} grenades", i.resultText));
         }
         return MakeRoutineResult(memory, i);
     }
 }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:19,代码来源:PoopyTalk.cs

示例2: RunConsciousRoutine

        protected override RoutineResult RunConsciousRoutine()
        {
            var face = new Face(RendererFactory.GetPreferredRenderer(), InputFactory.GetPreferredInput());
            using (var memory = new Memory())
            {
                Interaction i = face.YesNo(memory, "Are you lost?");
                if (i.playerAnswer == Interaction.Answer.DidNotAnswer)
                {
                    face.Talk(memory, "Nevermind");
                    face.Talk(memory, "I'm Talking", "to myself");
                    face.SlowTalk(memory, "again...");
                    return MakeRoutineResult(memory, i);
                }
                else if (i.playerAnswer == Interaction.Answer.No)
                {
                    face.Talk(memory, "OK");
                    face.Talk(memory, "Just checking");
                    face.Talk(memory, "'cause I thought", "you looked...");
                    face.Talk(memory, "you know", millisecondTimeout: 2000);
                    face.Talk(memory, "", "kinda lost");
                    return MakeRoutineResult(memory, i);
                }
                else
                {
                    Interaction looking = face.YesNo(memory, "Need the bathroom?");
                    if (looking.playerAnswer == Interaction.Answer.Yes)
                    {
                        face.Talk(memory, "It's right there", "          =========>", 10000);
                        face.SlowTalk(memory, "By the way");
                        Interaction brNeed = face.TwoChoices(memory, "Which one?", "One", "Two");
                        if (brNeed.playerAnswer == Interaction.Answer.DidNotAnswer)
                        {
                            face.Talk(memory, "Sorry.", "Too personal, I know");
                        }
                        else
                        {
                            face.Talk(memory, "Hope it all", "comes out ok");
                        }
                        return MakeRoutineResult(memory, looking);
                    }

                    looking = face.YesNo(memory, "Need Tech Support?");
                    if (looking.playerAnswer == Interaction.Answer.Yes)
                    {
                        face.Talk(memory, "Go that way", "<==========         ");
                        face.Talk(memory, "Until you see", "<==========         ");
                        face.Talk(memory, "Big glass doors", "<==========         ", 10000);
                        face.Talk(memory, "You can't miss it");
                        return MakeRoutineResult(memory, looking);
                    }

                    looking = face.YesNo(memory, "Need books?");
                    if (looking.playerAnswer == Interaction.Answer.Yes)
                    {
                        face.Talk(memory, "Look anywhere but", "the first floor.");
                        face.Talk(memory, "They are kinda", "taking those away.");
                        face.Talk(memory, "Something to do", "with the internet.");
                        face.Talk(memory, "I never get on that", "internet thing");
                        face.Talk(memory, "Too complicated", ";-)");
                        return MakeRoutineResult(memory, looking);
                    }

                    looking = face.YesNo(memory, "Need the ARC?");
                    if (looking.playerAnswer == Interaction.Answer.Yes)
                    {
                        face.Talk(memory, "Go that way", "<==========         ");
                    ///////////////////////01234567890123456789////////////////////
                        face.Talk(memory, "Then head down", "the stairs. VVV");
                        face.Talk(memory, "It's on the B-level", "");
                        face.Talk(memory, "Wish I was on B...", "");
                        face.Talk(memory, "So much cooler", " down there.");
                        return MakeRoutineResult(memory, looking);
                    }

                    face.Talk(memory, "Sorry, I don't know", "much else.");
                    return MakeRoutineResult(memory, i);
                }
            }
        }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:79,代码来源:Directions.cs


注:本文中的Face.TwoChoices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。