graphics
Class EliminationMode

java.lang.Object
  extended by graphics.EliminationMode
All Implemented Interfaces:
GameMode

public class EliminationMode
extends Object
implements GameMode

Draws the feedback graphics when Elimination mode is enabled.

Author:
Terje

Field Summary
(package private)  TextureReader.Texture buddyBlinkTexture
           
(package private)  float buddyGap
           
(package private)  TextureReader.Texture buddyKilledTexture
           
(package private)  ArrayList<Buddy> buddyList
           
(package private)  Buddy[][] buddyMatrix
           
(package private)  TextureReader.Texture buddyTexture
           
private  boolean continueRequested
           
private  boolean done
           
private  javax.media.opengl.glu.GLU glu
           
private  com.sun.opengl.util.j2d.TextRenderer hiresTextRenderer
           
private  int killcounter
           
private  com.sun.opengl.util.j2d.TextRenderer loResTextRenderer
           
private  boolean onlyWinnersLeft
           
private  ArrayList<String> rightBuddies
           
private  boolean rotateback
           
private  float rotation
           
private  String roundFeedback
           
private  long roundInfoStartTime
           
private  Respondent[] roundRespondents
           
private  AudioSample shot
           
(package private)  int size
           
private  boolean startKilling
           
(package private)  float startPoint
           
private  com.sun.opengl.util.j2d.TextRenderer textRenderer
           
private  int textureholder
           
private  long timerStart
           
(package private)  TextureReader.Texture winnerTexture
           
private  ArrayList<String> wrongBuddies
           
 
Constructor Summary
EliminationMode()
          Elimination mode initialization
 
Method Summary
 boolean displayFeedback(javax.media.opengl.GLAutoDrawable glDrawable, boolean isLastQuestion)
          implemented from GameMode
 boolean displayRoundIntro(javax.media.opengl.GLAutoDrawable glDrawable)
          Implemented from GameMode
 void initFeedback(QuestionGraphics question, Respondent[] buddies, 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()
          Implemented from GameMode
 boolean isDone()
          Returns true if there is nothing more to draw.
private  void kill(String userName)
          kills the avatar with the provided username
private  void makeRGBTexture(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, TextureReader.Texture img, int target, boolean mipmapped)
          Prepares a texture for drawing.
 void nextStep()
          Implemented from GameMode
 void resetFeedBack(javax.media.opengl.GLAutoDrawable glDrawable)
          Implemented from GameMode
 void setRoundRespondents(Respondent[] respondents)
          Implemented from GameMode.
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

glu

private javax.media.opengl.glu.GLU glu

buddyList

ArrayList<Buddy> buddyList

buddyMatrix

Buddy[][] buddyMatrix

size

int size

buddyGap

float buddyGap

startPoint

float startPoint

done

private boolean done

shot

private AudioSample shot

timerStart

private long timerStart

textRenderer

private com.sun.opengl.util.j2d.TextRenderer textRenderer

loResTextRenderer

private com.sun.opengl.util.j2d.TextRenderer loResTextRenderer

hiresTextRenderer

private com.sun.opengl.util.j2d.TextRenderer hiresTextRenderer

textureholder

private int textureholder

buddyTexture

TextureReader.Texture buddyTexture

rightBuddies

private ArrayList<String> rightBuddies

wrongBuddies

private ArrayList<String> wrongBuddies

onlyWinnersLeft

private boolean onlyWinnersLeft

roundInfoStartTime

private long roundInfoStartTime

rotation

private float rotation

startKilling

private boolean startKilling

killcounter

private int killcounter

buddyBlinkTexture

TextureReader.Texture buddyBlinkTexture

buddyKilledTexture

TextureReader.Texture buddyKilledTexture

winnerTexture

TextureReader.Texture winnerTexture

roundFeedback

private String roundFeedback

roundRespondents

private Respondent[] roundRespondents

continueRequested

private boolean continueRequested

rotateback

private boolean rotateback
Constructor Detail

EliminationMode

public EliminationMode()
Elimination mode initialization

Method Detail

kill

private void kill(String userName)
kills the avatar with the provided username

Parameters:
userName -

isDone

public boolean isDone()
Returns true if there is nothing more to draw.

Returns:

update

public void update()

displayFeedback

public boolean displayFeedback(javax.media.opengl.GLAutoDrawable glDrawable,
                               boolean isLastQuestion)
implemented from GameMode

Specified by:
displayFeedback in interface GameMode
isLastQuestion - boolean telling wether the recently posed question is the last in a round.
Returns:

displayRoundIntro

public boolean displayRoundIntro(javax.media.opengl.GLAutoDrawable glDrawable)
Implemented from GameMode

Specified by:
displayRoundIntro in interface GameMode
Returns:

initFeedback

public void initFeedback(QuestionGraphics question,
                         Respondent[] buddies,
                         javax.media.opengl.GLAutoDrawable glDrawable)
Description copied from interface: GameMode
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.

Specified by:
initFeedback in interface GameMode

initMode

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

Specified by:
initMode in interface GameMode
Parameters:
textRenderer - a TextRenderer object can be optionally provided for use in later methods.

initRoundIntro

public void initRoundIntro()
Implemented from GameMode

Specified by:
initRoundIntro in interface GameMode

resetFeedBack

public void resetFeedBack(javax.media.opengl.GLAutoDrawable glDrawable)
Implemented from GameMode

Specified by:
resetFeedBack in interface GameMode

makeRGBTexture

private void makeRGBTexture(javax.media.opengl.GL gl,
                            javax.media.opengl.glu.GLU glu,
                            TextureReader.Texture img,
                            int target,
                            boolean mipmapped)
Prepares a texture for drawing.

Parameters:
gl -
glu -
img -
target -
mipmapped -

setRoundRespondents

public void setRoundRespondents(Respondent[] respondents)
Implemented from GameMode. EMpty method as theres is no use tp update the respondents.

Specified by:
setRoundRespondents in interface GameMode
Parameters:
respondents - Array of Respondent object containing their game mode specific integer e.g. last answer.

nextStep

public void nextStep()
Implemented from GameMode

Specified by:
nextStep in interface GameMode