diff --git a/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java b/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java index 65e8704..1471fa8 100644 --- a/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java +++ b/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java @@ -66,7 +66,8 @@ public class Grille extends JPanel implements Observer{ protected void addPlayerPawn(int column, int row, int player) { Color c = player == Constants.PLAYER_ONE ? Constants.PLAYER_ONE_COLOR : Constants.PLAYER_TWO_COLOR; - this.grille[column][row] = new Pion(player); + this.grille[column][row].setPlayer(player); + this.grille[column][row].repaint(); } } \ No newline at end of file diff --git a/projetAgile/src/fr/iutfbleau/projetAgile/View/Pion.java b/projetAgile/src/fr/iutfbleau/projetAgile/View/Pion.java index d8ee795..8814ea4 100644 --- a/projetAgile/src/fr/iutfbleau/projetAgile/View/Pion.java +++ b/projetAgile/src/fr/iutfbleau/projetAgile/View/Pion.java @@ -27,6 +27,10 @@ public class Pion extends JComponent{ this.player = player; } + public void setPlayer(int player) { + this.player = player; + } + @Override protected void paintComponent(Graphics g) { Graphics g2 = g.create();