public void HasEaten(string plant) { IsEaten = true; Console.ForegroundColor = ConsoleColor.Green; EatPlant?.Invoke($"{plant} has been eaten by {KindOfHerbivore}"); Console.ResetColor(); }
public void Eating(string plant) { int n = Program.random.Next(1, 6); for (int i = 0; i < n; i++) { EatPlant?.Invoke($"{KindOfHerbivore} is eating {plant}"); Thread.Sleep(1000); } }