PrintGame
Class CreateLabyrinth

java.lang.Object
  extended byPrintGame.CreateLabyrinth

public class CreateLabyrinth
extends java.lang.Object

class representing a two dimensional labyrinth


Field Summary
protected  boolean build_angle_
           
protected  int build_loop_
           
protected  boolean build_places_
           
protected  boolean build_tree_
           
protected  int col_
           
protected  LabyrinthField labyrinth_field_
           
protected  int loops_
           
protected  int max_col_
          the max number of cols max_col_=cols-1
protected  int max_loops_
           
protected  int max_row_
          the max number of rows max_row_=rows-1
protected  int max_way_lenght_
           
protected  int min_way_lenght_
           
protected  boolean new_point_
           
protected  int num_diamonds_
          the number of diamonds distributed in the field (set from outside of the class with the appropriate method-calls
protected  int num_way_cells_
          the number of way cells distributed in the field (set from outside of the class with the appropriate method-calls
protected  java.util.Random random_generator_
           
protected  RandomWayCoordinates randomwaycoordinates_
           
protected  int row_
           
protected  Direction way_direction_
           
protected  int way_lenght_
           
 
Constructor Summary
CreateLabyrinth(LabyrinthField labyrinth_field)
          Standard constructor
 
Method Summary
 void calculateWays()
           
protected  int getIntRandomValue(int min, int max)
           
 LabyrinthField getLabyrinthField()
           
 void setBuildAngles(int build_angle)
           
 void setBuildLoops(int build_loop)
           
 void setBuildPlaces(int build_place)
           
 void setBuildTrees(int build_tree)
           
 void setDiamonds()
           
 void setMaxWayLenght(int max_way_lenght)
           
 void setMinWayLenght(int min_way_lenght)
           
 void setNumDiamonds(int num_diamonds)
          method called from the outside to set the number of diamonds distributed in this labyrinthfield.
 void setNumWayCells(int num_way_cells)
          method called from the outside to set the number of way cells distributed in this labyrinthfield.
 java.lang.String toString()
          standard toString method for debugging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

num_diamonds_

protected int num_diamonds_
the number of diamonds distributed in the field (set from outside of the class with the appropriate method-calls


num_way_cells_

protected int num_way_cells_
the number of way cells distributed in the field (set from outside of the class with the appropriate method-calls


max_row_

protected int max_row_
the max number of rows max_row_=rows-1


max_col_

protected int max_col_
the max number of cols max_col_=cols-1


build_angle_

protected boolean build_angle_

build_tree_

protected boolean build_tree_

build_loop_

protected int build_loop_

build_places_

protected boolean build_places_

min_way_lenght_

protected int min_way_lenght_

max_way_lenght_

protected int max_way_lenght_

max_loops_

protected int max_loops_

loops_

protected int loops_

labyrinth_field_

protected LabyrinthField labyrinth_field_

random_generator_

protected java.util.Random random_generator_

randomwaycoordinates_

protected RandomWayCoordinates randomwaycoordinates_

row_

protected int row_

col_

protected int col_

way_lenght_

protected int way_lenght_

way_direction_

protected Direction way_direction_

new_point_

protected boolean new_point_
Constructor Detail

CreateLabyrinth

public CreateLabyrinth(LabyrinthField labyrinth_field)
Standard constructor

Throws:
java.lang.IllegalArgumentException - thrown if either rows or cols is < 0
Method Detail

setNumDiamonds

public void setNumDiamonds(int num_diamonds)
                    throws java.lang.IllegalArgumentException
method called from the outside to set the number of diamonds distributed in this labyrinthfield. It is not checked, whether this number exceeds the maximum allowed number. This has to be done beforehand.

Throws:
java.lang.IllegalArgumentException - thrown if the number of mines is < 0

setNumWayCells

public void setNumWayCells(int num_way_cells)
                    throws java.lang.IllegalArgumentException
method called from the outside to set the number of way cells distributed in this labyrinthfield. It is not checked, whether this number exceeds the maximum allowed number. This has to be done beforehand.

Throws:
java.lang.IllegalArgumentException - thrown if the number of way cells is < 0

setMinWayLenght

public void setMinWayLenght(int min_way_lenght)
                     throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

setMaxWayLenght

public void setMaxWayLenght(int max_way_lenght)
                     throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

setBuildAngles

public void setBuildAngles(int build_angle)
                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

setBuildTrees

public void setBuildTrees(int build_tree)
                   throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

setBuildPlaces

public void setBuildPlaces(int build_place)
                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

setBuildLoops

public void setBuildLoops(int build_loop)
                   throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getIntRandomValue

protected int getIntRandomValue(int min,
                                int max)
                         throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

calculateWays

public void calculateWays()

setDiamonds

public void setDiamonds()

getLabyrinthField

public LabyrinthField getLabyrinthField()

toString

public java.lang.String toString()
standard toString method for debugging

Returns:
info about the labyrinth field in string-format