示例#1
0
 public World(WorldFactory factory)
 {
     plant = factory.CreatePlant();
     herbi = factory.CreateHerbivore();
     pred  = factory.CreatePredator();
 }
示例#2
0
 public override string EatHerbivore(Herbivore herbivore)
 {
     return(base.EatHerbivore(herbivore));
 }
示例#3
0
 public override string EatHerbivore(Herbivore herbivore)
 {
     return($"Я {this.Name} я сьел {herbivore.Name}");
 }
示例#4
0
 public virtual string EatHerbivore(Herbivore herbivore)
 {
     return($"Я {this.Name}, я сьел {herbivore.Name}");
 }