Class Wall

java.lang.Object
  extended by Square
      extended by Wall

public class Wall
extends Square


Field Summary
static int X_DIRECTION
           
static int Y_DIRECTION
           
 
Constructor Summary
Wall(int x, int y, int direction)
          Construct a wall that is north or west of a robot at a given location
 
Method Summary
 void draw(java.awt.Graphics2D g2)
          Draws this beeper in 2D.
 int getDirection()
          Gets the direction of this wall.
 double getX()
          Gets the x location of the center of this wall.
 double getY()
          Gets the y location of the center of this wall.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X_DIRECTION

public static final int X_DIRECTION
See Also:
Constant Field Values

Y_DIRECTION

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

Wall

public Wall(int x,
            int y,
            int direction)
Construct a wall that is north or west of a robot at a given location

Parameters:
x - the x location of a robot adjacent to this wall
y - the y location of a robot adjacent to this wall
direction - X_DIRECTION or Y_DIRECTION
Method Detail

getX

public double getX()
Gets the x location of the center of this wall.

Returns:
the x location

getY

public double getY()
Gets the y location of the center of this wall.

Returns:
the y location

getDirection

public int getDirection()
Gets the direction of this wall.

Returns:
X_DIRECTION or Y_DIRECTION

draw

public void draw(java.awt.Graphics2D g2)
Draws this beeper in 2D. I use this for making diagrams.

Parameters:
g2 - the graphics context