public void performMove(Dog otherDog, float randomNumber) {
if(!(this.isDefending)&&!(otherDog.isDefending)){
if(randomNumber * 100 <= speed){
otherDog.getHit(power);
}
else{
resultOfLastInteraction = "...." + this.name + "miss";
}
}
else if(!(this.isDefending) && (otherDog.isDefending)){
if((randomNumber * 100 >= 0) && (randomNumber * 100 <= 50)){
otherDog.getHit(250/power);
}
else if((randomNumber * 100 >= 51) && (randomNumber * 100 <= 75)){
Dog.getHit(250/power);
}
else if((randomNumber * 100 >= 76) && (randomNumber * 100 <= 100)){
tolerance.getHit(250/power);
}
else if((this.isDefending) && (otherDog.isDefending)){
}
}
Having a problem with this code. The problem is the Dog.getHit and tolerance.getHit. No matter what I change it to it is either "can't use in a primitive boolean or can't use static type
if(!(this.isDefending)&&!(otherDog.isDefending)){
if(randomNumber * 100 <= speed){
otherDog.getHit(power);
}
else{
resultOfLastInteraction = "...." + this.name + "miss";
}
}
else if(!(this.isDefending) && (otherDog.isDefending)){
if((randomNumber * 100 >= 0) && (randomNumber * 100 <= 50)){
otherDog.getHit(250/power);
}
else if((randomNumber * 100 >= 51) && (randomNumber * 100 <= 75)){
Dog.getHit(250/power);
}
else if((randomNumber * 100 >= 76) && (randomNumber * 100 <= 100)){
tolerance.getHit(250/power);
}
else if((this.isDefending) && (otherDog.isDefending)){
}
}
Having a problem with this code. The problem is the Dog.getHit and tolerance.getHit. No matter what I change it to it is either "can't use in a primitive boolean or can't use static type