Пример #1
0
 public virtual void Eat(Leaf leaf, Meat meat)
 {
 }
Пример #2
0
 //Metoden Eat(Leaf leaf). Körs om det finns blad kvar.
 override public void Eat(Leaf leaf)
 {
     HungerLevel = 0;
     leaf.Level--;
 }
Пример #3
0
        //Viktors version av ovanstående. Satte även klassen animal till abstract.
        // public override string ToString()
        //{
        //     string str = Type + "en " + Name;
        //     return str;
        // }

        public virtual void Eat(Leaf food)
        {
        }