Class MineCore

java.lang.Object
  |
  +--MineCore
Direct Known Subclasses:
Gitter

public class MineCore
extends java.lang.Object


Constructor Summary
MineCore()
          default constructor not used.
 
Method Summary
 void callLogicOnMouseEvent(java.awt.event.MouseEvent e, int logicOpr)
          Helper method for mouseevents this routine act as a pipeline betwen logic engine and graphic it handles needed coordinate transformation.
 javax.media.j3d.BranchGroup createSceneGraph(javax.media.j3d.Canvas3D canvas)
          This is the main routine that builds up the DAG tree which holds all the objects used in the scene it sets up mouse listening, picking and light.
 int getGitterSize()
          Gets the size of gitter.
 int getNumOfMines()
          Gets the amount of mines for current game see setNumOfMines(int)
 void init()
           
 void loadBackground(com.sun.j3d.utils.image.TextureLoader t)
           
 void loadBackgroundMusic(javax.media.j3d.MediaContainer m)
          Deprecated. As of v1.2, replaced by loadSounds(Hashtable)
 void loadSounds(java.util.Hashtable t)
          Load sounds used in scene
 void loadTextures(java.util.Hashtable t)
          Load Textures used in gitter
 void loadTextures(javax.media.j3d.Texture[] t)
          Deprecated. As of v1.2, replaced by loadTextures(Hashtable)
 void reset()
           
 void resetChangeSize()
           
 void run()
           
 void setGitterSize(int gSize)
          Sets the size of gitter.
 void setMessageOff(javax.media.j3d.BranchGroup b)
          Sets message to be hidden
 void setMessageOn(javax.media.j3d.BranchGroup b)
          Sets message to be shown
 void setMessageText(javax.media.j3d.BranchGroup b, float scale, javax.vecmath.Vector3f pos, java.lang.String text)
          Sets the text to be shown
 void setNumOfMines(int mSize)
          Sets the amount of mines for current game
 void setTime(javax.vecmath.Vector3f pos, java.lang.String text)
          Sets the time text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MineCore

public MineCore()
default constructor not used.

Method Detail

createSceneGraph

public javax.media.j3d.BranchGroup createSceneGraph(javax.media.j3d.Canvas3D canvas)
This is the main routine that builds up the DAG tree which holds all the objects used in the scene it sets up mouse listening, picking and light.


callLogicOnMouseEvent

public void callLogicOnMouseEvent(java.awt.event.MouseEvent e,
                                  int logicOpr)
Helper method for mouseevents this routine act as a pipeline betwen logic engine and graphic it handles needed coordinate transformation. This is needed because logic engine works with discrete coordinates while the graphic uses floats to represent coordinates in space.


init

public void init()

run

public void run()

reset

public void reset()

resetChangeSize

public void resetChangeSize()

loadBackground

public void loadBackground(com.sun.j3d.utils.image.TextureLoader t)

loadTextures

public void loadTextures(javax.media.j3d.Texture[] t)
Deprecated. As of v1.2, replaced by loadTextures(Hashtable)

Load Textures used in gitter

Parameters:
t - textures used in gitter

loadTextures

public void loadTextures(java.util.Hashtable t)
Load Textures used in gitter

Parameters:
t - containing Texture objects

loadBackgroundMusic

public void loadBackgroundMusic(javax.media.j3d.MediaContainer m)
Deprecated. As of v1.2, replaced by loadSounds(Hashtable)

Loads the Background music

Parameters:
m - background music

loadSounds

public void loadSounds(java.util.Hashtable t)
Load sounds used in scene

Parameters:
t - containing MediaContainer objects

setGitterSize

public void setGitterSize(int gSize)
Sets the size of gitter. (size)^3 is the total amount of cubes in gitter

Parameters:
gSize -

getGitterSize

public int getGitterSize()
Gets the size of gitter. see setGitterSize(int)


setNumOfMines

public void setNumOfMines(int mSize)
Sets the amount of mines for current game

Parameters:
mSize -

getNumOfMines

public int getNumOfMines()
Gets the amount of mines for current game see setNumOfMines(int)


setMessageText

public void setMessageText(javax.media.j3d.BranchGroup b,
                           float scale,
                           javax.vecmath.Vector3f pos,
                           java.lang.String text)
Sets the text to be shown

Parameters:
b - root of tree
scale - Scaling the size on the text
pos - Position of text
text - The text to be shown

setMessageOn

public void setMessageOn(javax.media.j3d.BranchGroup b)
Sets message to be shown

Parameters:
b - root tree

setMessageOff

public void setMessageOff(javax.media.j3d.BranchGroup b)
Sets message to be hidden

Parameters:
b - root tree

setTime

public void setTime(javax.vecmath.Vector3f pos,
                    java.lang.String text)
Sets the time text

Parameters:
pos - Position where time text should appear.
text - What time text to be shown.