本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}