public void Speak() { if (PhrasesHeard.Count == 0) { Console.WriteLine($"{Name} looks at you quizzically."); return; } var textToSay = PhrasesHeard.ElementAt(++TimesSpoken % PhrasesHeard.Count); Console.WriteLine($"{Name} says: {textToSay}"); }
public void LearnPhrase(string phrase) { PhrasesHeard.Add(phrase); }