-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestion.java
98 lines (89 loc) · 2.47 KB
/
Question.java
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
89
90
91
92
93
94
95
96
97
98
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.greenninja.game;
import java.util.concurrent.TimeUnit;
/**
*
* @author Abhinav Pothuri
*/
public class Question
{
String question;
String answer;
Quarter quarter;
Question(String tossup, String answer, Quarter quarter)
{
this.question = tossup;
this.answer = answer;
this.quarter = quarter;
}
void play(boolean inProgress)
{
while(inProgress)
{
if(quarter == Quarter.QUARTER1)
{
read(question, inProgress);
if(inProgress)
{
read("time is up", inProgress);
inProgress = false;
}
}
else if(quarter == Quarter.QUARTER2)
{
read(question, inProgress);
Utility.wait(3);
if(inProgress)
{
read("time is up", inProgress);
inProgress = false;
}
}
else if(quarter == Quarter.QUARTER3)
{
//special stuff
}
else if(quarter == Quarter.QUARTER4)
{
}
else if(quarter == Quarter.BEE)
{
read(question, inProgress);
if(inProgress)
{
read("time is up", inProgress);
inProgress = false;
}
}
else if(quarter == Quarter.BONUS)
{
read(question, inProgress);
if(inProgress)
{
read("time is up", inProgress);
inProgress = false;
}
}
}
}
boolean isCorrect(String playerAnswer)
{
//check if they're close enough
boolean isCorrect = playerAnswer.equalsIgnoreCase(answer);
return isCorrect;
}
void read(String str, boolean inProgress)
{
while(inProgress)
{
//tts
}
}
public Power getPower()
{
return Power.NORMAL;
}
}