refactoring, deploy Position and XYGridIterator
- try to use more Position instead of (x,y) - create PositionWithDpeth for its specific usage in path finding - create a XYGridITerator that walk cells from grid X then Y.
This commit is contained in:
24
java/org/artisanlogiciel/games/maze/PositionWithDepth.java
Normal file
24
java/org/artisanlogiciel/games/maze/PositionWithDepth.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package org.artisanlogiciel.games.maze;
|
||||
|
||||
public class PositionWithDepth
|
||||
extends Position
|
||||
{
|
||||
private int depth;
|
||||
|
||||
public PositionWithDepth(int x, int y, int depth)
|
||||
{
|
||||
super(x,y);
|
||||
this.depth = depth;
|
||||
}
|
||||
|
||||
public int getDepth()
|
||||
{
|
||||
return depth;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "(" + getX() + "," + getY() + ")" + "/" + depth;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user