public void Eat(IFood food) { Console.WriteLine($"Client: Starting to eat food, client: {this}, food: {food}"); Happiness = food.CalculateHappiness(Happiness); Console.WriteLine("Client: Csam csam nyam nyam"); Console.WriteLine($"Client: Food eaten, client: {this}"); }
public void Eat(IFood food) { Console.WriteLine($"Starting to eat food, client: Client [name={Name}, happiness={Happiness}], food: {food.ToString()}]"); Console.WriteLine("Csam csam nyam nyam"); Happiness = food.CalculateHappiness(Happiness); Console.WriteLine($"Food eaten, client: Client name={Name}, happiness={Happiness}"); }
public void Eat(IFood food) { Console.WriteLine($"Client {Name} with {Happiness} happiness starts eating " + $"{food.MainFoodName} with {food.ExtraFoodName} "); Thread.Sleep(1500); Console.WriteLine("Csam csam nyam nyam"); Happiness = food.CalculateHappiness(Happiness); Console.WriteLine($"Food eaten, Client [name={Name}, happiness={Happiness}]"); }
public override double CalculateHappiness(double happiness) { double mainFoodHappiness = mainFood.CalculateHappiness(happiness); return(mainFood.CalculateHappiness(mainFoodHappiness)); }
public void Eat(IFood food) { Happiness = food.CalculateHappiness(this.Happiness); }