public void FindDoorwaysTest() { var detector = new MapFeatureDetector(mapIntArray); var doorways = detector.FindDoorways(); Debug.WriteLine(detector.ToMapString(doorways)); Assert.AreEqual(2, doorways[19, 21]); Assert.AreEqual(3, doorways[29, 28]); Assert.AreEqual(4, doorways[34, 24]); Assert.AreEqual(0, doorways[23, 43]); }
private static void IterateMaps(MapFeatureDetector detector, int[,] conv) { var min = conv.Min(); var max = conv.Max(); for (int i = min; i <= max; i++) { var splats = detector.FilterArray(conv, i); if (splats.Total() > 0) { Debug.WriteLine(i); Debug.WriteLine(detector.ToMapString(splats)); } } }
public void FindWallsTest() { var detector = new MapFeatureDetector(mapIntArray); var walls = detector.FindWalls(); Debug.WriteLine(detector.ToMapString(walls)); Assert.AreEqual(1, walls[12, 45]); Assert.AreEqual(1, walls[12, 27]); Assert.AreEqual(1, walls[13, 27]); Assert.AreEqual(1, walls[14, 27]); Assert.AreEqual(1, walls[20, 34]); Assert.AreEqual(1, walls[8, 30]); Assert.AreEqual(1, walls[8, 31]); Assert.AreEqual(1, walls[8, 32]); Assert.AreEqual(1, walls[8, 33]); Assert.AreEqual(1, walls[8, 34]); Assert.AreEqual(1, walls[8, 35]); }