org.game.JVirus
Class Matrix

java.lang.Object
  |
  +--org.game.JVirus.Matrix
All Implemented Interfaces:
IFields

public class Matrix
extends java.lang.Object
implements IFields

this class containt the level array. Most variables are public for faster access


Field Summary
static int[] actionTyp
          array with action types.
 int[][] bufferMatrix1
          buffer array for object fall function
 java.awt.Point displayPoint
          start point in the Display
 int levelNumber
          level number in the level list
 char[][] matrix
          level tiles array
 java.lang.String name
          name of level
static int[] scoreTab
          score for every field.
 
Fields inherited from interface org.game.JVirus.IFields
AMD, AT_ACTION, AT_ANIM, AT_BEAM, AT_EAT, AT_EAT_SOUND1, AT_EAT_SOUND2, AT_END, AT_FAll, AT_HOLD, AT_MOVE, AT_PUSH, AT_WALL, BEAM0, BEAM1, BEAM2, BEAM3, BEAM4, BEAM5, BEAM6, BEAM7, BEAM8, BEAM9, BEOS, BLUEGATE, BLUEKEY, DATA1, DATA2, DATA3, DYNS1, DYNS2, DYNS3, DYNS4, DYNT1, DYNT2, DYNT3, DYNT4, EMPTY, END, GREENGATE, GREENKEY, INTEL, LIFE, LINUX, MAC, NOTHING, REDGATE, REDKEY, START, STONE, TREASURE, UNIX, WALL1, WALL2, WALL3, WALL4, WALL5, WINDOWS
 
Constructor Summary
Matrix(java.io.File file)
          Constructor. load the level from file
Matrix(java.io.InputStream is)
          Constructor. load the level from InputStream
Matrix(Matrix copy)
          copy constructor
 
Method Summary
protected  void loadMatrix(java.io.File file)
          load the level from file
protected  void loadMatrix(java.io.InputStream is)
          load the level from InputStream
 java.lang.String matrixToString()
          convert the matrix to string to print it in the console
 java.lang.String toString()
          return the name of this level
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
name of level

displayPoint

public java.awt.Point displayPoint
start point in the Display
See Also:
Display

matrix

public char[][] matrix
level tiles array

bufferMatrix1

public int[][] bufferMatrix1
buffer array for object fall function
See Also:
ActionControl

levelNumber

public int levelNumber
level number in the level list

actionTyp

public static final int[] actionTyp
array with action types. See the AT_* constants int the IFields interface. Used in ActionControl
See Also:
IFields, ActionControl

scoreTab

public static final int[] scoreTab
score for every field. Used in ActionControl
See Also:
ActionControl
Constructor Detail

Matrix

public Matrix(Matrix copy)
copy constructor

Matrix

public Matrix(java.io.File file)
       throws java.io.FileNotFoundException,
              java.io.IOException
Constructor. load the level from file

Matrix

public Matrix(java.io.InputStream is)
       throws java.io.IOException
Constructor. load the level from InputStream
Method Detail

loadMatrix

protected void loadMatrix(java.io.File file)
                   throws java.io.FileNotFoundException,
                          java.io.IOException
load the level from file

loadMatrix

protected void loadMatrix(java.io.InputStream is)
                   throws java.io.IOException
load the level from InputStream

matrixToString

public java.lang.String matrixToString()
convert the matrix to string to print it in the console

toString

public java.lang.String toString()
return the name of this level
Overrides:
toString in class java.lang.Object