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