PrintGame
Class Condition

java.lang.Object
  extended byPrintGame.Condition

public class Condition
extends java.lang.Object

class representing a Condition


Field Summary
protected  int cell_mark_
           
protected  int state_
           
protected  boolean wall_ahead_
           
protected  boolean wall_left_
           
protected  boolean wall_right_
           
 
Constructor Summary
Condition(int state, int cell_mark, boolean wall_left, boolean wall_right, boolean wall_ahead)
          constructor generates a new condition with the specified arguments
 
Method Summary
 boolean equals(Condition test_condition)
          method compares 2 conditions and returns true if they are equal.
 int getCellMark()
           
 int getState()
           
 boolean isWallAhead()
           
 boolean isWallLeft()
           
 boolean isWallRight()
           
 void setCellMark(int cell_mark)
          method sets the cell mark
 void setState(int state)
           
 void setWalls(boolean wall_left, boolean wall_right, boolean wall_ahead)
          method sets if the cells in field of vision of the robot are ways or walls
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wall_left_

protected boolean wall_left_

wall_right_

protected boolean wall_right_

wall_ahead_

protected boolean wall_ahead_

cell_mark_

protected int cell_mark_

state_

protected int state_
Constructor Detail

Condition

public Condition(int state,
                 int cell_mark,
                 boolean wall_left,
                 boolean wall_right,
                 boolean wall_ahead)
          throws java.lang.IllegalArgumentException
constructor generates a new condition with the specified arguments

Parameters:
wall_left - false means that the cell on the left of the robot is a way
wall_right - false means that the cell on the right of the robot is a way
wall_ahead - false means that the cell in front of the robot is a way
cell_mark - 0 if the cell is not marked
Method Detail

setWalls

public void setWalls(boolean wall_left,
                     boolean wall_right,
                     boolean wall_ahead)
method sets if the cells in field of vision of the robot are ways or walls

Parameters:
wall_left - false means that the cell on the left of the robot is a way
wall_right - false means that the cell on the right of the robot is a way
wall_ahead - false means that the cell in front of the robot is a way

setCellMark

public void setCellMark(int cell_mark)
                 throws java.lang.IllegalArgumentException
method sets the cell mark

Parameters:
cell_mark - 0 if the cell is not marked 1 if the cell is marked for the first time 2 if the cell was marked before
Throws:
java.lang.IllegalArgumentException

setState

public void setState(int state)
              throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

isWallLeft

public boolean isWallLeft()

isWallRight

public boolean isWallRight()

isWallAhead

public boolean isWallAhead()

getCellMark

public int getCellMark()

getState

public int getState()

equals

public boolean equals(Condition test_condition)
method compares 2 conditions and returns true if they are equal.


toString

public java.lang.String toString()