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


C# Face.RememberSingleValue方法代码示例

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


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

示例1: RunConsciousRoutine

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

                face.Talk(memory, "Let's think", "of a secret");
                Player player = memory.GetPlayerWithNoAnswer();
                if (null == player)
                {
                    face.Talk(memory, "Sorry,", "I'm full on friends");
                    return MakeRoutineResult(memory, new Interaction() { success = false });
                }

                Interaction newPlayer = face.RememberSingleValue(memory, player.QuestionLine1, player.QuestionLine2, longTerm: true);
                if (newPlayer.playerAnswer == Interaction.Answer.DidNotAnswer)
                {
                    face.SlowTalk(memory, "Well");
                    face.Talk(memory, "We don't", "have to be friends");
                    face.Talk(memory, "I guess...");
                }
                else
                {
                    player.Answer = newPlayer.resultValue;
                    memory.SetCurrentPlayer(player);
                    newPlayer.player = player;
                    face.Talk(memory, "Great!");
                    face.Talk(memory, "I'll call you", player.Name, 8000);
                    face.Talk(memory, "Remember both the", "Q & A for next time", 8000);
                    face.Talk(memory, "And I'll", "remember you!", 8000);
                }
                return MakeRoutineResult(memory, newPlayer);
            }
        }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:34,代码来源:CreatePlayer.cs

示例2: CheckForAnything

 private bool CheckForAnything(Memory memory, Face face, string line1, string line2, int timeoutMS, out Interaction i)
 {
     i = face.RememberSingleValue(memory, line1, line2, false, timeoutMS);
     if (i.playerAnswer != Interaction.Answer.DidNotAnswer)
         return true;
     else
         return false;
 }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:8,代码来源:Existential.cs

示例3: RunConsciousRoutine

        protected override RoutineResult RunConsciousRoutine()
        {
            using (var memory = new Memory())
            {
                Topic[] topics = {  new Topic() { name = "Ebola", positive=false},
                                new Topic() { name = "football game", positive=true},
                                new Topic() { name = "weather", positive=true},
                             };

                Random rand = new Random();
                int index = rand.Next(0, 3);

                var face = new Face(RendererFactory.GetPreferredRenderer(), InputFactory.GetPreferredInput());
                Interaction i = face.RememberSingleValue(memory, "How bout that", topics[index].name);
                face.Talk(memory, "Uh huh.");
                return MakeRoutineResult(memory, i);
            }
        }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:18,代码来源:ChitChat.cs

示例4: RunConsciousRoutine

 protected override RoutineResult RunConsciousRoutine()
 {
     string counterKey = "FavNumberRuns";
     using (var memory = new Memory())
     {
         var face = new Face(RendererFactory.GetPreferredRenderer(), InputFactory.GetPreferredInput());
         Interaction i = face.RememberSingleValue(memory, "What's your", "favorite number?", true);
         if (!Memory.PlayerLoggedIn())
         {
             face.Talk(memory, "Interesting.");
             face.Talk(memory, "I don't know you.");
             face.SlowTalk(memory, "Or do I...");
             return MakeRoutineResult(memory, i);
         }
         else
         {
             Interaction favNum = memory.Remember("What's your", "favorite number?", true);
             if (i.playerAnswer == Interaction.Answer.DidNotAnswer)
             {
                 face.Talk(memory, "Well, you don't", "have to tell");
                 face.Talk(memory, "I was just curious...");
                 face.Talk(memory, "Jeesh!");
                 return MakeRoutineResult(memory, i);
             }
             if (null == favNum)
             {
                 memory.AddToMemory(new Interaction() {player = memory.GetCurrentPlayer(), displayText = counterKey, resultValue = 1 }, true);
                 memory.SaveChanges();
                 face.Talk(memory, "Interesting.");
                 face.Talk(memory, "I'll remember that");
                 return MakeRoutineResult(memory, i);
             }
             else if (favNum.resultValue == i.resultValue)
             {
                 Interaction count = memory.Remember(counterKey, "", true);
                 switch (count.resultValue)
                 {
                     case 1:
                         face.Talk(memory, "That's what", "I thought.");
                         break;
                     case 2:
                         face.Talk(memory, "Yup.");
                         break;
                     case 3:
                         face.Talk(memory, "Consistant.");
                         break;
                     case 4:
                         face.Talk(memory, "Powerful.");
                         break;
                     case 5:
                         face.Talk(memory, "Punctual.");
                         break;
                     case 6:
                         face.Talk(memory, "Material.");
                         break;
                     case 7:
                         face.Talk(memory, "Maternal.");
                         break;
                     case 8:
                         face.Talk(memory, "Fondue.");
                         break;
                     case 9:
                         face.Talk(memory, "Fondon't.");
                         break;
                     case 10:
                         face.Talk(memory, "F*ck.");
                         break;
                     default:
                         face.Talk(memory, "After 10 of anything", "I lose interest.");
                         break;
                 }
                 count.resultValue++;
                 memory.AddToMemory(count);
             }
             else
             {
                 face.Talk(memory, "Oh");
                 Interaction changedIt = face.YesNo(memory, "You changed it?");
                 if (changedIt.playerAnswer == Interaction.Answer.Yes)
                 {
                     face.Talk(memory, "You're so", "complicated.");
                 }
                 else if (changedIt.playerAnswer == Interaction.Answer.No)
                 {
                     face.Talk(memory, "Interesting...");
                     face.Talk(memory, "", "(Liar)", 1000);
                 }
                 else
                 {
                     face.Talk(memory, "Whatever");
                     face.Talk(memory, "I can ignore", "you too.", 10000);
                 }
                 return MakeRoutineResult(memory, changedIt);
             }
         }
         return MakeRoutineResult(memory, i);
     }
 }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:98,代码来源:FavoriteNumber.cs


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