public override Interaction Run() { var renderer = new ConsoleRenderer(); var input = new ConsoleInput(); var face = new Face(renderer, input); face.Talk("I'm wondering if we've met before."); if (Memory.GetInstance().QuestionsWithAnswers.Count > 0) { face.Talk("Lets see..."); foreach (string question in Memory.GetInstance().QuestionsWithAnswers) { Interaction answer = face.GetSingleValue(question, 30000); Interaction player = Memory.GetInstance().Remember(answer.displayText, true); if (answer.resultValue == player.resultValue) { face.Talk(string.Format("Hey, {0}!", player.playerName)); face.Talk("I knew you'd be back."); return(player); } face.Talk("Oh.", 2000); face.TalkInCircles(5000, "No, That's not right.", "Nope"); Interaction knowYou = Memory.GetInstance().Remember("Do I know you?"); if (null == knowYou) { knowYou = face.YesNo("Do I know you?"); } if (knowYou.playerAnswer == Interaction.Answer.No) { face.Talk("Well, no wonder."); return(new Interaction() { success = false }); } face.Talk("Well then, let's maybe try another"); } face.Talk("Actually, I don't think we've met."); } else { face.Talk("But I guess that's not possible"); } return(new Interaction() { success = false }); }
public override Interaction Run() { var renderer = new ConsoleRenderer(); var input = new ConsoleInput(); var face = new Face(renderer, input); face.Talk("I'm wondering if we've met before."); if (Memory.GetInstance().QuestionsWithAnswers.Count > 0) { face.Talk("Lets see..."); foreach(string question in Memory.GetInstance().QuestionsWithAnswers) { Interaction answer = face.GetSingleValue(question, 30000); Interaction player = Memory.GetInstance().Remember(answer.displayText, true); if (answer.resultValue == player.resultValue) { face.Talk(string.Format("Hey, {0}!", player.playerName)); face.Talk("I knew you'd be back."); return player; } face.Talk("Oh.", 2000); face.TalkInCircles(5000, "No, That's not right.", "Nope"); Interaction knowYou = Memory.GetInstance().Remember("Do I know you?"); if(null == knowYou) knowYou = face.YesNo("Do I know you?"); if (knowYou.playerAnswer == Interaction.Answer.No) { face.Talk("Well, no wonder."); return new Interaction() { success = false }; } face.Talk("Well then, let's maybe try another"); } face.Talk("Actually, I don't think we've met."); } else { face.Talk("But I guess that's not possible"); } return new Interaction() { success = false }; }