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);
 }
Exemplo n.º 2
0
Arquivo: Cat.java Projeto: kuban83/QA
  public Cat makeLove(Cat anotherCat) {
    Random rn = new Random();
    if (this.isSex() != anotherCat.isSex())
      return new Cat("noname", "white", 0, 0, rn.nextBoolean());

    return null;
  }