Listener mais faudrait créer notre listener
This commit is contained in:
parent
521be6a04a
commit
39b43c0454
@ -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();
|
||||
}
|
||||
|
||||
}
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user