117 lines
1.7 KiB
Java
Raw Normal View History

2019-03-20 14:14:08 +01:00
package piecesEchiquier;
2019-05-03 18:32:02 +02:00
public class Piece {
2019-03-20 14:14:08 +01:00
private String couleur;
2019-05-04 12:57:53 +02:00
private String lettre = "..";
2019-03-20 14:14:08 +01:00
private boolean enVie = true;
private Position position;
private Position ini;
2019-03-20 14:14:08 +01:00
//constructeur par defaut qui devrait probablement remplacer vide
public Piece()
{
}
// constructeur
public Piece(Position pos)
{
position = pos;
}
2019-03-20 14:14:08 +01:00
2019-05-03 23:53:45 +02:00
public Piece(String couleur,String l, Position pos)
2019-03-20 14:14:08 +01:00
{
2019-05-03 18:32:02 +02:00
this.couleur = couleur;
2019-04-02 16:54:14 +02:00
this.lettre = l;
//this.emplacementIni = emp;
2019-05-03 18:32:02 +02:00
this.position = pos;
this.ini=pos;
2019-03-20 14:14:08 +01:00
}
/* //verifie une eventuelle collision a chaque case
public boolean collision(Case caseArrivee){
return caseArrivee.estVide();
2019-05-03 18:32:02 +02:00
}*/
/*
//check si la case est alliee
public boolean estAllie(Case caseArrivee) {
return possesseur.equals(caseArrivee.getPieceCase().getPossesseur()) ;
}
2019-05-03 18:32:02 +02:00
*/
2019-03-20 14:14:08 +01:00
// gets & sets
2019-05-04 12:57:53 +02:00
public String getLettre() {
2019-03-20 14:14:08 +01:00
return lettre;
}
2019-05-04 12:57:53 +02:00
public void setLettre(String lettre) {
2019-03-20 14:14:08 +01:00
this.lettre = lettre;
}
////////////
/*
2019-05-03 18:32:02 +02:00
public String getEmplacement() {
2019-03-20 14:14:08 +01:00
return emplacement;
}
2019-05-03 18:32:02 +02:00
public void setEmplacement(String emplacement) {
2019-03-20 14:14:08 +01:00
this.emplacement = emplacement;
}
*/
2019-03-20 14:14:08 +01:00
///////////
public boolean isEnVie() {
return enVie;
}
public void setEnVie(boolean enVie) {
this.enVie = enVie;
}
///////////
2019-05-03 18:32:02 +02:00
public String getCouleur() {
2019-03-20 14:14:08 +01:00
return couleur;
}
2019-05-03 18:32:02 +02:00
public void setCouleur(String couleur) {
2019-03-20 14:14:08 +01:00
this.couleur = couleur;
}
2019-05-03 18:32:02 +02:00
public Position getPosition() {
return position;
}
public void setPosition(Position position) {
this.position = position;
}
public Position getIni() {
return ini;
}
public void setIni(Position ini) {
this.ini = ini;
}
2019-05-03 18:32:02 +02:00
public boolean deplacable(Piece p)
{
return true;
}
2019-03-20 14:14:08 +01:00
}