force push
This commit is contained in:
@ -6,21 +6,4 @@ public class Fou extends Piece {
|
||||
{//c = couleur, n = nom, pos = position
|
||||
super(c,n,pos);
|
||||
}
|
||||
|
||||
public boolean[][] deplacable(Echiquier e,Piece p) {
|
||||
boolean[][] deplacementsInherentsPiece = new boolean[8][8];
|
||||
Position position = this.getPosition();
|
||||
int x = position.getX();
|
||||
int y = position.getY();
|
||||
|
||||
for(int i=x; i<8; i++) {
|
||||
deplacementsInherentsPiece[i][y]=true;
|
||||
}
|
||||
for(int j=0; j<8; j++) {
|
||||
deplacementsInherentsPiece[x][j]=true;
|
||||
}
|
||||
deplacementsInherentsPiece[x][y]=false;
|
||||
return deplacementsInherentsPiece;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package piecesEchiquier;
|
||||
|
||||
public abstract class Piece {
|
||||
public class Piece {
|
||||
|
||||
|
||||
private String couleur;
|
||||
@ -48,8 +48,6 @@ public abstract class Piece {
|
||||
return verif;
|
||||
}
|
||||
|
||||
public abstract boolean[][] deplacable(Echiquier e,Piece p);
|
||||
|
||||
|
||||
/* //verifie une eventuelle collision a chaque case
|
||||
public boolean collision(Case caseArrivee){
|
||||
|
@ -7,34 +7,9 @@ public class Tour extends Piece {
|
||||
super(couleur,l,pos);
|
||||
}
|
||||
|
||||
public boolean aBouge()
|
||||
{
|
||||
if(this.getIni() != this.getPosition())
|
||||
{
|
||||
verif=true;
|
||||
}
|
||||
if(this.getIni() == this.getPosition() && verif == false)
|
||||
{
|
||||
verif=false;
|
||||
}
|
||||
return verif;
|
||||
}
|
||||
|
||||
public boolean deplacable(Echiquier e,Piece p)
|
||||
{
|
||||
/*boolean[][] deplacementsInherentsPiece = new boolean[8][8];
|
||||
Position position = this.getPosition();
|
||||
int x = position.getX();
|
||||
int y = position.getY();
|
||||
|
||||
for(int i=x; i<8; i++) {
|
||||
deplacementsInherentsPiece[i][y]=true;
|
||||
}
|
||||
for(int j=0; j<8; j++) {
|
||||
deplacementsInherentsPiece[x][j]=true;
|
||||
}
|
||||
deplacementsInherentsPiece[x][y]=false;
|
||||
return deplacementsInherentsPiece;*/
|
||||
if(p.getPosition().getX() == this.getPosition().getX()) // verification les 2 pieces sont sur la meme colonne
|
||||
{
|
||||
if (p.getPosition().getY() > this.getPosition().getY()) // Test si la 2 eme piece est au dessus de la 1ere
|
||||
|
Reference in New Issue
Block a user