Preventing flooder from checking same node.
Added another flooder test.
This commit is contained in:
@@ -99,4 +99,19 @@ public class FloodFillTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillMapBNonCorner() {
|
||||
Flooder flooder = new Flooder(new Point2(43, 11), new Flood(mapB));
|
||||
flooder.start();
|
||||
for (int y = 0; y < mapB.length; y++) {
|
||||
for (int x = 0; x < mapB[y].length; x++) {
|
||||
if (x > 21 && y > 15 && x < 27) {
|
||||
assertTrue(mapB[y][x] > 0, String.format("At: %d, %d", x, y));
|
||||
} else {
|
||||
assertEquals(0, mapB[y][x], String.format("At: %d, %d", x, y));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user