|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlecturequiz.server.gamemodes.AbstractGameMode
lecturequiz.server.gamemodes.PlainGame
public class PlainGame
Field Summary | |
---|---|
protected java.util.HashMap<User,java.lang.Integer> |
currentAnswers
|
protected java.util.ArrayList<java.util.HashMap<User,java.lang.Integer>> |
statistics
|
Fields inherited from class lecturequiz.server.gamemodes.AbstractGameMode |
---|
canJoinStarted, currentQuestion, currentQuestionIndex, id, name, owner, players, questionStartTime, quiz, quizCode, quizHasEnded, started |
Constructor Summary | |
---|---|
PlainGame(Quiz quiz,
java.lang.String quizCode)
Constructor. |
Method Summary | |
---|---|
java.util.ArrayList<StatisticsEntry> |
getOverallStatistics()
Returns the overall statistics for the entire game. |
java.util.ArrayList<StatisticsEntry> |
getOverallStatistics(User user)
Returns the overall statistics for the entire game for a specified user. |
java.util.ArrayList<StatisticsEntry> |
getQuestionStatistics()
Returns the statistics for the last question for the all the users in the quiz. |
java.util.ArrayList<StatisticsEntry> |
getQuestionStatistics(User user)
Returns the statistics for the last question for the requested user. |
int |
receiveAnswer(int answerID,
User player)
Receives an answer from a player and registers it. |
void |
removeUser(User user)
Remove a user from the game |
boolean |
startNextQuestion()
Starts the next question in the quiz |
void |
startQuiz()
Starts the quiz. |
Methods inherited from class lecturequiz.server.gamemodes.AbstractGameMode |
---|
canJoinStarted, getCurrentQuestion, getGameStatus, getId, getName, getNumberOfPlayers, getOwner, getPlayers, getQuizCode, getTimeLeft, hasQuestionTimedOut, hasQuizEnded, isStarted, joinGame, setOwner, setParameters, timeoutReached |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap<User,java.lang.Integer> currentAnswers
protected java.util.ArrayList<java.util.HashMap<User,java.lang.Integer>> statistics
Constructor Detail |
---|
public PlainGame(Quiz quiz, java.lang.String quizCode)
quiz
- Quiz the game will use.quizCode
- Quiz code of the game.Method Detail |
---|
public void startQuiz()
startQuiz
in class AbstractGameMode
public boolean startNextQuestion()
startNextQuestion
in class AbstractGameMode
public int receiveAnswer(int answerID, User player)
AbstractGameMode
receiveAnswer
in class AbstractGameMode
public void removeUser(User user)
AbstractGameMode
removeUser
in class AbstractGameMode
user
- user to removepublic java.util.ArrayList<StatisticsEntry> getQuestionStatistics()
getQuestionStatistics
in class AbstractGameMode
public java.util.ArrayList<StatisticsEntry> getQuestionStatistics(User user)
getQuestionStatistics
in class AbstractGameMode
user
- User to get statistics for, pass null for general statistics.
public java.util.ArrayList<StatisticsEntry> getOverallStatistics()
getOverallStatistics
in class AbstractGameMode
public java.util.ArrayList<StatisticsEntry> getOverallStatistics(User user)
getOverallStatistics
in class AbstractGameMode
user
- The user to get statistics for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |