-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGame.java
More file actions
58 lines (47 loc) · 1006 Bytes
/
Game.java
File metadata and controls
58 lines (47 loc) · 1006 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
public class Game {
private int id;
private Gameboard round1Board;
private Gameboard round2Board;
private Question FJquestion;
public Game(Gameboard b1, Gameboard b2, int x, Question q1) {
round1Board = b1;
round2Board = b2;
id = x;
FJquestion = q1;
}
public void writeGameToDatabase() {
//TODO: implement with Justin
}
public void cleanUp() {
for (Question q : round1Board.getQuestions()) {
q.cleanUp();
}
for (Category c : round1Board.getCategories()) {
c.cleanUp();
}
for (Question q : round2Board.getQuestions()) {
q.cleanUp();
}
for (Category c : round2Board.getCategories()) {
c.cleanUp();
}
if (hasFinalJeopardy()) {
FJquestion.cleanUp();
}
}
public int getId() {
return id;
}
public Gameboard getGame1() {
return round1Board;
}
public Gameboard getGame2() {
return round2Board;
}
public boolean hasFinalJeopardy() {
return FJquestion != null;
}
public Question getFJquestion() {
return FJquestion;
}
}