-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCase.java
More file actions
31 lines (26 loc) · 689 Bytes
/
Case.java
File metadata and controls
31 lines (26 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import javax.swing.*;
/*
* Classe Case : représente une case de la grille
* @author BOULLIER Arthur
* @author GONIN-SAGET Allan
*/
public class Case extends JButton{
Character etat = null;
Integer idCase;
static Integer compteur = 0;
Case(){
this.idCase = compteur;
compteur++;
}
public boolean identiques(Case c2){
if(this.etat == null || c2.etat == null)return false;
if(this.etat.equals(c2.etat))return true;
return false;
}
public void changeCarac(Character c){
if(c==null)return;
this.etat = c;
//System.out.println("carac: "+c);
this.setText(c.toString());
}
}