1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| package projetSynthese;
public class Fou extends Piece {
public Fou(String nom, String couleur){
super(nom, couleur);
}
public boolean estValide (Position depart, Position arrivee){
if(depart.getColonne()==arrivee.getColonne() && depart.getLigne()==arrivee.getLigne())
return true;
else if((norme(depart, arrivee)%2==0) && (depart.getColonne()!=arrivee.getColonne()) && (depart.getLigne()!=arrivee.getLigne()) && (Math.abs(arrivee.getColonne()-depart.getColonne()) == Math.abs(arrivee.getLigne()-depart.getLigne())))
return true;
return false;
}
} |