public class Point extends Object implements Comparable<Point>
Constructor and Description |
---|
Point(int x,
int y)
Constructs a new point given its coordinates
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Point o)
Compares two points first by their x coordinates
and then by their y coordinates.
|
Point |
getAbove()
Returns a new point that is directly above this one.
|
Point |
getBelow()
Returns a new point that is directly below this one.
|
Point |
getLeft()
Returns a new point that is directly left of this one.
|
Point |
getRight()
Returns a new point that is directly right of this one.
|
int |
getX()
Returns the x coordinate of the point
|
int |
getY()
Returns the y coordinate of the point
|
boolean |
isGoal()
Returns true if this point is the bottom
right point of the grid (e.g.
|
boolean |
isOOB()
Returns true if this point is outside the
bounds of the grid and false otherwise.
|
boolean |
isPassage()
Returns true if this point is an unvisited, non-wall part
of the maze and false otherwise.
|
boolean |
isWall()
Returns true if this point is a wall and false otherwise.
|
boolean |
isZero()
Returns true if this point is (0, 0) and
false otherwise.
|
void |
makeDeadEnd()
Sets the color of this point to the color of a dead
end in the path.
|
void |
makePassage()
Sets the color of this point to the unvisited
passage color
|
void |
makeVisited()
Sets the color of this point to the color of the
solution path.
|
void |
makeWall()
Sets the color of this point to the wall color
|
String |
toString()
Returns a string representation of the point of
the form "(x, y)".
|
public int getX()
public int getY()
public String toString()
public int compareTo(Point o)
compareTo
in interface Comparable<Point>
public Point getAbove()
public Point getBelow()
public Point getLeft()
public Point getRight()
public boolean isZero()
public boolean isGoal()
public boolean isOOB()
public boolean isWall()
public boolean isPassage()
public void makeWall()
public void makePassage()
public void makeVisited()
public void makeDeadEnd()