update class Fou.java
ajout méthode a bouge
This commit is contained in:
parent
8f6df580b0
commit
5771582144
@ -2,10 +2,25 @@ package piecesEchiquier;
|
||||
|
||||
public class Fou extends Piece {
|
||||
|
||||
public Fou(String c,String l, Position pos)
|
||||
{
|
||||
super(c,l,pos);
|
||||
public Fou(String c,String n, Position pos)
|
||||
{//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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user