コード例 #1
0
 public void Eat(IHerbivore herbivore)
 {
     WriteLine($"{GetType().Name} eats {herbivore.GetType().Name}");
 }
コード例 #2
0
 public void eat(IHerbivore h)
 {
     Console.WriteLine(this.GetType().Name + " eats " + h.GetType().Name);
 }
コード例 #3
0
ファイル: Wolf.cs プロジェクト: cory-melendez/Design-Patterns
 public void Eat(IHerbivore herbivore)
 {
     Console.WriteLine("sneaks and bites and eats " + herbivore.GetType().Name);
 }
コード例 #4
0
ファイル: Lion.cs プロジェクト: cory-melendez/Design-Patterns
 public void Eat(IHerbivore herbivore)
 {
     Console.WriteLine("stalks and pounces on " + herbivore.GetType().Name);
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: CodeValue/DesignPatterns
 public void Eat(IHerbivore h)
 {
     // Eat Wildebeest
     Console.WriteLine(this.GetType().Name +
                       " eats " + h.GetType().Name);
 }
コード例 #6
0
 public void Eat(IHerbivore food)
 {
     Console.WriteLine(this.GetType().Name + " eats " + food.GetType().Name);
 }
コード例 #7
0
ファイル: Program.cs プロジェクト: slctr/EPAM.DotNET.Training
 public string Eat(IHerbivore herbivore)
 {
     return(String.Format("{0} eats {1}", GetType().Name, herbivore.GetType().Name));
 }
コード例 #8
0
 public void Eat(IHerbivore h)
 {
     // Eat Bison
     Console.WriteLine(GetType().Name + " eats " + h.GetType().Name);
 }
コード例 #9
0
 string ICarnivore.Eats(IHerbivore herbivore)
 {
     //TODO: replace this code with MongoDB
     return $"{GetType().Name} eats {herbivore.GetType().Name}";
 }
コード例 #10
0
ファイル: MainApp.cs プロジェクト: ronymaychan/demos
 public void Eat(IHerbivore h)
 {
     // Eat Bison
     Console.WriteLine(this.GetType().Name +
         " eats " + h.GetType().Name);
 }
コード例 #11
0
 public void Eat(IHerbivore herbivore)
 {
     Console.WriteLine($"{GetType().Name} eats {herbivore.GetType().Name} in America.");
 }
コード例 #12
0
 public void Eat(IHerbivore herbivore)
 {
     Console.WriteLine($"{this.GetType().Name} eats {herbivore.GetType().Name}");
 }