public override void Feed(IPetFood food) { if (food is Fish) { Eat(food); } else { Meow(); } }
protected void Eat(IPetFood food) { _hunger -= food.Energy; }
public virtual void Feed(IPetFood food) { Eat(food); }
public static void PetFeed <TP, TF>(PetAnimal petAnimal, IPetFood petFood) where TP : PetAnimal where TF : IPetFood { petAnimal.Feed(petFood); }