draging mouse with button pushed over maze clear walls

warning this break resolving ( endless => hang ) TO FIX.
This commit is contained in:
philippe lhardy
2017-11-28 22:42:17 +01:00
parent fa0c705fd1
commit ce485f2263
2 changed files with 48 additions and 6 deletions

View File

@@ -61,6 +61,7 @@ public class LabyModel implements WallsProvider
private int width;
private int height;
// wall flags + status flags for each position (x,y)
private short[][] t;
private int depth = 0;
/**
@@ -114,6 +115,17 @@ public class LabyModel implements WallsProvider
this.listener = listener;
}
// FIXME FULLY BREAK RESOLVING...
public void noWalls(int x, int y)
{
if ((x > 0) && (x < width) && (y > 0) && (y < height))
{
// t[x][y] |= DIRECTION | VERTICAL | POSITIVE | HORIZONTAL | NEGATIVE | LEFT | RIGHT | UP | DOWN;
t[x][y] |= DIRECTION | VERTICAL | POSITIVE | HORIZONTAL | NEGATIVE;
t[x][y] |= LEFT | RIGHT | UP | DOWN;
}
}
// entry and exit can be outside the model boundaries a one x or one y out.
public boolean addEntryOrExit(int x, int y)
{
@@ -395,7 +407,8 @@ public class LabyModel implements WallsProvider
{
for (int x = 0; x < width; x++)
{
t[x][y] &= ~OPEN;
// resetCell(x,y);
t[x][y] &= ~OPEN;
}
}