Пример #1
0
        public void MakeBaby(Dad dad, string name)
        {
            Baby baby = new Baby(name);

            Child     = baby;
            dad.Child = baby;
            baby.AddComforter(dad);
            baby.AddComforter(this);
            Console.WriteLine($"{Name} has had a baby with {dad.Name}, his name is {baby.Name}");
        }
Пример #2
0
 public override void ComfortChild(Baby baby)
 {
     if (Patience > 0)
     {
         Console.WriteLine($"{Name} prende in braccio {baby.Name} e lo culla");
         Patience--;
     }
     else
     {
         Console.WriteLine($"{Name} gives Ben to Luke and runs away");
         baby.RemoveComforter(this);
     }
 }
Пример #3
0
 public abstract void ComfortChild(Baby baby);
Пример #4
0
 public void ComfortChild(Baby baby)
 {
     Console.WriteLine($"{Name} generates a calming frequency to lull {baby.Name} to sleep");
 }
Пример #5
0
 public override void ComfortChild(Baby baby)
 {
     Console.WriteLine($"{Name} runs off");
     baby.RemoveComforter(this);
 }