PrintGame
Class Action

java.lang.Object
  extended byPrintGame.Action

public class Action
extends java.lang.Object

class representing an action


Field Summary
protected  int cell_mark_
           
static int MOVE_AHEAD
           
static int MOVE_BACK
           
static int MOVE_LEFT
           
static int MOVE_RIGHT
           
protected  int moving_direction_
           
protected  int state_
           
 
Constructor Summary
Action(int state, int cell_mark, int moving_direction)
          Standard constructor
 
Method Summary
 int getCellMark()
          method returns the value of the cell mark
 int getMovingDirection()
          method returns a relative direction.
 int GetState()
           
 void setCellMark(int cell_mark)
          method sets the value of cell mark
 void setMovingDirection(int moving_direction)
          method sets a relative direction used to move the robot.
 void setState(int state)
          -----------------------------------------------------------------------------
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MOVE_AHEAD

public static final int MOVE_AHEAD
See Also:
Constant Field Values

MOVE_BACK

public static final int MOVE_BACK
See Also:
Constant Field Values

MOVE_LEFT

public static final int MOVE_LEFT
See Also:
Constant Field Values

MOVE_RIGHT

public static final int MOVE_RIGHT
See Also:
Constant Field Values

cell_mark_

protected int cell_mark_

state_

protected int state_

moving_direction_

protected int moving_direction_
Constructor Detail

Action

public Action(int state,
              int cell_mark,
              int moving_direction)
       throws java.lang.IllegalArgumentException
Standard constructor

Parameters:
moving_direction - relative direction
cell_mark -
Method Detail

setCellMark

public void setCellMark(int cell_mark)
                 throws java.lang.IllegalArgumentException
method sets the value of 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

setMovingDirection

public void setMovingDirection(int moving_direction)
                        throws java.lang.IllegalArgumentException
method sets a relative direction used to move the robot.

Parameters:
moving_direction - possible directions are ahead, back, left and rigth.
Throws:
java.lang.IllegalArgumentException

getMovingDirection

public int getMovingDirection()
method returns a relative direction.


getCellMark

public int getCellMark()
method returns the value of the cell mark


GetState

public int GetState()

toString

public java.lang.String toString()