-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseData.java
More file actions
executable file
·88 lines (73 loc) · 2.12 KB
/
BaseData.java
File metadata and controls
executable file
·88 lines (73 loc) · 2.12 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package mastermind;
class BaseData {
private int maxColourNum; // how many number we can guess
private int maxColourValue; // default the Max Number we can Guess, such as 1-6/1-7/1-8
private int minColourValue; // default the Min Number we can Guesss, such as 2-6/3-6/4-6
private String correctAns; // set correcr Answer
private int maxGuesstimes; // How many times we can guess
private int guessTimes;
private int black; // Stored Black & White
private int white;
// Constructor
BaseData() {
this.maxColourNum = 4;
this.maxColourValue = 6;
this.minColourValue = 1;
this.correctAns = "";
this.maxGuesstimes = 10;
this.guessTimes = 1;
this.black = 0;
this.white = 0;
}
// Constructor
BaseData(
int maxColourNum, int maxColourValue, int minColourValue,
String correctAns, int maxGuesstimes, int guessTimes,
int black, int white
) {
this.maxColourNum = maxColourNum;
this.maxColourValue = maxColourValue;
this.minColourValue = minColourValue;
this.correctAns = correctAns;
this.maxGuesstimes = maxGuesstimes;
this.guessTimes = guessTimes;
this.black = black;
this.white = white;
}
public int getMaxColourNum() {
return maxColourNum;
}
public int getMaxColourValue() {
return maxColourValue;
}
public int getMinColourValue() {
return minColourValue;
}
public int getMaxGuesstimes() {
return maxGuesstimes;
}
public void setGuessTimes(int guessTimes) {
this.guessTimes = guessTimes;
}
public int getGuessTimes() {
return guessTimes;
}
public void setBlack(int black) {
this.black = black;
}
public int getBlack() {
return black;
}
public void setWhite(int white) {
this.white = white;
}
public int getWhite() {
return white;
}
public void setCorrectAns(String correctAns) {
this.correctAns = correctAns;
}
public String getCorrectAns() {
return correctAns;
}
}