public override void EatHerbivore(Herbivore herbivore) { if (herbivore.Life != false) { if (Power > herbivore.Weight) { Power += 10; herbivore.Weight -= 10; if (herbivore.Weight == 0) { herbivore.Life = false; } } else { if (Power != 0) { Power -= 10; } } } }
public override void Eat(Herbivore h) { // Eat Wildebeest Console.WriteLine(this.GetType().Name + " eats " + h.GetType().Name); }
public AminalWorld(ContinentFactory factory) { _carnivore = factory.CreateCarnivore(); _herbivore = factory.CreateHerbivore(); }
public override void Eat(Herbivore herbivore) { Console.WriteLine($"{this.GetType().Name} eats a juicy {herbivore.GetType().Name}"); }
public abstract void Eat(Herbivore herbivore);