Exemplo n.º 1
0
Arquivo: Cat.java Projeto: kuban83/QA
 public Cat fight(Cat enemy) {
   if (this.isSex() == enemy.isSex()) {
     if (this.getWeight() < enemy.getWeight()) {
       return enemy;
     }
     if (this.getWeight() > enemy.getWeight()) {
       return this;
     }
     if (this.getWeight() == enemy.getWeight()) {
       return new Cat("Equal warriors", null, 0, 0, false);
     }
   }
   return new Cat("❤❤❤ Make love not war ❤❤❤", null, 0, 0, false);
 }