From a978829b7b4b261eec7cc9284916bad595bb01bd Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 9 May 2019 11:08:09 +0200 Subject: [PATCH] force push --- src/piecesEchiquier/Fou.java | 17 ----------------- src/piecesEchiquier/Piece.java | 4 +--- src/piecesEchiquier/Tour.java | 27 +-------------------------- 3 files changed, 2 insertions(+), 46 deletions(-) diff --git a/src/piecesEchiquier/Fou.java b/src/piecesEchiquier/Fou.java index 01aa863..631d6be 100755 --- a/src/piecesEchiquier/Fou.java +++ b/src/piecesEchiquier/Fou.java @@ -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; - } - } diff --git a/src/piecesEchiquier/Piece.java b/src/piecesEchiquier/Piece.java index f85d3db..3067cbb 100755 --- a/src/piecesEchiquier/Piece.java +++ b/src/piecesEchiquier/Piece.java @@ -1,6 +1,6 @@ package piecesEchiquier; -public abstract class Piece { +public class Piece { private String couleur; @@ -47,8 +47,6 @@ public abstract class Piece { } return verif; } - - public abstract boolean[][] deplacable(Echiquier e,Piece p); /* //verifie une eventuelle collision a chaque case diff --git a/src/piecesEchiquier/Tour.java b/src/piecesEchiquier/Tour.java index c314d9b..b472523 100755 --- a/src/piecesEchiquier/Tour.java +++ b/src/piecesEchiquier/Tour.java @@ -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