public void MapArea() { MapArea map = new MapArea (10, 20); Assert.AreEqual (10, map.width); Assert.AreEqual (20, map.height); Assert.AreEqual (0, map.getHeightAt (0, 0)); Assert.AreEqual (0, map.getHeightAt (9, 19)); Assert.AreEqual (0, map.getHeightAt (7, 4)); Assert.AreEqual (0, map.getHeightAt (5, 10)); }
public void call(MapArea map) { int height = map.height; int width = map.width; for (var y=0; y<height; y++) { for (var x=0; x<width; x++) { float tile_h = map.getHeightAt(x, y); if ((greater_than && tile_h > h) || (!greater_than && tile_h < h)) { map.setHeightAt(x, y, h); } } } }
public void MapAreaWidthException() { MapArea map = new MapArea (3, 3); map.getHeightAt (3, 0); }
public void MapAreaHeightException() { MapArea map = new MapArea (3, 3); map.getHeightAt (0, 3); }