public void grow(int dx, int dy) { Asserts.numberParam("dx").withValue(dx).atLeast(0); Asserts.numberParam("dy").withValue(dy).atLeast(0); dimension.grow(dx, dy); Asserts.numberVariable("dimension.width") .withValue(dimension.getWidth()) .atMost(worldDimension.getWidth()); Asserts.numberVariable("dimension.height") .withValue(dimension.getHeight()) .atMost(worldDimension.getHeight()); }
public Bounds(WorldDimension worldDimension, FloatPoint position, Dimension dimension) { this.worldDimension = worldDimension; this.position = position; this.dimension = dimension; Asserts.numberParam("dimension.width") .withValue(dimension.getWidth()) .atMost(worldDimension.getWidth()); Asserts.numberParam("dimension.height") .withValue(dimension.getHeight()) .atMost(worldDimension.getHeight()); }