wworld
Class Directions

java.lang.Object
  |
  +--wworld.Directions

public class Directions
extends java.lang.Object

This class is used to describe the directions in which the moving objects in the World can face.


Field Summary
static int DOWN
           
static int LEFT
           
static int RIGHT
           
static int UP
           
 
Constructor Summary
Directions(int lookingTo)
          Constructor for the facing or directions
 
Method Summary
 int getFacing()
          Returns the direction that is represented by the object.
 void setFacing(int i)
          Used to set the facing represented by this object.
 java.lang.String toString()
          Returns the direction or facing of the object as String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

UP

public static final int UP
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values
Constructor Detail

Directions

public Directions(int lookingTo)
Constructor for the facing or directions

Method Detail

getFacing

public int getFacing()
Returns the direction that is represented by the object.

Returns:
object facing or direction as integer.

setFacing

public void setFacing(int i)
Used to set the facing represented by this object.


toString

public java.lang.String toString()
Returns the direction or facing of the object as String.

Overrides:
toString in class java.lang.Object
Returns:
facing of the object - left, right, up or down as String.