public void Eat(Herbivore herbivore) { if (herbivore.Weight <= Power) { Power += 10; } else { Power -= 10; } }
public void EatHerbivore(Herbivore herbivore) { if (this.Power >= herbivore.Height) { herbivore.isAlive = false; this.Power += 10; Console.WriteLine($"{this} has eated"); } else { herbivore.isAlive = true; this.Power -= 10; } }
// Constructor public AnimalWorld(ContinentFactory factory) { _carnivore = factory.CreateCarnivore(); _herbivore = factory.CreateHerbivore(); }
public abstract void Eat(Herbivore h);
public override void Eat(Herbivore h) { Console.WriteLine(this.GetType().Name + " eats " + h.GetType().Name); }
public override void Eat(Herbivore h) { // Eat Bison Console.WriteLine($"{ GetType().Name} eats {h.GetType().Name}"); }
public Client(Herbivore h, Carnivore c) { _herbivore = h; _carnivore = c; }
public void ChangeFactory(ContinentFactory _factory) { _herbivore = _factory.CreateHerbivore(); _carnbivore = _factory.CreateCarnbivore(); }
public AnimaWorld(ContinentFactory _factory) { _herbivore = _factory.CreateHerbivore(); _carnbivore = _factory.CreateCarnbivore(); }
public abstract void Eats(Herbivore animal);
public override void Eats(Herbivore animal) { WriteLine((this.GetType()).Name + " eats " + (animal.GetType()).Name); }
public void NutritionCarnivores(Carnivore carnivore, Herbivore herbivore) { carnivore.Eat(herbivore); }
public void MealsHerbivores(Herbivore herbivore) { herbivore.EatGrass(); }
public AnimalWorld(ContitentFactory factory) { _herbivore = factory.CreateHerbivore(); _carnivore = factory.CreateCarnivore(); _superPredator = factory.CreateSuperPredator(); }
public override void Eat(Herbivore herbivore) { Console.WriteLine(GetType().Name + " eats " + herbivore.GetType().Name); }
public AnimalWorld(ContinentFactory p_factory) { m_carnivore = p_factory.CreateCarnivore(); m_herbivore = p_factory.CreateHerbivore(); }