-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMinesweeperIcons.java
More file actions
38 lines (31 loc) · 966 Bytes
/
Copy pathMinesweeperIcons.java
File metadata and controls
38 lines (31 loc) · 966 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
32
33
34
35
36
37
38
import javax.swing.ImageIcon;
public class MinesweeperIcons {
private ImageIcon[] icon = null;
//Icon constants
public static final int QUESTION = 0;
public static final int ONE = 1;
public static final int TWO = 2;
public static final int THREE = 3;
public static final int FOUR = 4;
public static final int FIVE = 5;
public static final int SIX = 6;
public static final int SEVEN = 7;
public static final int EIGHT = 8;
public static final int FLAG = 9;
public static final int MINESWEEPER = 10;
public static final int BOMB = 11;
public static final int NULL = 12;
public MinesweeperIcons(){
loadIcons();
}
private void loadIcons(){
int numberOfIcons = NULL;
icon = new ImageIcon[numberOfIcons];
for (int counter = 0; counter < numberOfIcons; counter++){
icon[counter] = new ImageIcon(getClass().getResource("images/"+ counter + ".png"));
}
}
public ImageIcon getIcon(int iconNumber){
return icon[iconNumber];
}
}