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 32
|
public class Case_A extends JButton {
/**
* @param args
* coordonnée de la case x et y
* un string pour le type de terrain
*/
private int x;
private int y;
private int typeTerrain;
public final static int PLAINE = 0;
public final static int RIVIERE = 1;
public final static int MONTAGNE = 2;
public final static int FORET = 3;
//Tableaux avec les icones
public static final ImageIcon i_herbe = new ImageIcon("icones\\herbe\\herbe.gif");
public static final ImageIcon [] i_eau = {new ImageIcon("icones\\eau\\eau.gif"),new ImageIcon("icones\\eau\\eau1.gif"),new ImageIcon("icones\\eau\\eau2.gif"),new ImageIcon("icones\\eau\\eau3.gif"),new ImageIcon("icones\\eau\\eau4.gif"),new ImageIcon("icones\\eau\\coin1.gif"),new ImageIcon("icones\\eau\\coin2.gif"),new ImageIcon("icones\\eau\\coin3.gif"),new ImageIcon("icones\\eau\\droit1.gif"),new ImageIcon("icones\\eau\\droit2.gif"),new ImageIcon("icones\\eau\\etang.gif"),new ImageIcon("icones\\eau\\coinLac1.gif"),new ImageIcon("icones\\eau\\coinLac2.gif"),new ImageIcon("icones\\eau\\coinLac3.gif"),new ImageIcon("icones\\eau\\coinLac4.gif"),};
public static final ImageIcon [] i_montagne = { new ImageIcon("icones\\montagne\\montagne.gif"),new ImageIcon("icones\\montagne\\montagne1.gif"),new ImageIcon("icones\\montagne\\montagne2.gif"),new ImageIcon("icones\\montagne\\montagne3.gif"),new ImageIcon("icones\\montagne\\montagne4.gif"),new ImageIcon("icones\\montagne\\coin1.gif"),new ImageIcon("icones\\montagne\\coin2.gif"),new ImageIcon("icones\\montagne\\coin3.gif"),new ImageIcon("icones\\montagne\\coin4.gif")};
/**
* constructeur de la case
*/
public Case_A(int X, int Y, int type) {
super(i_herbe);
x=X;
y=Y;
typeTerrain=type;
} |