예제 #1
0
 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}");
 }
예제 #2
0
 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}");
 }
예제 #3
0
        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}]");
        }
예제 #4
0
        public override double CalculateHappiness(double happiness)
        {
            double mainFoodHappiness = mainFood.CalculateHappiness(happiness);

            return(mainFood.CalculateHappiness(mainFoodHappiness));
        }
예제 #5
0
 public void Eat(IFood food)
 {
     Happiness = food.CalculateHappiness(this.Happiness);
 }