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


C# Face.ResetIncrementer方法代码示例

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


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

示例1: RunConsciousRoutine

        protected override RoutineResult RunConsciousRoutine()
        {
            using (var memory = new Memory())
            {
                var face = new Face(RendererFactory.GetPreferredRenderer(), InputFactory.GetPreferredInput());
                face.ResetIncrementer();

                face.Talk(memory, "I'm wondering if", "we've met before.");
                if (memory.GetKnownPlayers().Count > 0)
                {
                    face.SlowTalk(memory, "Lets see...");
                    foreach (Player player in memory.GetKnownPlayers())
                    {
                        Interaction answer = face.GetSingleValue(memory, player.QuestionLine1, player.QuestionLine2, millisecondTimeout: 30000);
                        if (answer.playerAnswer == Interaction.Answer.DidNotAnswer)
                        {
                            face.Talk(memory, "I'm talking", "to myself.");
                            return MakeRoutineResult(memory, answer);
                        }
                        else if (answer.resultValue == player.Answer)
                        {
                            face.Talk(memory, string.Format("Hey, {0}!", player.Name));
                            face.Talk(memory, "I knew you'd", "be back.");
                            memory.SetCurrentPlayer(player);
                            answer.player = player;
                            return MakeRoutineResult(memory, answer);
                        }
                        face.Talk(memory, "Oh.", millisecondTimeout: 2000);
                        face.TalkInCircles(memory, 5000, "No", "That's not right", "Nope");
                        Interaction knowYou = memory.Remember("Do I know you?", "");
                        if (null == knowYou) knowYou = face.YesNo(memory, "Do I know you?");
                        if (knowYou.playerAnswer == Interaction.Answer.DidNotAnswer)
                        {
                            face.Talk(memory, "I'm talking", "to myself.");
                            return MakeRoutineResult(memory, answer);
                        }
                        if (knowYou.playerAnswer == Interaction.Answer.No)
                        {
                            face.Talk(memory, "Well, no wonder.");
                            knowYou.success = false;
                            return MakeRoutineResult(memory, knowYou);
                        }
                        face.Talk(memory, "Well then, let's", "maybe try another");
                    }
                    face.Talk(memory, "Actually, I don't", "think we've met.");
                }
                else
                {
                    face.Talk(memory, "But I guess", "that's not possible");
                }
                return MakeRoutineResult(memory, new Interaction() { success = false, resultValue = (int)Interaction.Answer.No });
            }
        }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:53,代码来源:PersonID.cs


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