Esempio n. 1
0
File: Cat.java Progetto: 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);
 }
Esempio n. 2
0
File: Cat.java Progetto: 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;
  }