-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMPLevels.java
More file actions
62 lines (62 loc) · 1.57 KB
/
MPLevels.java
File metadata and controls
62 lines (62 loc) · 1.57 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
//Medarametla
//Layout to store all the Level objects and their private fields such as PixelLocations and AnswerChoices
public class MPLevels implements Level
{
private String myName;
private String[] answerChoices; private int[][] hidePixels = new int[2][4]; int rightAnswer = 0;
public MPLevels(String _name, int[][] _hide) //constructor for all levels
{
myName = _name;
for(int r = 0; r < hidePixels.length; r++)
{
for(int c = 0; c < hidePixels[0].length; c++)
{
hidePixels[r][c] = _hide[r][c];
}
}
}
public String getName()
{
return myName;
}
public void addAnswerChoices(String[] _answerC) //for levels 1-10, add the answerChoices
{
answerChoices = new String[4];
for(int k = 0; k < answerChoices.length; k++)
{
answerChoices[k] = _answerC[k];
}
}
public void setAnswerChoice(String temp, int k)
{
answerChoices[k] = temp;
}
public String[] getAnswerChoice()
{
return answerChoices;
}
public String getAnswerChoice(int index)
{
return answerChoices[index];
}
public int[][] getPixelLocations()
{
return hidePixels;
}
public int getPixelCall(int r, int c)
{
return hidePixels[r][c];
}
public int getNumOfLevels()
{
return 20;
}
public void setRightAnswer(int k)
{
rightAnswer = k;
}
public int getRightAnswer()
{
return rightAnswer;
}
}