2019-03-20 14:14:08 +01:00
|
|
|
package piecesEchiquier;
|
|
|
|
|
|
|
|
public class Piece {
|
|
|
|
|
|
|
|
|
|
|
|
//variables
|
|
|
|
|
2019-04-02 17:42:22 +02:00
|
|
|
private boolean couleur; /* True = blanc & Flase = noir */
|
2019-04-02 17:38:04 +02:00
|
|
|
private Position emplacement;
|
2019-03-20 14:14:08 +01:00
|
|
|
private char lettre = '.';
|
|
|
|
private boolean enVie = true;
|
2019-04-02 17:38:04 +02:00
|
|
|
private Position depart;
|
2019-03-20 14:14:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//constructeur par defaut qui devrait probablement remplacer vide
|
|
|
|
|
|
|
|
public Piece()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// constructeur
|
|
|
|
|
2019-04-02 17:38:04 +02:00
|
|
|
public Piece(boolean couleur,char l, int X, int Y)
|
2019-03-20 14:14:08 +01:00
|
|
|
{
|
2019-04-02 16:54:14 +02:00
|
|
|
this.setCouleur(couleur);
|
|
|
|
this.lettre = l;
|
2019-04-02 17:38:04 +02:00
|
|
|
this.emplacement.setEmplacement(X, Y);
|
|
|
|
this.depart.setEmplacement(X, Y);
|
2019-03-20 14:14:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// gets & sets
|
|
|
|
|
|
|
|
|
|
|
|
public char getLettre() {
|
|
|
|
return lettre;
|
|
|
|
}
|
|
|
|
public void setLettre(char lettre) {
|
|
|
|
this.lettre = lettre;
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////
|
|
|
|
|
|
|
|
public String getEmplacement() {
|
|
|
|
return emplacement;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setEmplacement(String emplacement) {
|
|
|
|
this.emplacement = emplacement;
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////
|
|
|
|
|
|
|
|
public boolean isEnVie() {
|
|
|
|
return enVie;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setEnVie(boolean enVie) {
|
|
|
|
this.enVie = enVie;
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////
|
|
|
|
|
2019-04-02 16:54:14 +02:00
|
|
|
public boolean isCouleur() {
|
2019-03-20 14:14:08 +01:00
|
|
|
return couleur;
|
|
|
|
}
|
|
|
|
|
2019-04-02 16:54:14 +02:00
|
|
|
public void setCouleur(boolean couleur) {
|
2019-03-20 14:14:08 +01:00
|
|
|
this.couleur = couleur;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|