public void deleteRegionsButTheBiggest_withSixRegionsRoom() { RectShape shape = new RectShape(new Cell(0, 0), new OIGrid(40, 40)); ShapeCellularAutomaton filler = new ShapeCellularAutomaton(48, 50, 5); filler.applyOn(shape); Assert.AreEqual(6, shape.regionsNumber()); shape.deleteRegionsButTheBiggest(); Assert.AreEqual(1, shape.regionsNumber()); }
public void deleteRegionsButTheBiggest_bug() { RectShape shape = new RectShape(new Cell(0, 0), new OIGrid(10, 10)); ShapeCellularAutomaton auto = new ShapeCellularAutomaton(1683686970, 58, 5); auto.applyOn(shape); Assert.AreEqual(1, shape.regionsNumber()); shape.deleteRegionsButTheBiggest(); Assert.AreEqual(1, shape.regionsNumber()); }
public void deleteRegionsButTheBiggest_withOneRegion() { RectShape shape = new RectShape(new Cell(0, 0), new OIGrid(10, 10)); //REG 1 shape.setCellValue(1, 1, XTile.FLOOR); Assert.AreEqual(1, shape.regionsNumber()); shape.deleteRegionsButTheBiggest(); Assert.AreEqual(1, shape.regionsNumber()); Assert.IsTrue(shape.hasCellValue(1, 1, XTile.FLOOR)); }