graphics
Interface GameMode

All Known Implementing Classes:
EliminationMode, MeasureUpMode

public interface GameMode

This interface defines what methods need to be implemented to incorporate new game modes into the game

Author:
Terje

Method Summary
 boolean displayFeedback(javax.media.opengl.GLAutoDrawable glDrawable, boolean isLastQuestion)
          Displays the actual feedback graphics.
 boolean displayRoundIntro(javax.media.opengl.GLAutoDrawable glDrawable)
          Displays the actual intro to the following round.
 void initFeedback(QuestionGraphics question, Respondent[] respondents, javax.media.opengl.GLAutoDrawable glDrawable)
          Method is called prior to every time feedback is shown.
 void initMode(com.sun.opengl.util.j2d.TextRenderer textRenderer)
          Calld before starting to display a new mode.
 void initRoundIntro()
          Method is called prior to every round.
 void nextStep()
          This method is called when the user wishes to conticue to the next step.
 void resetFeedBack(javax.media.opengl.GLAutoDrawable glDrawable)
          Called once after displayFeedback returns.
 void setRoundRespondents(Respondent[] respondents)
          This method is called every time a feedbakc from the server is received.
 

Method Detail

initMode

void initMode(com.sun.opengl.util.j2d.TextRenderer textRenderer)
Calld before starting to display a new mode. Can be used to load textures, initialize counters and reset parameters.

Parameters:
textRenderer - a TextRenderer object can be optionally provided for use in later methods.

initRoundIntro

void initRoundIntro()
Method is called prior to every round. Optional implementation of texture loading, counter reset or variable implementation can be added in this method.


displayRoundIntro

boolean displayRoundIntro(javax.media.opengl.GLAutoDrawable glDrawable)
Displays the actual intro to the following round. The method is continuously called per frame until it returns false. The developper may freely use the previously initialized textRenderer or draw as he wishes on the glDrawable object.

Parameters:
glDrawable -
Returns:

initFeedback

void initFeedback(QuestionGraphics question,
                  Respondent[] respondents,
                  javax.media.opengl.GLAutoDrawable glDrawable)
Method is called prior to every time feedback is shown. Optional implementation of texture loading, counter reset or variable implementation can be added in this method.


displayFeedback

boolean displayFeedback(javax.media.opengl.GLAutoDrawable glDrawable,
                        boolean isLastQuestion)
Displays the actual feedback graphics. The method is continuously called per frame until it returns false. The developper may freely use the previously initialized textRenderer or draw as he wishes on the glDrawable object.

Parameters:
glDrawable -
isLastQuestion - boolean telling wether the recently posed question is the last in a round.
Returns:

resetFeedBack

void resetFeedBack(javax.media.opengl.GLAutoDrawable glDrawable)
Called once after displayFeedback returns. The method is intended for clenup and resetting of variables after the feedback graphics is displayed.

Parameters:
glDrawable -

setRoundRespondents

void setRoundRespondents(Respondent[] respondents)
This method is called every time a feedbakc from the server is received. Thei mplementation of this method is meant to update the internal model of the respondents and their game mode specific response number.

Parameters:
respondents - Array of Respondent object containing their game mode specific integer e.g. last answer.

nextStep

void nextStep()
This method is called when the user wishes to conticue to the next step. Normally this should result in the dispalyFeedback method to return.