コード例 #1
0
 public abstract void Eat(Herbibore herbibore);
コード例 #2
0
ファイル: Lion.cs プロジェクト: emidiovictor/DesignPatterns
 public override void Eat(Herbibore herbibore)
 {
     Console.WriteLine($"{this.GetType().Name} eats {herbibore.GetType().Name}");
 }
コード例 #3
0
 public Ecosystem(ContinentFactory factory)
 {
     _herbibore = factory.CreateHerbivore();
     _carnivore = factory.CreateCarnivore();
 }