prepare for hand drawing with maze.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.artisanlogiciel.games;
|
||||
|
||||
/** position of a cell with maze */
|
||||
public class Position
|
||||
{
|
||||
private int x, y;
|
||||
@@ -38,4 +39,20 @@ public class Position
|
||||
{
|
||||
return "(" + x + "," + y + ")" + "/" + depth;
|
||||
}
|
||||
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
// disregards depth
|
||||
if (other instanceof Position )
|
||||
{
|
||||
Position p = (Position) other;
|
||||
return (p.getX() == x) && (p.getY() == y);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user