From 3b22db3cd36d9338aa69e6874b9cff61c2b22516 Mon Sep 17 00:00:00 2001 From: Anthony Date: Tue, 23 Apr 2019 17:30:04 +0200 Subject: [PATCH] Update Constructor Title update title on : - Cavalier.java - Fou.java - Piece.java - Pion.java - Reine.java - Roi.java - Tour.java --- src/piecesEchiquier/Cavalier.java | 4 ++-- src/piecesEchiquier/Fou.java | 5 +++-- src/piecesEchiquier/Piece.java | 10 +++++----- src/piecesEchiquier/Pion.java | 5 +++-- src/piecesEchiquier/Reine.java | 5 +++-- src/piecesEchiquier/Roi.java | 9 +++++---- src/piecesEchiquier/Tour.java | 6 +++--- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/piecesEchiquier/Cavalier.java b/src/piecesEchiquier/Cavalier.java index 70b27b5..8b79faf 100755 --- a/src/piecesEchiquier/Cavalier.java +++ b/src/piecesEchiquier/Cavalier.java @@ -2,8 +2,8 @@ package piecesEchiquier; public class Cavalier extends Piece { - public Cavalier(boolean c, String emp,char l) + public Cavalier(boolean couleur,char l, int x, int y) { - super(c, emp,l); + super(couleur, l, x, y); } } diff --git a/src/piecesEchiquier/Fou.java b/src/piecesEchiquier/Fou.java index 280b496..1eee235 100755 --- a/src/piecesEchiquier/Fou.java +++ b/src/piecesEchiquier/Fou.java @@ -2,8 +2,9 @@ package piecesEchiquier; public class Fou extends Piece { - public Fou(boolean c, String emp,char l) { - super(c, emp,l); + public Fou(boolean couleur,char l, int x, int y) + { + super(couleur, l, x, y); } diff --git a/src/piecesEchiquier/Piece.java b/src/piecesEchiquier/Piece.java index 8b8fc25..25cace8 100755 --- a/src/piecesEchiquier/Piece.java +++ b/src/piecesEchiquier/Piece.java @@ -22,12 +22,12 @@ public class Piece { // constructeur - public Piece(boolean couleur,char l, int X, int Y) + public Piece(boolean couleur,char l, int x, int y) { this.setCouleur(couleur); this.lettre = l; - this.emplacement.setEmplacement(X, Y); - this.depart.setEmplacement(X, Y); + this.emplacement = new Position (x, y); + this.depart = new Position(x, y); } // gets & sets @@ -42,11 +42,11 @@ public class Piece { //////////// - public String getEmplacement() { + public Position getEmplacement() { return emplacement; } - public void setEmplacement(String emplacement) { + public void setEmplacement(Position emplacement) { this.emplacement = emplacement; } diff --git a/src/piecesEchiquier/Pion.java b/src/piecesEchiquier/Pion.java index fbb0bbb..e2d3820 100755 --- a/src/piecesEchiquier/Pion.java +++ b/src/piecesEchiquier/Pion.java @@ -2,8 +2,9 @@ package piecesEchiquier; public class Pion extends Piece { - public Pion(String c, String emp,char l) { - super(c,emp,l); + public Pion(boolean couleur,char l, int x, int y) + { + super(couleur, l, x, y); } diff --git a/src/piecesEchiquier/Reine.java b/src/piecesEchiquier/Reine.java index c1ab3ea..7d0349e 100755 --- a/src/piecesEchiquier/Reine.java +++ b/src/piecesEchiquier/Reine.java @@ -2,7 +2,8 @@ package piecesEchiquier; public class Reine extends Piece { - public Reine(boolean c, String emp,char l) { - super(c, emp,l); + public Reine(boolean couleur,char l, int x, int y) + { + super(couleur, l, x, y); } } diff --git a/src/piecesEchiquier/Roi.java b/src/piecesEchiquier/Roi.java index 3c68073..da7fe04 100755 --- a/src/piecesEchiquier/Roi.java +++ b/src/piecesEchiquier/Roi.java @@ -2,13 +2,14 @@ package piecesEchiquier; public class Roi extends Piece { - public Roi(String c, String emp, char l) { - super(c, emp,l); + public Roi(boolean couleur,char l, int x, int y) + { + super(couleur, l, x, y); } public void enEchec() { - int[][] positionCourante; - positionCourante=Piece.getPositionCourante(); + Position positionCourante; + positionCourante= super.getEmplacement(); } diff --git a/src/piecesEchiquier/Tour.java b/src/piecesEchiquier/Tour.java index 7fbd2bb..3515313 100755 --- a/src/piecesEchiquier/Tour.java +++ b/src/piecesEchiquier/Tour.java @@ -2,9 +2,9 @@ package piecesEchiquier; public class Tour extends Piece { - - public Tour(String c, String emp, char l) { - super(c, emp,l); + public Tour(boolean couleur,char l, int x, int y) + { + super(couleur, l, x, y); } }