예제 #1
0
 public bool Equals(Animal that)
 {
     if ((object)that == null)
     {
         return false;
     }
     if (that.petName.Equals(this.petName) && that.type == this.type && that.mood == this.mood && that.vitality == this.vitality)
     {
         return true;
     }
     return false;
 }
예제 #2
0
파일: Snake.cs 프로젝트: davidbedok/oeprog2
 public void toxic(Animal target)
 {
     this.moodUp();
     target.injured();
     target.moodDown();
 }
예제 #3
0
 public void attack(Animal target)
 {
     this.moodDown();
     target.injured();
 }
예제 #4
0
 public void addAnimal(Animal animal)
 {
     this.animals.Add(animal);
 }