Никак не могу понять почему не пропускает при двух одинаковых параметрах.
Подскажите пожалуйста
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
public int age;
public int weight;
public int strength;
public Cat() {
/* this.age = age;
this.weight = weight;
this.strength = strength;
*/
}
public boolean fight(Cat anotherCat) {
int c1 = 0;
int c2 = 0;
if (this.age == anotherCat.age && this.weight == anotherCat.weight && this.strength >= anotherCat.strength) {
return false;
} else {
if (this.age > anotherCat.age)
c1++;
else {
if (this.age < anotherCat.age)
c2++;
}
if (this.weight > anotherCat.weight)
c1++;
else {
if (this.weight < anotherCat.weight)
c2++;
}
if (this.strength > anotherCat.strength)
c1++;
else {
if (this.strength < anotherCat.strength)
c2++;
}
}
if ( c1 >= 2 || c2 >=2 ) {
return c1 >= 2;
}
else {
if (c1 == 1 && c2 == 1) {
return false;
} else {
return c1 == 1;
}
}
}
public static void main(String[] args) {
}
}